1. 程式人生 > >Android 報錯 java.lang.SecurityException: caller uid 10431 is different than the authenticator's uid

Android 報錯 java.lang.SecurityException: caller uid 10431 is different than the authenticator's uid

Android 開發,賬戶與同步。

在登入時使用系統AccountManager 進行賬戶新增,( 然後在手機-設定-賬戶與同步裡面可以進行檢視。)

在登入完成,進行新增時,報錯java.lang.SecurityException: caller uid 10431 is different than the authenticator's uid

後來檢查發現,是由於  Account newAccount = new Account(uName, "com.aaa.account");後面這個賬戶型別與authenticator.xml裡面的 android:accountType="com.ccc.account"型別不一致導致的,修改為統一,就不在報錯了!