'java.lang.String com.dropbox.core.DbxRequestConfig.getUserLocale()' on a null object reference

Open
#347 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, java
Domain
mobile

Research direction

Start by reading DbxPKCEManager.java around line 107 and the token request flow in AuthActivity.java. Reproduce the OAuth2 PKCE login with dropbox-core-sdk 4.0.1 on Android API 30 using the reported configuration, then verify the token request completes without the null-reference crash.

Written by the indexing model from the issue text.

Description

bug

Login with dropbox account I got crash.
implementation 'com.dropbox.core:dropbox-core-sdk:4.0.1'
Api level 30

My Code :

public class DbxRequestConfigFactory {
private static DbxRequestConfig sDbxRequestConfig;
public static DbxRequestConfig getRequestConfig() {
if (sDbxRequestConfig == null) {
sDbxRequestConfig = DbxRequestConfig.newBuilder("myapp-dropbox-v2")
.withHttpRequestor(new OkHttp3Requestor(OkHttp3Requestor.defaultOkHttpClient()))
.build();
}
return sDbxRequestConfig;
}
}

Auth.startOAuth2PKCE(this, getString(R.string.app_key),DbxRequestConfigFactory.getRequestConfig());

Logs below

Fatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$4.done(AsyncTask.java:399)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.dropbox.core.DbxRequestConfig.getUserLocale()' on a null object reference
at com.dropbox.core.DbxPKCEManager.makeTokenRequest(DbxPKCEManager.java:107)
at com.dropbox.core.android.AuthActivity$TokenRequestAsyncTask.doInBackground(AuthActivity.java:793)
at com.dropbox.core.android.AuthActivity$TokenRequestAsyncTask.doInBackground(AuthActivity.java:782)
at android.os.AsyncTask$3.call(AsyncTask.java:378)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)

Dominant language
Java
Stars
627
Forks
463
Avg merge
5m
Merged PRs (30d)
10

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dropbox/dropbox-sdk-java

All issues in dropbox/dropbox-sdk-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.