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

ShadowNativeActivityDelegate.getPackageManager getMPluginActivity NullPointerException #1301

Open
chenranok opened this issue Apr 3, 2024 · 1 comment

Comments

@chenranok
Copy link

Caused by: java.lang.NullPointerException: null cannot be cast to non-null type com.tencent.shadow.core.runtime.ShadowNativeActivity
at com.tencent.shadow.core.loader.delegates.ShadowNativeActivityDelegate.getMPluginActivity(ShadowNativeActivityDelegate.kt:17)
at com.tencent.shadow.core.loader.delegates.ShadowNativeActivityDelegate.getPackageManager(ShadowNativeActivityDelegate.kt:50)
at com.tencent.shadow.core.runtime.container.NativePluginContainerActivity.getPackageManager(NativePluginContainerActivity.java:182)
at com.android.internal.policy.PhoneWindow.(PhoneWindow.java:458)
at com.android.internal.policy.HwPhoneWindow.(HwPhoneWindow.java:92)
at com.android.internal.policy.HwPolicyFactoryImpl.getHwPhoneWindow(HwPolicyFactoryImpl.java:42)
at com.android.internal.policy.HwPolicyFactory.getHwPhoneWindow(HwPolicyFactory.java:50)
at android.app.Activity.attach(Activity.java:8116)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4014)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4252) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2618) 
at android.os.Handler.dispatchMessage(Handler.java:110) 
at android.os.Looper.loop(Looper.java:219) 
at android.app.ActivityThread.main(ActivityThread.java:8673) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109) 

@chenranok
Copy link
Author

nativeactivity 很快调用到了 getPackageManager, mPluginActivity是在onCreate内才赋的值,这里Null而报异常
override fun getPackageManager(): PackageManager {
//chenran99 --
// val pluginPackageManager =
// PackageManagerInvokeRedirect.getPluginPackageManager(mPluginActivity.classLoader)

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