请将对应没有加入混淆的代码加入至proguard文件中
可能引起的现象:SophixStub热更新初始化失败java.lang.RuntimeException: abandon initialization: installProviders
Unable to create application com.xxx.xxx.common.SophixStubApplication: java.lang.RuntimeException: abandon initialization: installProviders
例如:
Caused by: java.lang.NoSuchMethodError: No interface method o(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; in class Landroid/content/res/XmlResourceParser; or its super classes (declaration of 'android.content.res.XmlResourceParser' appears in /system/framework/framework.jar)
at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:8)
at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:3)
at androidx.core.content.FileProvider.attachInfo(FileProvider.java:4)
请在 proguard-rules.pro 文件中加入:
-keep class org.xmlpull.v1.** { *;}
-dontwarn org.xmlpull.v1.**
文章讨论了在Android开发中遇到的SophixStub热更新初始化失败的问题,其原因是由于Proguard混淆导致的NoSuchMethodError。解决方案是在proguard-rules.pro文件中添加特定的保留规则,如保持org.xmlpull.v1包下的所有类不被混淆。
1449

被折叠的 条评论
为什么被折叠?



