我有這樣的代碼:GoogleApiAvailability.getErrorDialog()無法找到字符串資源
GoogleApiAvailability googleAPI = GoogleApiAvailability.getInstance();
String msg = getString(R.string.common_google_play_services_update_text);
Log.e(TAG, msg);
Dialog errDlg = googleAPI.getErrorDialog(MyActivity.this, result, 1111, listener);
在運行此,該字符串common_google_play_services_update_text
被正確地寫入LogCat
,但getErrorDialog()
拋出此異常:
java.lang.NoSuchFieldError: No static field common_google_play_services_update_text of type I in class Lcom/google/android/gms/R$string; or its superclasses (declaration of 'com.google.android.gms.R$string' appears in /data/app/com.mygame-1/base.apk)
我該如何解決這個問題?
當代碼運行時,字符串common_google_play_services_update_text被正確寫入LogCat。所以它必須是getErrorDialog()的錯誤。 – activity