我的应用程序运行良好,谷歌地图也在运行。我从 com.example.hellworld 更改了包名称,以便我可以将它放在 Play 商店中,并更新为我想要的,还更新了清单,相应地更改了 API 密钥。
我的应用程序中的所有其他活动都可以正常工作。但是当我打开包含地图的活动时,它会抛出这个错误。
11-07 13:31:48.361: E/AndroidRuntime(32116): FATAL EXCEPTION: main
11-07 13:31:48.361: E/AndroidRuntime(32116): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
11-07 13:31:48.361: E/AndroidRuntime(32116): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
11-07 13:31:48.361: E/AndroidRuntime(32116): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
11-07 13:31:48.361: E/AndroidRuntime(32116): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:227)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.app.Activity.setContentView(Activity.java:1657)
11-07 13:31:48.361: E/AndroidRuntime(32116): at com.imaginate.socioreport.SampleActivity.onCreate(SampleActivity.java:54)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.app.ActivityThread.access$1500(ActivityThread.java:121)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.os.Handler.dispatchMessage(Handler.java:99)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.os.Looper.loop(Looper.java:130)
11-07 13:31:48.361: E/AndroidRuntime(32116): at android.app.ActivityThread.main(ActivityThread.java:3701)
11-07 13:31:48.361: E/AndroidRuntime(32116): at java.lang.reflect.Method.invokeNative(Native Method)
11-07 13:31:48.361: E/AndroidRuntime(32116): at java.lang.reflect.Method.invoke(Method.java:507)
11-07 13:31:48.361: E/AndroidRuntime(32116): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
11-07 13:31:48.361: E/AndroidRuntime(32116): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
11-07 13:31:48.361: E/AndroidRuntime(32116): at dalvik.system.NativeStart.main(Native Method)
11-07 13:31:51.263: I/Process(32116): Sending signal. PID: 32116 SIG: 9