我们正在从命令行完全构建项目。导入了Google Play服务库项目:
android.library.reference.1=path/to/google-play-services_lib
所有不需要GMS资源文件的GMS功能都可以正常工作(例如,LocationClient)。当我试图提示用户更新GMS时,会发生以下错误:
E/AndroidRuntime( 3599): java.lang.NoClassDefFoundError: com.google.android.gms.R$string
E/AndroidRuntime( 3599): at com.google.android.gms.common.GooglePlayServicesUtil.b(Unknown Source)
E/AndroidRuntime( 3599): at com.google.android.gms.common.GooglePlayServicesUtil.a(Unknown Source)
E/AndroidRuntime( 3599): at com.google.android.gms.common.GooglePlayServicesUtil.getErrorDialog(Unknown Source)
取消索引最终的classes.dex表示所有字符串都在那里:
user@host:~/path/to/project$ dexdump -d bin/classes.dex | grep com.google.android.gms.R
0991bc: 6000 e505 |001a: sget v0, Lcom/google/android/gms/R$string;.auth_client_play_services_err_notification_msg:I // field@05e5
09920c: 6004 e605 |0042: sget v4, Lcom/google/android/gms/R$string;.auth_client_requested_by_msg:I // field@05e6
099222: 6004 e405 |004d: sget v4, Lcom/google/android/gms/R$string;.auth_client_availability_notification_title:I // field@05e4
099b9e: 6000 ed05 |0041: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_install_title:I // field@05ed
099bb4: 6000 e905 |004c: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_enable_title:I // field@05e9
099bca: 6000 f305 |0057: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_update_title:I // field@05f3
099bee: 6000 f005 |0069: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_unsupported_title:I // field@05f0
099d2e: 6000 ea05 |0009: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_install_button:I // field@05ea
099d3c: 6000 e705 |0010: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_enable_button:I // field@05e7
099d4a: 6000 f105 |0017: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_update_button:I // field@05f1
099fc8: 6000 ee05 |0004: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_unknown_issue:I // field@05ee
099ff0: 6000 ec05 |0018: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_install_text_tablet:I // field@05ec
09a030: 6000 eb05 |0038: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_install_text_phone:I // field@05eb
09a03e: 6000 e805 |003f: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_enable_text:I // field@05e8
09a04c: 6000 f205 |0046: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_update_text:I // field@05f2
09a08c: 6000 ef05 |0066: sget v0, Lcom/google/android/gms/R$string;.common_google_play_services_unsupported_text:I // field@05ef
09c394: 6000 e205 |001c: sget v0, Lcom/google/android/gms/R$drawable;.common_signin_btn_text_dark:I // field@05e2
09c398: 6001 e305 |001e: sget v1, Lcom/google/android/gms/R$drawable;.common_signin_btn_text_light:I // field@05e3
09c3ba: 6000 e005 |002f: sget v0, Lcom/google/android/gms/R$drawable;.common_signin_btn_icon_dark:I // field@05e0
09c3be: 6001 e105 |0031: sget v1, Lcom/google/android/gms/R$drawable;.common_signin_btn_icon_light:I // field@05e1
09c454: 6000 de05 |0000: sget v0, Lcom/google/android/gms/R$color;.common_signin_btn_text_dark:I // field@05de
09c458: 6001 df05 |0002: sget v1, Lcom/google/android/gms/R$color;.common_signin_btn_text_light:I // field@05df
09c4aa: 6000 f405 |002b: sget v0, Lcom/google/android/gms/R$string;.common_signin_button_text:I // field@05f4
09c4be: 6000 f505 |0035: sget v0, Lcom/google/android/gms/R$string;.common_signin_button_text_long:I // field@05f5
0f2e38: 6201 f605 |000e: sget-object v1, Lcom/google/android/gms/R$styleable;.MapAttrs:[I // field@05f6
0f865e: 6202 f605 |000d: sget-object v2, Lcom/google/android/gms/R$styleable;.MapAttrs:[I // field@05f6
关于我为什么会收到该错误以及如何修复错误的想法?