question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NullPointerException when debugging with adb

See original GitHub issue

Hey there, this is part of the output when i use adb for debugging my app:

09-13 16:50:33.340 28812-28812/? I/Unity: AndroidJavaException: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference at io.branch.referral.Branch.getInstance(Branch.java:464) at io.branch.unity.BranchUnityWrapper.setMaxRetries(BranchUnityWrapper.java:289) at com.unity3d.player.ReflectionHelper.nativeProxyInvoke(Native Method) at com.unity3d.player.ReflectionHelper.a(Unknown Source) at com.unity3d.player.ReflectionHelper$1.invoke(Unknown Source) at java.lang.reflect.Proxy.invoke(Proxy.java:397) at $Proxy3.run(Unknown Source) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5951) at java.lang.reflect.Method.invoke(Native Method) at java.lang.re 09-13 16:50:33.360 28812-28812/? I/Unity: AndroidJavaException: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference at io.branch.referral.Branch.getInstance(Branch.java:464) at io.branch.unity.BranchUnityWrapper.setNetworkTimeout(BranchUnityWrapper.java:293) at com.unity3d.player.ReflectionHelper.nativeProxyInvoke(Native Method) at com.unity3d.player.ReflectionHelper.a(Unknown Source) at com.unity3d.player.ReflectionHelper$1.invoke(Unknown Source) at java.lang.reflect.Proxy.invoke(Proxy.java:397) at $Proxy3.run(Unknown Source) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5951) at java.lang.reflect.Method.invoke(Native Method) at java.lan 09-13 16:50:33.380 28812-28812/? I/Unity: AndroidJavaException: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference at io.branch.referral.Branch.getInstance(Branch.java:464) at io.branch.unity.BranchUnityWrapper.setRetryInterval(BranchUnityWrapper.java:285) at com.unity3d.player.ReflectionHelper.nativeProxyInvoke(Native Method) at com.unity3d.player.ReflectionHelper.a(Unknown Source) at com.unity3d.player.ReflectionHelper$1.invoke(Unknown Source) at java.lang.reflect.Proxy.invoke(Proxy.java:397) at $Proxy3.run(Unknown Source) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5951) at java.lang.reflect.Method.invoke(Native Method) at java.lang

This doesnt break the app and branch still seems to work, but maybe this should be fixed. I dont know what it does and what is missing, maybe you know it.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Acimazcommented, Sep 21, 2016

@antonargunov nvm! I called these 3 methods in Awake: Branch.setMaxRetries(5); Branch.setNetworkTimeout(10); Branch.setRetryInterval(3);

But moving them over to Start() resolved the problem.

0reactions
Mann1ngcommented, Jun 5, 2019

Glad to have found this… I updated the Start() with Awake() for Branch to get in early, but didn’t realise this would cause an exception. Might be worth adding a comment above the Start() to warn developers to not update to Awake() 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NullPointerException when using adb to deploy ...
The error message just says java. lang. NullPointerException: rhs == null which is in no way related.
Read more >
Debug Configurations java.lang.NullPointerException error
Basically I opened Eclipse today to test an Android App that I've been working on and receive this popup error when I attempt...
Read more >
How to fix a NullPointerException in Android
Learn how to fix NullPointerExceptions in Kotlin, Java, and Android Studio. Then, go deeper and set breakpoints for more controlled testing.
Read more >
Fix "java.lang.NullPointerException" in Android Studio
It is a run-time exception that arises when an application or a program tries to access the object reference(accessing methods) which has a...
Read more >
java.lang.NullPointerException - Issues/Bugs
[AndroidDriver] Looking for a device with Android 5.1. [debug] [ADB] Setting device id to CB5A27SHRZ [ADB] Getting device platform version
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found