Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android.content.res.Resources$NotFoundException #33

Open
wangxianpeng opened this issue Jun 15, 2017 · 1 comment
Open

android.content.res.Resources$NotFoundException #33

wangxianpeng opened this issue Jun 15, 2017 · 1 comment

Comments

@wangxianpeng
Copy link

资源找不到。主分支代码,集成到我的app里面加载插件会报这个错,但在demo中加载同样的插件没有问题,是什么原因呢?
06-15 20:36:58.053 6164 6164 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dummy.loan/androidx.pluginmgr.DynamicActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f020465
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2436)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2496)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.app.ActivityThread.access$1000(ActivityThread.java:153)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1362)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5457)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f020465
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.content.res.Resources.getValue(Resources.java:1369)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.content.res.Resources.getDrawable(Resources.java:822)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.content.Context.getDrawable(Context.java:467)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:3934)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:3981)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:383)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.app.Activity.setContentView(Activity.java:2183)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at com.dummyui.supportlite.app.Activity.setContentView(Activity.java:21)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at com.dummy.jr.verification.SystemGuideActivity.onCreate(SystemGuideActivity.java:33)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6303)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at androidx.pluginmgr.delegate.DelegateInstrumentation.callActivityOnCreate(DelegateInstrumentation.java:240)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at androidx.pluginmgr.environment.PluginInstrumentation.callActivityOnCreate(PluginInstrumentation.java:153)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2389)
06-15 20:36:58.053 6164 6164 E AndroidRuntime: ... 9 more

@wangxianpeng
Copy link
Author

自问自答,host app不能设置theme,这样会导致plugin activity引用到host的theme,也就是会引用到host的资源,从而导致ResourceNotFound

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant