自動エラー レポートを生成するためにACRA ( arca.ch ) を使用しています。
Google Maps Android API v2 を使用してアプリの新しいバージョンをリリースしました。GooglePlayServicesUtil.getErrorDialog によって返されたダイアログを表示しようとすると、EEPad および Transformer Pad ユーザーからエラーが報告されました。なぜこれが起こるのか誰にも分かりますか?
acraによって報告された関連コードとLogcatは次のとおりです。
この行を呼び出している間:
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if(resultCode != ConnectionResult.SUCCESS)
{
//The dialog that comes back is null (probably due to the logcat message)
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(resultCode, this, 69);
//So when I call the next line, the app crashes with a NullPointerException
dialog.show();
}
...
ログキャット:
12-18 04:21:04.531 W/GooglePlayServicesUtil( 3977): Google Play Store signature invalid.
12-18 04:21:04.551 E/GooglePlayServicesUtil( 3977): Google Play services is invalid. Cannot recover.
ご協力いただきありがとうございます。
アップデート
この問題はまだ Google によって解決されておらず、何かを聞いたらこの質問を更新します (Google バグ レポートのリンクについては CommonsWare の回答を参照してください)。それまでの間、この問題に遭遇し、アプリをクラッシュさせたくない場合は、当面の間、次のことを行っています。
public void checkGooglePlayServicesAvailability()
{
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if(resultCode != ConnectionResult.SUCCESS)
{
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(resultCode, this, 69);
if(dialog != null)
{
dialog.show();
}
else
{
showOkDialogWithText(this, "Something went wrong. Please make sure that you have the Play Store installed and that you are connected to the internet. Contact developer with details if this persists.");
}
}
Log.d("GooglePlayServicesUtil Check", "Result is: " + resultCode);
}
public static void showOkDialogWithText(Context context, String messageText)
{
Builder builder = new AlertDialog.Builder(context);
builder.setMessage(messageText);
builder.setCancelable(true);
builder.setPositiveButton("OK", null);
AlertDialog dialog = builder.create();
dialog.show();
}