SecurityException when trying to add an account

后端 未结 4 1612
囚心锁ツ
囚心锁ツ 2021-01-05 15:08

I\'m experimenting with Android AccountManager.

I have an Account authentication service that shows UI to enter username/password.

I go to Setti

相关标签:
4条回答
  • 2021-01-05 15:52

    Thanks to @imran khan, I discovered that my constant value didn't match "exactly" what was in the authenticator XML definition

    0 讨论(0)
  • 2021-01-05 16:01

    In my case I accidently defined AuthenticatorService in the Manifest outside the <application> tags. Moving the declaration inside <application> fixed the issue. Hope will help someone.

    0 讨论(0)
  • 2021-01-05 16:06

    Seems obvious, but you will also see this error if your authenticator service has not been defined in AndroidManifest.xml. For example:

    <service android:name="your.AuthService">
        <intent-filter>
            <action android:name="android.accounts.AccountAuthenticator" />
        </intent-filter>
        <meta-data android:name="android.accounts.AccountAuthenticator"
             android:resource="@xml/authenticator" />
    </service>
    
    0 讨论(0)
  • 2021-01-05 16:10

    In my case, I got this error when I ran two different flavors on the same device. The second one was trying to access the same account as the first, which caused the error.

    0 讨论(0)
提交回复
热议问题