0

i installed Fabric plugin in Android studio. Chose Digits and add some code by suggestions of it. Got this error:

java.lang.NullPointerException: Attempt to invoke virtual method 'void com.digits.sdk.android.DigitsAuthButton.setCallback(com.digits.sdk.android.AuthCallback)' on a null object reference.

So, the problem is here(maybe):

phoneButton.setCallback(new AuthCallback() {
            @Override
            public void success(DigitsSession digitsSession, String phoneNumber) {

            }

            @Override
            public void failure(DigitsException e) {

            }
        });

Also i had same problems with Twitter part of plugin. Any ideas? Thank you for attention.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
rtdLTD
  • 3
  • 3

1 Answers1

0

The problem is not with the AuthCallback, your phoneButton object is null, possibly because it wasn't retrieved from the layout properly.

Jeremy
  • 3,438
  • 3
  • 34
  • 57
  • This was nearly close. I forgot to add 'setContentView(...)' in onCreate method of MainActivity. – rtdLTD Nov 22 '15 at 18:35