尊重原创

1.uses-sdk:minSdkVersion 1 cannot be smaller than version 4 declared in library [com.android.support:sup

根据报错提示:最低兼容版本api 1低于v7兼容类库的api 7,找到app的gradle发现设置了最低兼容9,并不是1啊.

android {
...
defaultConfig {
minSdkVersion 10
targetSdkVersion 19
}
...
}
完美搞定 perfect 2.Failed to execute aapt
这个在网上也收到过一些
  1.apt-get install lib32stdc++6
  2.在SDK Tool中添加需要的tools
  3,我是把项目册了重新添加完成的,本质就是R文件找不到了 3. Error: java.lang.RuntimeException: Crunching Cruncher ic_launcher.png failed, see logs
   aaptOptions {
         cruncherEnabled = false
          useNewCruncher = false
 
      }

4.Error:Application and test application id cannot be the same: both are 'com.itheima.im3' for debugAndroidTest

把这个删除就Ok了 很简单的


/*testApplicationId "com.itheima.im3"
testInstrumentationRunner "android.test.InstrumentationTestRunner"*/ 5.java: 类重复: com.xx.R解决方法

  蓝色部分表示打包时包含在Source内, 下面是遇到的两个问题


  1. src目录未选成Sources导致所有类文件未被编译到生成的包内。

   2. 错误的把整个工程选中Sources,导致 R文件及gen下的其他文件出现类重复。

  3.把代&的类删除,

 
6.Installation failed with message INSTALL_CANCELED_BY_USER.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present,
and then re-installing.
1. 确保手机处于开发者模式。
2. 在手机上,勾选 系统设置->安全->未知来源 ,然后重试。
3. 安装的时候手机是否处于锁屏状态,若是的话,取消锁屏。
4. 有的手机需要手动安装。如小米3 小米手机还要在开发模式中开启install via USB
4. 其他的就是手机内存空间之类的啦。
 7. Error: A library uses the same package as this project: com.minisea.example

  You can add enforceUniquePackageName=false in the app modules build.gradle file under android:
  android {
    compileSdkVersion 23
   buildToolsVersion "23.0.1"
    enforceUniquePackageName = false ... } 8. Multiple dex files define Lcom/minisea/example/BuildConfig;
  在Build
    android中加入
      enforceUniquePackageName = false 9.

<span style="font-family: Arial, Helvetica, sans-serif; ">一</span>

今天打开AndroidStudio, 莫名其妙的全部工程都报错了,丢了个这样的错误:

Gradle sync failed: Could not run build action using Gradle installation 'D:\Android-studio-2.0-pre4

解决方法:File -> Settings -> 搜索Gradle 配置下Gradle的路径,并且把离线编译选项给勾上。




10.新建项目出现没找到资源的错误!找不到com.android.support/appcompat-v7/23.0.1/res/values-v23/values-v23.xml
     No resource found that matches the given name 'android:Widget.Material.Button.Colored'. 
这是API 23(Android 6.0)中的资源文件,而查看build.gradle,编译的SDK只是为21,我们可以尝试将compileSdkVersion设为23
如果不想下载API 23怎么解决呢?降低appcompat的版本:将build.gradle里面的dependencies对应的appcompat版本降低:

在dependencies中将compile 'com.android.support:appcompat-v7:23.0.1'的版本改为:'com.android.support:appcompat-v7:22.2.1'



11.Error:Error converting bytecode to dex:

  1. Cause: java.lang.RuntimeException: Translation has been interrupted
  项目中存在相同的jar包,导致运行失败!
  解决办法:删除相同的jar包即可,一般是你刚才添加了某个依赖有冲突
 
 
 
12.finished with non-zero exit value 1和Return code 1 for dex process.
    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.0"

    //添加如下代码即可解决
        dexOptions {
            javaMaxHeapSize "4g"
        }
    }

 
 
 13. Theme.AppCompat.Light无法找到问题 

    使用adt开发新建一个Android app,选择支持的SDK版本如果小于11(Android3.0)就会报如下错误。
    No resource found that matches the given name 'Theme.AppCompat.Light'.
    简单来说就是新的eclipse默认模版主题UI需要使用比较高版本api,如果需要支持低版本,需要导入appCompact库来支持,网上一般给出的解法:
    File->Import (android-sdk\extras\android\support\v7). Choose "appcompat"
    Project-> properties->Android. In the section library "Add" and choose "appCompat" 14.Parse Error
路径或是包名大写了

15.AS的代码编辑窗口中和运行时,中文显示乱码

  解决:AS的代码编辑窗口中的乱码,只需要把IDE右下角的UTF-8改为GBK;运行时显示乱码,1、在project->app->build.gradle中添加compileOptions.encoding = "GBK"。2、不能在布局文件中直接输入中文,需要在R文件中注册下,比如<activity  android:label="中文" >改为<activity  android:label="@string/chinese" >,在strings.xml中添加<string name="chinese">中文</string>。

16.app:transformNative_libsWithStripDebugSymbolForDebug

  这一是个关于Android studio配置jni时候出现的错误

//ndk.dir=D\:\\Android_SDK\\ndk-bundle 把ndk去掉

17.Manifest merger failed with multiple errors, see ?

  这个问题困扰了我半天,最后终于解决了

    尝试的方法有:

    1.很大可能是SDK版本,建议给出log看一下

        

  2.

  你看一下Error:Execution failed for task ':app:processDebugManifest'.
  > Manifest merger failed with multiple errors, see logs这句话的上面显示的error日志,它说的很清楚,我也出现这个问题.原因是导入的库在build.gradle中的minSdkVersion与你的应用的minSdkVersion不  匹配导致的(app要求应用最小系统版本和库要求系统最小版本不一致),改成一样的就行了
 
  4.
  我是这样解决的
  xmlns:tools="http://schemas.android.com/tools"
  android:allowBackup="true"
  tools:replace="icon, label, theme,allowBackup"
 
    网上解决方法有两种

    方法1:在Manifest.xml的application标签下添加tools:replace=”android:icon, android:theme”(多个属性用,隔开,并且记住在manifest根标签上加入        xmlns:tools=”http://schemas.android.com      /tools”,否则会找不到namespace哦)

    方法2:在build.gradle根标签上加上useOldManifestMerger true (懒人方法)

 18 。Failed to execute aapt
 
  在build中添加  compile 'com.yuyh.bubble:library:1.0.0' 就好了,这个是干什么的不明白?(有懂的请教下)
  后为发现加了这个也可以了compile 'com.android.support:appcompat-v7:25.3.1'
  但是Theme.AppCompat.Light.DarkActionBar这个style报错是没治了...
 
 
19. .9path
    1. aaptOptions.cruncherEnabled = false
    2. aaptOptions.useNewCruncher = false
20 .Multiple dex files define Landroid/support/v4/accessibilityservice/Accessibi
compile ('in.srain.cube:cube-sdk:1.0.42.1'){
exclude module: 'support-v4'
}
去掉in.srain.cube:cube-sdk:1.0.42.1中的包不加载即可。 20.v4包中MergingForDebu的问题   Ctrl+N --> 在搜索框中输入BackStackState --> 查找到所有引用该类的类,这些类即为引起冲突的类 21 .UnsupportedMethodException

22 .依赖包冲突解决办法

项目中使用的library版本是23,但是项目引用的包引用的library版本是24,这样就会出现冲突,报错如下:

解决办法,使用exclude,排除冲突的依赖包:

 compile ('com.bat:apploginsdk:1.0.1') {
// exclude module : 'okhttp'
// exclude module : 'com.android.support'
exclude group: 'com.android.support', module: 'recyclerview-v7'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'design'
exclude group: 'com.android.support', module: 'appcompat-v7'
}
23.compileSdkVersion rootProject.ext.android["compileSdkVersion"]sdk版本问题?
defaultConfig {
applicationId "me.jessyan.mvparms.demo"
      //... jackOptions { //加上这句可以尝试下
enabled true
}
}
 24.Error retrieving parent for item: No resource found that matches
看看你的build.gradle文件里面的compileSdkVersion
和compile 'com.android.support:'版本是不是对应的 25.Error:No such property: GROUP for class: org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer
一般都是applay from 引起的 25.R文件找不到是经常遇到的问题  1.导包的正确
  2.清理缓存
  3.clear,reBuild,MakePorject,最后inValidate Cache
 
26.乱码问题,GBK不能映射字符
allprojects {
    tasks.withType(Javadoc) {
        options{
            encoding "UTF-8"
            charSet 'UTF-8'
        }
    }
} 27.android.system.ErrnoException: open failed: EACCES (Permission denied)
这个是因数权限的问题,解决问题有:
  1.可以在代码中添加权限
  2.targetSdkVersion 改为小于23的就行 28.昨天在写相册的时候,目录怎么就提示有问题(No such file or directory)
  是因为dir.mkdir()和dir.mkdirs()的不同, 29.The specified child already has a parent. You must call removeView() on the child's parent first //放到for下面就可以了
我是把自定义的view放在了for外面导致的
 

AndroidStudio遇到过的问题的更多相关文章

  1. AndroidStudio — Error:Failed to resolve: junit:junit:4.12错误解决

    原博客:http://blog.csdn.net/u013443865/article/details/50243193 最近使用AndroidStudio出现以下问题: 解决:打开app下的buil ...

  2. AndroidStudio安装流程 以及 使用过程中出现的异常

    Android Studio2.0 教程从入门到精通Windows版 - 安装篇 Android Studio第一次启动跳不过“ downloading components”解决方案 通过hosts ...

  3. 整理分享原生态mac AndroidStudio的快捷键

    使用AndroidStudio开发半年了,一路爬坑至今,刚由Windows转mac一个星期.通过查些资料和自己摸索,记录一些常用的快捷键,犹豫个人不喜欢改快捷键,所以都是原生的.特此分享给大家!欢迎补 ...

  4. Cocos2dx 3.12 在AndroidStudio上编译配置

    转载请标明出处:http://www.cnblogs.com/studweijun/p/5805576.html SDK,NDK,ANT的配置请看这里http://www.cnblogs.com/st ...

  5. AndroidStudio 1.4配置NDK

    AndroidStudio(AS) 1.3之后已经支持NDK,这为NDK开发提供了极大的便利,不在需要配置各种头疼的MK文件,简单的九步就可完成配置.要说明的是,第一次配置AS一定要有耐心. 0,下载 ...

  6. 完全卸载AndroidStudio

    一:卸载Android Studio 由于从1.5正式版直接升级到2.1的版本,整个项目构建都变得异常的慢,所以决定卸载重新安装2.0的正式版.但是Mac下使用dmg安装的app很多都是不能使用拖拽的 ...

  7. AndroidStudio使用过程中遇到的bug

    Ref:http://www.cnblogs.com/jingmo0319/p/5781878.html 1. Error:Execution failed for task ':app:transf ...

  8. 在安装AndroidStudio时产生的问题

    JDK安装完毕,环境变量也配置完了,AndroidStudio安装完了,其中SDK使用了自己下载好的包. 但是第一次打开AndroidStudio的时候出现了错误: java.lang.Runtime ...

  9. AndroidStudio错误总结及解决(待续)

    AndroidStudio错误总结及解决 一. 当安装好AndroidStudio开启的时候出现如下错误: 百度的解决方法: 1)进入刚安装的Android Studio目录下的bin目录.找到ide ...

  10. androidstudio报错

    今天换一下IDE,结果上来就给我报错, androidstudio message:Error:java.lang.UnsupportedClassVersionError: com/android/ ...

随机推荐

  1. deepin linux手工更新系统

    sudo apt-get updatesudo apt-get dist-upgrade -y 可以使用阿里云的镜像

  2. ios的一些经验记录1

    1.UITextAlignment  ---> NSTextAlignment 2.找不到segue viewcontroller 与segue要对应 3.标题栏用NavigationContr ...

  3. 在centos中安装mangodb

    1.下载完安装包,并解压 tgz(以下演示的是 64 位 Linux上的安装) curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_6 ...

  4. Winform中导入exicel文件

    Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); ...

  5. 【C#】访问泛型中的List列表数据

    光看标题的确不好说明问题,下面描述一下问题场景: 已知后端自定义的返回的Json数据结构如下: response: { "message": "返回成功", & ...

  6. java并发编程()阻塞方法与中断方法

    看完这篇,我感觉我对java多线程又懵逼了. 线程可能会阻塞或暂停执行,原因有多种: 等待I/O操作结束 等待获得一个锁 等待从Thread.sleep方法中醒来 等待另一个线程计算的结果 当线程阻塞 ...

  7. Json转list,两种包,两种方式

    1.使用fastjson 对于json串大小写没什么要求,测试的时候,我把javaBean属性设置成和json串一样的大小写,代码如下: package com.myTest.json.test1; ...

  8. Tomcat 添加为系统服务 开机自动启动

    http://jingyan.baidu.com/article/a65957f4b12b8724e77f9b5a.html Tomcat是Apache 软件基金会(Apache Software F ...

  9. u-boot可ping通PC,PC不可ping通u-boot

    http://blog.csdn.net/ce123_zhouwei/article/details/7339134 开发板运行U-Boot,在终端下使用Ping命令是能Ping通PC机,但PC机Pi ...

  10. javascript 图片滚动

    <div style="width:9999px;"> <ul id="marquePic1_1"> <li> <dl ...