1.
问题:9图会报错将9图的后缀改掉。
解决方法:修改成png就可以了。
2.
问题:Android Studio正式版签名的时候出现:Android xxx is not translated in zh。
解决方法:强制不翻译。转自:http://blog.csdn.net/u014083596/article/details/45191943
<resources
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingTranslation" >
</resources>
问题:the same input jar is specified twice
解决方法:链接:http://www.xiaoyunduo.org/article/236/
在所有的-libraryjars 前插入 # 成 #-libraryjars xxxx.jar
原因分析,可能是高版本的 sdk 通过 proguard 混淆代码时默认已经将 lib目录中的 jar 都已经添加到打包脚本中,所以不需要再次手动添加。
4.
问题:如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k
解决方法:转自:http://www.cnblogs.com/zhaoyanjun/p/5390690.html
三:分割 Dex 文件实现方法
1、相关链接
https://developer.android.com/tools/building/multidex.html#about
2、在app的 build.gradle 中
(1)在dependencies 中添加
compile 'com.android.support:multidex:1.0.1'
(2)在 defaultConfig 中添加
multiDexEnabled true
比如
1 defaultConfig { 2 applicationId "com.pegasus.map" 3 minSdkVersion 15 4 targetSdkVersion 23 5 versionCode 1 6 versionName "1.0" 7 signingConfig signingConfigs.config 8 multiDexEnabled true 9 }
(3)在 AndroidManifest.xml 中的 application 标签中添加
1 <?xml version="1.0" encoding="utf-8"?> 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 package="com.example.android.multidex.myapplication"> 4 <application 5 ... 6 android:name="android.support.multidex.MultiDexApplication"> 7 ... 8 </application> 9 </manifest>
提示:如果你的应用程序继承 Application , 那么你需要重写
1 @Override 2 protected void attachBaseContext(Context base) { 3 super.attachBaseContext(base); 4 MultiDex.install(this) ; 5 }
5.
问题:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> java.lang.OutOfMemoryError: GC overhead limit exceeded
解决方法:链接:http://stackoverflow.com/questions/35034830/android-studio-gc-overhead-limit-exceeded
dexOptions {
javaMaxHeapSize "4g"
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.xxxxx.android"
minSdkVersion 16
targetSdkVersion 23
versionCode 8
versionName "1.3"
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
6.
问题:android studio 非法字符: \65279如何解决
解决方法
在刚刚从eclipse转到使用studio经常会遇到这个问题
解决方法,下载一个Notepad++,然后将格式错误的那个类用Notepad++打开,在Notepad++中格式里保存为无bom编码 格式。然后再去studio里make一下就可以了