更改包名称后找不到com.google.android.gms.R $样式

时间:2013-11-07 08:08:23

标签: android eclipse google-maps-android-api-2

我的应用程序运行正常,谷歌地图也正常运行。 我从com.example.hellworld更改了包名,以便我可以将它放在Play商店中我想要它,也更新了清单,相应地更改了API密钥。

我的应用中的所有其他活动都运行良好。但是,当我打开包含地图的Activity时,它会抛出此错误。

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

1 个答案:

答案 0 :(得分:0)

因为与您的Google地图密钥相关联的包名称仍具有相同的包名称,即com.example.hellworld。在这里你改变了包的名称。