第一个问题,提示
Error-Expected resource of type
styleable
[ResourceType]
.
ps:因为我用了沉浸式状态栏技术,在做的时候用到了一个工具类:
SystemBarTintManager
通过百度找到解决方案:http://blog.csdn.net/mynameishuangshuai/article/details/51799410
在方法顶上,或者类名顶上加上这句代码.
@SuppressWarnings("ResourceType")
public SystemBarTintManager(Activity activity) {
……
}
第二个问题,编译后运行项目时在logcat报出找不到 GlideModule还是它有问题什么的,于是我又百度了,然后找到这里有混淆规则:http://blog.csdn.net/qq_19711823/article/details/51243918
按照上面的混淆规则加入到规则文件.
-keep public class * implements com.bumptech.glide.module.GlideModule
意思就是声明了相同的jar包的意思吧.
百度到:http://blog.csdn.net/ylbf_dev/article/details/50448727
解决方式:
打开混淆规则文件,proguard-project.txt 或者proguard-rules.pro 或者
在所有的
proguard.cfg
在所有的
-libraryjars
前插入 # 成 #-libraryjars xxxx.jar
第四个问题:
Warning:uk.co.senab.photoview.PhotoViewAttacher: can't find referenced metho...
项目中使用的这个PhotoView报警了.
百度到的:http://stackoverflow.com/questions/32118655/you-need-to-use-a-theme-appcompat-theme-with-theme-appcompat-as-theme-sdk-v23
解决方式,根据答主的方法在混淆文件中添加:
-dontwarn uk.co.senab.photoview.**
第五个问题:
warning: Ignoring InnerClasses attribute for an anonymous inner class...
编译时报了警告,但是签名包还是打出来了.而且用的时候也没事.就是看着不爽.
解决方式:
百度到的方法: http://blog.csdn.net/IDrinkMoreWater/article/details/46679787
1.在混淆规则文件proguard-project.txt(貌似正常的as工程是proguard-rules.pro)中添加一句
-keepattributes EnclosingMethod
2.在项目的
module的build.gradle文件(注意别搞错
build.gradle文件)中:
buildTypes {
debug {
debuggable true
jniDebuggable true
zipAlignEnabled true
minifyEnabled false
shrinkResources false
signingConfig signingConfigs.debug //这句我加入后有问题,我把它去了,只添加上面
}
release {
debuggable false
jniDebuggable false
zipAlignEnabled true
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.release //这句我加入后有问题,我把它去了,只添加上面的
proguardFiles getDefaultProguardFile('proguard- android.txt'), 'proguard-rules.pro'
}
}
第六个问题:AndFix报警.这个没法截图说明.
在原先的eclipse项目中使用了热修复框架AndFix,当时做的是工程依赖而不是jar依赖的形式(ps:因为andFix中有C代码无法打包成jar依赖),所以转到as这边也给我转的是module依赖的形式.
后来报错说是找不到里面的某个类.机智如我果断删除AndFix的module,去掉依赖后我直接上github去官方andfix拿到使用它的标准依赖方式.
以上问题无法分清先后发生,博主都是把问题都解决完才整理的.希望能有帮助.