tBuildConfig配置中添加:outOfApkBundles = ['remotebundle']
使用gradlew clean assembleDebug命令可以正常编译出so和apk
按照 说明拷贝libcom_taobao_remotebunle.so到
/sdcard/Android/data/com.taobao.demo/cache/libcom_taobao_remotebunle.so
然后给app sd卡权限,运行远程组件模拟app崩溃:
2019-12-26 15:45:31.090 8636-8636/com.taobao.demo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.taobao.demo, PID: 8636
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.taobao.demo/com.taobao.remotebunle.RemoteBundleActivity}: java.lang.ClassNotFoundException: Didn't find class "com.taobao.remotebunle.RemoteBundleActivity" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.taobao.demo-fMRu5k3YB_w8PzsjhhuN-g==/base.apk"],nativeLibraryDirectories=[/data/app/com.taobao.demo-fMRu5k3YB_w8PzsjhhuN-g==/lib/arm, /data/app/com.taobao.demo-fMRu5k3YB_w8PzsjhhuN-g==/base.apk!/lib/armeabi, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3019)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3256)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1947)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7037)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.taobao.remotebunle.RemoteBundleActivity" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.taobao.demo-fMRu5k3YB_w8PzsjhhuN-g==/base.apk"],nativeLibraryDirectories=[/data/app/com.taobao.demo-fMRu5k3YB_w8PzsjhhuN-g==/lib/arm, /data/app/com.taobao.demo-fMRu5k3YB_w8PzsjhhuN-g==/base.apk!/lib/armeabi, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
at android.app.Instrumentation.newActivity(Instrumentation.java:1215)
1条答案
按热度按时间lp0sw83n1#
同问,而且DemoApplication里的setClassNotFoundInterceptorCallback 方法报红没法用