Smartling / android-repository

Maven repository for binary Android SDKs
5 stars 1 forks source link

Account configuration gets overwritten #14

Open MartinDevi opened 7 years ago

MartinDevi commented 7 years ago

I had the following crash when trying to launch the in-app review:

java.lang.SecurityException: uid 10328 cannot explicitly add accounts of type: com.smartling.android.review
                                                                  at android.os.Parcel.readException(Parcel.java:1620)
                                                                  at android.os.Parcel.readException(Parcel.java:1573)
                                                                  at android.accounts.IAccountManager$Stub$Proxy.addAccountExplicitly(IAccountManager.java:890)
                                                                  at android.accounts.AccountManager.addAccountExplicitly(AccountManager.java:712)
                                                                  at com.smartling.android.review.TokenManager.a(SourceFile:290)
                                                                  at com.smartling.android.review.TokenManager.saveOAuthTokens(SourceFile:272)
                                                                  at com.smartling.android.review.security.activity.LoginActivity.a(SourceFile:84)
                                                                  at com.smartling.android.review.security.activity.LoginActivity.a(SourceFile:33)
                                                                  at com.smartling.android.review.security.activity.LoginActivity$1.onResponse(SourceFile:117)
                                                                  at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
                                                                  at android.os.Handler.handleCallback(Handler.java:739)
                                                                  at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                  at android.os.Looper.loop(Looper.java:148)
                                                                  at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                  at java.lang.reflect.Method.invoke(Native Method)
                                                                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

After some investigation, I realized that this was caused by our app's account configuration resources which were overriding the smartling SDK's. In both cases the authenticator files were called authenticator.xml and authenticator_prefs.xml. I renamed our files to fix the crash, but it would be a good idea to rename them in the sdk to smartlings_authenticator.xml and smartlings_authenticator_prefs.xml to avoid this kind of issue for other people in the future.

foo4u commented 6 years ago

Good point, we'll look into it.