验证后,Fabric数字在回调中崩溃

时间:2017-04-11 18:16:26

标签: java android twitter-fabric twitter-digits fabric-digits

我添加了Fabric Digit工具包来验证手机号码。手机号码已成功验证,但当我点击验证按钮应用程序崩溃时,当我重新打开应用程序时,数字会话成功创建,我在许多应用程序中使用了Digit但没有得到问题。可能是特定版本或者其他?

崩溃日志:



#0. Crashed: IntentService[ATTRIBUTABLE_INVITE_DOWNLOAD_WORKER]: 0 0 0x0000000000000000
       at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:772)
       at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:800)
       at com.digits.sdk.android.DigitsApiClientManager.getUserAuthClient(DigitsApiClientManager.java:53)
       at com.digits.sdk.android.AttributableInviteDownloadService.onHandleIntent(AttributableInviteDownloadService.java:55)
       at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.os.HandlerThread.run(HandlerThread.java:61)

--

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object reference
       at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:772)
       at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:800)
       at com.digits.sdk.android.DigitsApiClientManager.getUserAuthClient(DigitsApiClientManager.java:53)
       at com.digits.sdk.android.AttributableInviteDownloadService.onHandleIntent(AttributableInviteDownloadService.java:55)
       at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.os.HandlerThread.run(HandlerThread.java:61)




从Crashalytics添加更详细的日志here

在应用中实施的代码:

的onCreate



authCallback = new AuthCallback() {
                    @Override
                    public void success(DigitsSession session, String phoneNumber) {
                        Log.d("msg", "session : " + session.toString() + " " + phoneNumber);
                        MOBILE_NO = phoneNumber;
                        storeUserData.setString(Constants.USER_MOBILE, phoneNumber);
                        Digits.clearActiveSession();
                        startActivity(new Intent(activity, RegisterActivity.class)
                                .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
                    }

                    @Override
                    public void failure(DigitsException error) {
                        error.printStackTrace();
                    }
                };




用于验证



binding.authButton.setCallback(authCallback);
                            binding.authButton.setAuthTheme(R.style.CustomDigitsTheme);

                            AuthConfig.Builder authConfigBuilder = new AuthConfig.Builder()
                                    
                                    .withAuthCallBack(authCallback)
                                    .withPhoneNumber("+91");

                            Digits.authenticate(authConfigBuilder.build());




2 个答案:

答案 0 :(得分:1)

您可以尝试以下代码,

ax = sns.boxplot(x="day", y="total_bill", data=tips)
for box in ax.artists:
    box.set_facecolor("green")

让我知道它是否适合你。

答案 1 :(得分:0)

我遇到了同样的问题,发现我正在清除回调方法中的活动会话(注销)。

删除此行:

Digits.clearActiveSession();

或者在我的情况下,我删除了这一行:

Digits.logout();