Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Activity.runOnUiThread(java.lang.Runnable)' on a null object reference at net.gree.unitywebview.CWebViewPlugin.<init>(CWebViewPlugin.java:122)
Nobody has claimed this yet.
- Dominant language
- Objective-C++
- Stars
- 2.7k
- Forks
- 734
- Avg merge
- 11h 39m
- Merged PRs (30d)
- 1
Description
Hi,
We are using this plugin for both android and iOS. We got this below issue from Firebase Console after we upload it. Kindly provide us the solution ASAP.
I got a lot of errors like this
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Activity.runOnUiThread(java.lang.Runnable)' on a null object reference
at net.gree.unitywebview.CWebViewPlugin.(CWebViewPlugin.java:122)
at java.lang.Class.newInstance(Class.java)
at android.app.Fragment.instantiate(Fragment.java:627)
at android.app.FragmentState.instantiate(Fragment.java:114)
at android.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1880)
at android.app.FragmentController.restoreAllState(FragmentController.java:123)
at android.app.Activity.onCreate(Activity.java:1048)
at com.unity3d.player.UnityPlayerActivity.onCreate()
at com.google.firebase.MessagingUnityPlayerActivity.onCreate(MessagingUnityPlayerActivity.java:75)
at android.app.Activity.performCreate(Activity.java:6904)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
at android.app.ActivityThread.access$1100(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Can you help us fix this problem
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at CWebViewPlugin.java:122 and trace how the plugin is instantiated during Android Activity restoration, using the reported stack trace as the entry point. Check how the Activity reference is initialized before runOnUiThread is called. Done means the reported startup path no longer produces this NullPointerException, with a regression check if the project provides one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, unity
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100