简体   繁体   中英

Fabric's Digits.getInstance() giving NullPointerException

Digits.getInstance() giving NullPointerException

java.lang.NullPointerException: Attempt to invoke virtual method 'com.digits.sdk.android.DigitsClient com.digits.sdk.android.Digits.getDigitsClient()' on a null object reference

I implemented Digits like -

Fabric.with(this, new TwitterCore(authConfig), new Digits());
        mAuthCallback = new AuthCallback() {
            @Override
            public void success(DigitsSession session, String phoneNumber) {
                // Do something with the session
            }

            @Override
            public void failure(DigitsException exception) {
                // Do something on failure
            }
        };

I just made it work. When you are using multiple SDKs you have to club them into a single statement.

Fabric.with(this, new Crashlytics(), new TwitterCore(authConfig), new Digits());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM