在添加过混淆规则后,app打包的时候,发现报错了
java.lang.runtimeexception: expected instanceof glidemodule, but found: com.kevin.play.view.glidemodule@2e4554f at com.bumptech.glide.module.manifestparser.parsemodule(manifestparser.java:87) at com.bumptech.glide.module.manifestparser.parse(manifestparser.java:47)
这意思是manifestparser解析出问题了,可以看到
/** * returns {@code true} if glide should check the androidmanifest for {@link glidemodule}s. * * <p>implementations should return {@code false} after they and their dependencies have migrated * to glide's annotation processor. * * <p>returns {@code true} by default. */ public boolean ismanifestparsingenabled() { return true; }
依赖中使用了glide的 annotation processor.需要在他的实现类里返回false
所以解决方案是在你自己写的实现appglidemodule那个类中添加如下方法即可:
@override public boolean ismanifestparsingenabled() { return false; }
unresolved reference glideapp
解决完问题一,发现又报了问题二
原来是需要在glide的moudle处进行make project.
需要在使用glide的地方使用glideapp
make project后,发现有了glideapp但是依然报这个错误,经过搜索发现,是kotlin
不兼容glideapp,就改为了java,
参考链接
如对本文有疑问, 点击进行留言回复!!
网友评论