1.如果出现版本不对应的画就去下载:Tools->Android->SDK Manager…
2.界面多了可以File->Close Project.
3.设置项目为library需要在build.gradle中设置:apply plugin: ‘com.android.library’;反之build.gradle中设置:apply plugin: ‘com.android.application’
4.一个工程中导入多个项目:File->New->New Moudle->Import Eclipse ADT Project->Next…
5.ndk安装.
6.字符编码设置.
7.异常:
Error:(11, 1) A problem occurred evaluating project ‘:diffUpdateDemo’.
Error: NDK integration is deprecated in the current plugin. Consider trying the new experimental plugin. For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental. Set “android.useDeprecatedNdk=true” in gradle.properties to continue using the current NDK integration.
解决:
在gradle.properties文件中添加android.useDeprecatedNdk=true(使用本地的ndk,如果没有这个文件,就收到创建一个这样的文件)
8.先屏蔽了:
compile project(‘:diffUpdateDemo’)
以为它老是提示编译ndk
9.外部包总是报.9图片错位,目前思路是将保存的项目部设置成外部包,然后运行一个个查找错误。
12.studio怎么打正式包,带key的,还有加固可以不。
13.zigong…里面的TrafficControlMeasuresActivity类屏蔽
14.异常:
Error:Execution failed for task ‘:ziGongLanternFestival:compileReleaseJavaWithJavac’.
Compilation failed; see the compiler error output for details.
Error:(1, 1) 错误: 非法字符: \65279
解决:
http://jingyan.baidu.com/article/dca1fa6f4cea7cf1a5405210.html
15.错误: 程序包org.apache.http不存在
解决:http://blog.csdn.net/xudongjhdd/article/details/50081755
16.异常:
Error:(31, 20) 错误: 找不到符号
符号: 方法 cos(float)
位置: 类 FloatMath
解决:
http://blog.csdn.net/rongwenbin/article/details/51240884
17.异常:
Error:Execution failed for task ‘:talkback_panda:processReleaseManifest’.
Manifest merger failed with multiple errors, see logs
解决:
http://blog.csdn.net/lby159951/article/details/51082761
18.异常:
Manifest merger failed with multiple errors, see logs
解决:
http://blog.csdn.net/garybook/article/details/32077193
最后还是修改的外部包的AndroidMainnifest.xml.
19.异常:
Error:Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘d:\install\Android_Studio_Android_SDK\Android\sdk1\build-tools\20.0.0\aapt.exe” finished with non-zero exit value 42
解决:
删除了ic_ydy1.png,ic_ydy2.png,ic_ydy3.png.
20.异常:
Error:(25, 33) 错误: 程序包com.amap.map3d.demo.utils不存在
Error:(509, 4) 错误: 找不到符号
解决:http://www.cnblogs.com/mapleyuan/p/5302595.html
21.异常:
为什么运行程序,会编译外部包里面的jni代码,是通过什么设置的?可以屏蔽掉吗?
解决:
22.异常:
Error:(6) note: did you mean to use @+id instead of @+android:id?
解决:
http://bbs.csdn.net/topics/390953705
23.屏蔽:
①com.traffic.panda.views.NotificationManagerUtil类中的创建Notification屏蔽了。
②com.traffic.panda.utils.FriendMessageNotification的第80行.
24.异常:
Error:(323, 19) 错误: 找不到符号
符号: 方法 sqrt(float)
位置: 类 FloatMath
解决:
将FloatMath替换为Math即可。
25.异常:
Error:Execution failed for task ‘:panda30:transformClassesWithDexForDebug’.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘D:\install\Java\bin\java.exe” finished with non-zero exit value 2
解决:
http://www.cnblogs.com/earl-yongchang/p/5056565.html
26.异常:
Error:Execution failed for task ‘:panda30:transformClassesWithJarMergingForDebug’.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/nostra13/universalimageloader/cache/disc/BaseDiscCache.class
解决:
http://stackoverflow.com/questions/32007296/duplicate-entry-in-android-studio
27.异常:
Error:Execution failed for task ‘:panda30:transformResourcesWithMergeJavaResForDebug’.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/NOTICE.txt
File1: C:\Users\Administrator.gradle\caches\modules-2\files-2.1\com.alibaba\fastjson\1.2.12\f693a82acf6c8fb89c6ed75f9e736b601be1e262\fastjson-1.2.12.jar
File2: E:\studio_workspace\panda30\build\intermediates\exploded-aar\studio_workspace\testActivity\unspecified\jars\classes.jar
解决:
http://blog.csdn.net/janronehoo/article/details/47973753
28.异常:
如何忽略合并AndroidManifest.xml
解决:
29.异常:
AAPT err(Facade for 153940352): E:\studio_workspace\panda30\build\intermediates\exploded-aar\studio_workspace\ziGongLanternFestival\unspecified\res\drawable\arrow.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
解决:
png图片错误,重新编辑下再保持就行了。
30.异常:
Error:(3) Error: In Gradle projects, always use http://schemas.android.com/apk/res-auto for custom attributes [ResAuto]
解决:
吧那句话改成:xmlns:panda=”http://schemas.android.com/apk/res-auto”
31.异常:
Error:(267) Error: Duplicate id @+id/textView1, already defined earlier in this layout [DuplicateIds]
解决:
id重复,换下id就可以了。
简单粗暴方法(不用换id):
android {
lintOptions{
checkReleaseBuilds false
abortOnError false
}
32.异常:
not found “android-apt”.
解决:
在全局的build.gradle文件的dependencies里面添加“classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.3’”
33.异常:
Error:No such property: projectDependencies for class: com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated
解决:
解决方法:project build.gradle 中 ‘com.neenbedankt.gradle.plugins:android-apt:1.3+’ 中的版本号1.3+改为1.4
34.Google65535的解决方法:
http://blog.csdn.net/t12x3456/article/details/40837287
33、问题描述:
屏蔽setting.gradle中的include代码造成无法识别Android项目(nothing to show)。
问题原因:当屏蔽掉include时,studio会把项目从工作空间中移除。
(文件名字:E:\studio_workspace_edit.idea\vcs.xml)
解决:先放开屏蔽setting.gradle中的include代码,然后先close工程,再然后open an existing Android Studio project,出现提示,点击Add Root,然后build即可。
34、问题描述:
导入studio项目后报错:
“`
Error:Execution failed for task ‘:app:mergeDebugResources’.
Error: com.android.builder.internal.aapt.AaptException: Failed to crunch file E:\fenghailin\Open_Source\tenxunyun_yuntongxin\IM_Android_SDK_2.5.5\IM_Android_SDK_2.5.5\samples\sample\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\res\drawable-hdpi\abc_textfield_search_default_mtrl_alpha.9.png into E:\fenghailin\Open_Source\tenxunyun_yuntongxin\IM_Android_SDK_2.5.5\IM_Android_SDK_2.5.5\samples\sample\app\build\intermediates\res\merged\debug\drawable-hdpi\abc_textfield_search_default_mtrl_alpha.9.png
问题解决:
将路径改短即可,因为在Windows中不允许存在比较长的路径名称所造成的,路径长度必须低于240个字符,遂把路径改短后,AS顺利编译通过。