0

Google Oauth2 サインインを使用する Android アプリケーションを作成しています。ユーザーにアカウントの入力を促すには、AccountPicker.newChooseAccountIntent() を使用しています。

これは、Google Play サービスがデバイスで利用できることに依存しているため、アクティビティの onResume() で、Google のドキュメントに従って次のチェックを実行しています。

// Check that Google Play Services are available on the device
// We use them to show the account picker dialog
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

if(status != ConnectionResult.SUCCESS){     
    if(GooglePlayServicesUtil.isUserRecoverableError(status)){
        GooglePlayServicesUtil.getErrorDialog(status, this, REQUESTID_PLAY_SERVICES).show();
    } else {
        Toast.makeText(getApplicationContext(), R.string.purchases_not_supported, Toast.LENGTH_LONG).show();
        finish();
    }
}   

これは私の Jellybean デバイスではうまく機能しますが、Android 2.3.3 (Gingerbread) を実行している古いデバイスで試してみると、次の例外が発生します。

誰もこれを見たことがありますか?

E/Activities/MainActivity( 1906): Error: Unable to resume activity {com.somecompany.someapp/com.somecompany.someapp.activities.PurchaseActivity}: java.util.MissingResourceException: Can't find resource for bundle 'com.google.android.gms.common.strings.GmsStrings_en_US', key ''
E/Activities/MainActivity( 1906): java.lang.RuntimeException: Unable to resume activity {com.somecompany.someapp/com.somecompany.someapp.activities.PurchaseActivity}: java.util.MissingResourceException: Can't find resource for bundle 'com.google.android.gms.common.strings.GmsStrings_en_US', key ''
E/Activities/MainActivity( 1906):       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2460)
E/Activities/MainActivity( 1906):       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2481)
E/Activities/MainActivity( 1906):       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1847)
E/Activities/MainActivity( 1906):       at android.app.ActivityThread.access$1500(ActivityThread.java:132)
E/Activities/MainActivity( 1906):       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
E/Activities/MainActivity( 1906):       at android.os.Handler.dispatchMessage(Handler.java:99)
E/Activities/MainActivity( 1906):       at android.os.Looper.loop(Looper.java:143)
E/Activities/MainActivity( 1906):       at android.app.ActivityThread.main(ActivityThread.java:4263)
E/Activities/MainActivity( 1906):       at java.lang.reflect.Method.invokeNative(Native Method)
E/Activities/MainActivity( 1906):       at java.lang.reflect.Method.invoke(Method.java:507)
E/Activities/MainActivity( 1906):       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/Activities/MainActivity( 1906):       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/Activities/MainActivity( 1906):       at dalvik.system.NativeStart.main(Native Method)
E/Activities/MainActivity( 1906): Caused by: java.util.MissingResourceException: Can't find resource for bundle 'com.google.android.gms.common.strings.GmsStrings_en_US', key ''
E/Activities/MainActivity( 1906):       at java.util.ResourceBundle.missingResourceException(ResourceBundle.java:225)
E/Activities/MainActivity( 1906):       at java.util.ResourceBundle.getBundle(ResourceBundle.java:218)
E/Activities/MainActivity( 1906):       at com.sonelli.y.a(Unknown Source)
E/Activities/MainActivity( 1906):       at com.sonelli.y.a(Unknown Source)
E/Activities/MainActivity( 1906):       at com.sonelli.h.a(Unknown Source)
E/Activities/MainActivity( 1906):       at com.somecompany.someapp.activities.PurchaseActivity.onResume(PurchaseActivity.java:49)
E/Activities/MainActivity( 1906):       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1242)
E/Activities/MainActivity( 1906):       at android.app.Activity.performResume(Activity.java:3957)
E/Activities/MainActivity( 1906):       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2450)
E/Activities/MainActivity( 1906):       ... 12 more
~       
4

0 に答える 0