cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Android SDK crash

Android SDK crash

Hongbin L.
New member | Level 1
Hi. I have implemented Dropbox API in my android app.
After released the app to public, I got a number of crash report from the Dropbox SDK. No sure what is the root cause.
 
The issue seems to happen on a varieties of devices. Please help! Thank you so much.

 
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.getPath()' on a null object reference
at com.dropbox.client2.android.AuthActivity.onNewIntent(Unknown Source)
at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1218)
at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1230)
at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2683)
at android.app.ActivityThread.performNewIntents(ActivityThread.java:2695)
at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2704)
at android.app.ActivityThread.access$1600(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1542)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5643)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
3 Replies 3

Steve M.
Dropbox Staff

Could you tell us what version of what SDK you're using?

I think based on the stack that you're using some version of the Core API (v1) Android SDK, but it would help to know exactly which version.

In the current code for onNewIntent, this is the only call I see to getPath(), which sure looks like it's guarded against null pointer exceptions.

 } else {
    // Web auth.
    Uri uri = intent.getData();
    if (uri != null) {
        String path = uri.getPath();

One quick way to check which version you're using is to look at SdkVersion.java.

EDIT: If using a JAR file, the version number should be in the name of the file.

Hongbin L.
New member | Level 1

SDK version is 1.5.3.

Steve M.
Dropbox Staff

Hmm. The code in that version looks identical, and there are no other calls to getPath().

Is there any chance you modified the code in AuthActivity.java? I'm afraid I don't have any other ideas.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Steve M. Dropbox Staff
  • User avatar
    Hongbin L. New member | Level 1
What do Dropbox user levels mean?