We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

casolorz's avatar
casolorz
Explorer | Level 3
8 years ago

java.lang.ExceptionInInitializerError

I have an Android app with the Dropbox Java api 3.0.5

 

For some reason some of my users get the exception I'm pasting below, but the majority do not. I've never reproduced the issue, I've only seen it reported on Crashlytics.

 

Does anyone have any idea what the issue could be? I use multidex on my app, is it maybe related to that?

 

Thank you.

 

Fatal Exception: java.lang.ExceptionInInitializerError
       at com.dropbox.core.DbxRequestUtil.buildUserAgentHeader(DbxRequestUtil.java:151)
       at com.dropbox.core.DbxRequestUtil.addUserAgentHeader(DbxRequestUtil.java:136)
       at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:233)
       at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:107)
       at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:284)
       at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:102)
       at com.dropbox.core.v2.users.DbxUserUsersRequests.getCurrentAccount(DbxUserUsersRequests.java:120)
       at mypackage.UserDropbox.(UserDropbox.java)
       at mypackage.DropboxHelper$1.run(DropboxHelper.java)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.jar.JarVerifier.removeMetaEntries()' on a null object reference
       at java.util.jar.JarFile.getInputStream(JarFile.java:381)
       at libcore.net.url.JarURLConnectionImpl.getInputStream(JarURLConnectionImpl.java:222)
       at java.net.URL.openStream(URL.java:470)
       at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:444)
       at java.lang.Class.getResourceAsStream(Class.java:1412)
       at com.dropbox.core.DbxSdkVersion.loadLineFromResource(DbxSdkVersion.java:34)
       at com.dropbox.core.DbxSdkVersion.loadVersion(DbxSdkVersion.java:56)
       at com.dropbox.core.DbxSdkVersion.(DbxSdkVersion.java)
       at com.dropbox.core.DbxRequestUtil.buildUserAgentHeader(DbxRequestUtil.java:151)
       at com.dropbox.core.DbxRequestUtil.addUserAgentHeader(DbxRequestUtil.java:136)
       at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:233)
       at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:107)
       at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:284)
       at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:102)
       at com.dropbox.core.v2.users.DbxUserUsersRequests.getCurrentAccount(DbxUserUsersRequests.java:120)
       at mypackage.UserDropbox.(UserDropbox.java)
       at mypackage.DropboxHelper$1.run(DropboxHelper.java)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)

4 Replies

  • casolorz's avatar
    casolorz
    Explorer | Level 3
    8 years ago
    So far Android 5 and 6, seems to be on Motorola phones, Samsung phones, and some weird brand I've never head of. I only have this in beta so I don't have that many reports yet.
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago

    Thanks! There doesn't seem to be a clear pattern in that unfortunately.

     

    For reference, the Dropbox Java SDK contains a "sdk-version.txt" file with the version number for the SDK in it, for use in the User-Agent header string.

     

    Based on the stack trace you shared, it appears the exception is occurring inside Java's getResourceAsStream, when the Dropbox SDK asks for an input stream for that "sdk-version.txt" file.

     

    It's unclear why that may be happening, so I'll ask engineering to look into it.

     

  • casolorz's avatar
    casolorz
    Explorer | Level 3
    8 years ago
    That is good to know. I'm wondering if my proguard is maybe renaming that or multidex is putting it on a second dex file and it is having issues getting it out there. I've had that happen before with multidex but only during the Application onCreate.

    My proguard file has:

    -keep class com.dropbox.** { *; }
    -keepclassmembers class com.dropbox.** { *; }

    Maybe I need to add something else to my multidex config to tell it to keep that file on the on the first dex file.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 3 hours ago
410 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!