Describe the issue
A clear and detailed description of what the issue is.
Build Environment
- Operating System: [Android X]
- Gradle Plugin Version: [4.1.3]
- Gradle Version: [ 6.5]
- Fat-aar Version: [1.3.6]
报错描述:
在一个module中引用了高德的sdk 都是jar包,高德sdk中包含了R文件,当我把这个模块和其他模块合并到一起的时候这个R文件就不见了,A 模块 + B模块(包含了高德的sdk) -> Main 模块,运行的时候会报如下错误。
经过查看,发现一段比较有用的错误:
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.amap.api.navi.R$styleable" on path: DexPathList[[zip file "/data/app/~~rnDntkfejlbYz4Ea04-6fg==/com.mh.testmodule-B6aq6e2MQGh25CuurNEz9A==/base.apk"],nativeLibraryDirectories=[/data/app/~~rnDntkfejlbYz4Ea04-6fg==/com.mh.testmodule-B6aq6e2MQGh25CuurNEz9A==/lib/arm64, /data/app/~~rnDntkfejlbYz4Ea04-6fg==/com.mh.testmodule-B6aq6e2MQGh25CuurNEz9A==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
2021-06-01 13:02:23.816 28599-28599/com.mh.testmodule W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
2021-06-01 13:02:23.816 28599-28599/com.mh.testmodule W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
以下是全部错误:
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: android.view.InflateException: Binary XML file line #86 in com.amap.api.navi:layout/amap_navi_api_navi_fragment: Binary XML file line #86 in com.amap.api.navi:layout/amap_navi_api_navi_fragment: Error inflating class com.amap.api.navi.view.nightmode.NightModeTextView
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: Caused by: android.view.InflateException: Binary XML file line #86 in com.amap.api.navi:layout/amap_navi_api_navi_fragment: Error inflating class com.amap.api.navi.view.nightmode.NightModeTextView
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: Caused by: java.lang.reflect.InvocationTargetException
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Constructor.newInstance0(Native Method)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.createView(LayoutInflater.java:856)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1008)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:963)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:1125)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1086)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:1128)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1086)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:1128)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1086)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:684)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:499)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.q7.a(ResourcesUtil.java:44)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.u7.(AmapNaviViewCore.java:795)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at com.amap.api.navi.AMapNaviView.init(AMapNaviView.java:1)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at com.amap.api.navi.AMapNaviView.(AMapNaviView.java:4)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Constructor.newInstance0(Native Method)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.createView(LayoutInflater.java:856)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1008)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:963)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:1125)
2021-06-01 13:02:23.814 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1086)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:684)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:536)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:459)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.setContentView(Activity.java:3537)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at com.mh.mhnavi.NavigationActivity.onCreate(NavigationActivity.java:7)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.performCreate(Activity.java:8093)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.performCreate(Activity.java:8067)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3474)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3661)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2108)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.os.Looper.loop(Looper.java:236)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7876)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/amap/api/navi/R$styleable;
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.a8.(BaseNightModeAttrProcessor.java:9)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.c8.(TextViewNightModeAttrProcessor.java:1)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at com.amap.api.navi.view.nightmode.NightModeTextView.init(NightModeTextView.java:1)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at com.amap.api.navi.view.nightmode.NightModeTextView.(NightModeTextView.java:4)
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: ... 45 more
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.amap.api.navi.R$styleable" on path: DexPathList[[zip file "/data/app/~~rnDntkfejlbYz4Ea04-6fg==/com.mh.testmodule-B6aq6e2MQGh25CuurNEz9A==/base.apk"],nativeLibraryDirectories=[/data/app/~~rnDntkfejlbYz4Ea04-6fg==/com.mh.testmodule-B6aq6e2MQGh25CuurNEz9A==/lib/arm64, /data/app/~~rnDntkfejlbYz4Ea04-6fg==/com.mh.testmodule-B6aq6e2MQGh25CuurNEz9A==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
2021-06-01 13:02:23.815 28599-28599/com.mh.testmodule W/System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
2021-06-01 13:02:23.816 28599-28599/com.mh.testmodule W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
2021-06-01 13:02:23.816 28599-28599/com.mh.testmodule W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
2021-06-01 13:02:23.816 28599-28599/com.mh.testmodule W/System.err: ... 49 more
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.RelativeLayout.addView(android.view.View, int)' on a null object reference
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.u7.(AmapNaviViewCore.java:796)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at com.amap.api.navi.AMapNaviView.init(AMapNaviView.java:1)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at com.amap.api.navi.AMapNaviView.(AMapNaviView.java:4)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Constructor.newInstance0(Native Method)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.createView(LayoutInflater.java:856)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1008)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:963)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:1125)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1086)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:684)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:536)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:459)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.setContentView(Activity.java:3537)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at com.mh.mhnavi.NavigationActivity.onCreate(NavigationActivity.java:7)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.performCreate(Activity.java:8093)
2021-06-01 13:02:23.830 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.performCreate(Activity.java:8067)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3474)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3661)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2108)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at android.os.Looper.loop(Looper.java:236)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7876)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
2021-06-01 13:02:23.831 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-06-01 13:02:23.841 28599-28599/com.mh.testmodule W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setVisibility(int)' on a null object reference
2021-06-01 13:02:23.841 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.u7.l(AmapNaviViewCore.java:2)
2021-06-01 13:02:23.841 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.u7.a(AmapNaviViewCore.java:24)
2021-06-01 13:02:23.841 28599-28599/com.mh.testmodule W/System.err: at com.amap.api.navi.AMapNaviView.onCreate(AMapNaviView.java:1)
2021-06-01 13:02:23.841 28599-28599/com.mh.testmodule W/System.err: at com.mh.mhnavi.NavigationActivity.onCreate(NavigationActivity.java:9)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.performCreate(Activity.java:8093)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.performCreate(Activity.java:8067)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3474)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3661)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2108)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.os.Looper.loop(Looper.java:236)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7876)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
2021-06-01 13:02:23.842 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setVisibility(int)' on a null object reference
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.u7.j(AmapNaviViewCore.java:22)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.u7.a(AmapNaviViewCore.java:6)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at com.amap.api.navi.AMapNaviView.setViewOptions(AMapNaviView.java:1)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at com.mh.mhnavi.NavigationActivity.onCreate(NavigationActivity.java:11)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.performCreate(Activity.java:8093)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.performCreate(Activity.java:8067)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3474)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3661)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2108)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.os.Looper.loop(Looper.java:236)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7876)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
2021-06-01 13:02:23.855 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-06-01 13:02:23.865 28599-28599/com.mh.testmodule E/NavigationActivity: onCreate: mNaviType = 2
2021-06-01 13:02:23.868 28599-28599/com.mh.testmodule W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setVisibility(int)' on a null object reference
2021-06-01 13:02:23.868 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.u7.j(AmapNaviViewCore.java:22)
2021-06-01 13:02:23.868 28599-28599/com.mh.testmodule W/System.err: at a.b.a.a.a.u7.a(AmapNaviViewCore.java:6)
2021-06-01 13:02:23.868 28599-28599/com.mh.testmodule W/System.err: at com.amap.api.navi.AMapNaviView.setViewOptions(AMapNaviView.java:1)
2021-06-01 13:02:23.868 28599-28599/com.mh.testmodule W/System.err: at com.mh.mhnavi.NavigationActivity.onCreate(NavigationActivity.java:31)
2021-06-01 13:02:23.868 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.performCreate(Activity.java:8093)
2021-06-01 13:02:23.868 28599-28599/com.mh.testmodule W/System.err: at android.app.Activity.performCreate(Activity.java:8067)
2021-06-01 13:02:23.868 28599-28599/com.mh.testmodule W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3474)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3661)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2108)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at android.os.Looper.loop(Looper.java:236)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7876)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
2021-06-01 13:02:23.869 28599-28599/com.mh.testmodule W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-06-01 13:02:24.859 28599-28650/com.mh.testmodule I/m.mh.testmodul: ProcessProfilingInfo new_methods=5188 is saved saved_to_disk=1 resolve_classes_delay=8000
我也出现了这个错误,也是引用的第三方库中有R文件,但是打包之后,就消失了。。目前你解决了吗
我也出现了这个错误,也是被引用的库中有 R 文件,但是后来消失了。
这个应该是Android aar打包时混淆导致的,你不混淆他就不会有问题,具体如何解决我还没有找到
我也出现了这个错误,也是被引用的库中有 R 文件,但是后来消失了。
我认为不是fat-aar-android这个库导致的
混淆开关minifyEnabled为false,作者曾经解决过类似的问题,但可能是未覆盖我们遇到的这种场景
W/System.err: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/chromium/ui/R$dimen;
2021-06-10 09:50:27.231 27776-27776/com.common.testapp W/System.err: at org.chromium.ui.gfx.ViewConfigurationHelper.getScaledMinScalingSpan(ViewConfigurationHelper.java:120)
2021-06-10 09:50:27.232 27776-27776/com.common.testapp W/System.err: at org.chromium.ui.gfx.ViewConfigurationHelper.getMinScalingSpan(ViewConfigurationHelper.java:112)
2021-06-10 09:50:27.232 27776-27776/com.common.testapp W/System.err: at org.xwalk.core.internal.XWalkContent.nativeInit(Native Method)
2021-06-10 09:50:27.232 27776-27776/com.common.testapp W/System.err: at org.xwalk.core.internal.XWalkContent.(XWalkContent.java:151)
2021-06-10 09:50:27.232 27776-27776/com.common.testapp W/System.err: at org.xwalk.core.internal.XWalkViewInternal.initXWalkContent(XWalkViewInternal.java:383)
2021-06-10 09:50:27.232 27776-27776/com.common.testapp W/System.err: at org.xwalk.core.internal.XWalkViewBridge.(XWalk
以上是目前出错的信息~~
混淆开关minifyEnabled为false,作者曾经解决过类似的问题,但可能是未覆盖我们遇到的这种场景
我这边用的是高德的sdk,它提供的是jar包,里面带有R文件,如果我是混淆打包aar,那么aar下的libs中的jar包会被合并到classes.jar中,如果没有混淆aar中的libs下面可以看到高德的jar包,其实原因就是一个aar只能有一个R文件,jar包被合并之后R文件自然也会被合并,但这种简单的合并就会有问题。你可以试试高德的jar不混淆的时候打包成aar,看看,后面再研究一下aar的打包吧
~~主要是不给时间去研究太多原理,还是更关注如何解决问题,目前我的场景是提供sdk出去给客户使用,那就得打包成aar,但android studio打包aar并不会把一些库、module打进去,所以找到了fataar,但目前还是出现这种第三方库中的资源合并存在问题的情况。那解决问题的办法应该是只有让app层去把这些框架依赖了,虽然体验可能不太好,但目前最快的解决方案应该就是这样了
~~主要是不给时间去研究太多原理,还是更关注如何解决问题,目前我的场景是提供sdk出去给客户使用,那就得打包成aar,但android studio打包aar并不会把一些库、module打进去,所以找到了fataar,但目前还是出现这种第三方库中的资源合并存在问题的情况。那解决问题的办法应该是只有让app层去把这些框架依赖了,虽然体验可能不太好,但目前最快的解决方案应该就是这样了
没办法的,想彻底解决还是要研究原理,我也是没时间,解决办法和你类似,其中一个包单独拿出来提供