RePlugin
RePlugin copied to clipboard
android.content.res.Resources$NotFoundException: Resource ID #0x7f04001c type #0x1c is not valid
问题详细描述 host应用无法打开自己编写的外置插件,但是可以正常打开demo3外置插件
复现问题步骤 Steps to reproduce the problem
- 在host内安装并打开外置插件的activity
- 应用闪退
其它重要信息 Other important information
replugin-host-lib/gradle Version:2.3.4 rePlugin-plugin-lib/gradle Version:2.3.4
Android API Version:Android10 Android 手机型号&ROM(Phone model & ROM): 模拟器
Logcat上下文 Logcat context
2021-03-24 15:45:01.381 31287-31287/? E/xample.myplugi: Unknown bits set in runtime_flags: 0x8000 2021-03-24 15:45:08.687 31287-31287/com.example.myplugin E/RePlugin.PluginDexClassLoader: loadClass ClassNotFoundException, from PluginClassLoader, cn=com.qihoo360.plugin.kit.Entry, pluginName=kit 2021-03-24 15:45:08.688 31287-31287/com.example.myplugin E/RePlugin.PluginDexClassLoader: loadClass ClassNotFoundException, from PluginClassLoader, cn=com.qihoo360.plugin.kit.Entry, pluginName=kit 2021-03-24 15:45:09.318 31287-31287/com.example.myplugin E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.myplugin, PID: 31287 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myplugin/com.example.myplugin.loader.a.ActivityN1NRNTS5}: android.content.res.Resources$NotFoundException: Resource ID #0x7f04001c type #0x1c is not valid at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f04001c type #0x1c is not valid at android.content.res.Resources.loadXmlResourceParser(Resources.java:2287) at android.content.res.Resources.getLayout(Resources.java:1175) at android.view.LayoutInflater.inflate(LayoutInflater.java:532) at android.view.LayoutInflater.inflate(LayoutInflater.java:481) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:438) at android.app.Activity.setContentView(Activity.java:3324) at com.example.hellokit.MainActivity.onCreate(MainActivity.java:15) at android.app.Activity.performCreate(Activity.java:7802) at android.app.Activity.performCreate(Activity.java:7791) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f04001c type #0x1c is not valid at android.content.res.Resources.loadXmlResourceParser(Resources.java:2287) at android.content.res.Resources.getLayout(Resources.java:1175) at android.view.LayoutInflater.inflate(LayoutInflater.java:532) at android.view.LayoutInflater.inflate(LayoutInflater.java:481) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:438) at android.app.Activity.setContentView(Activity.java:3324) at com.example.hellokit.MainActivity.onCreate(MainActivity.java:15) at android.app.Activity.performCreate(Activity.java:7802)
android.app.Activity.setContentView(Activity.java:3324)
由这段可以看出,应该是没有脚本编译成功导致, 正常情况下 应该是 还有继承 com.example.hellokit.MainActivity.onCreate 会 PluginActivity 或者 PluginAppCompantActivity