我一直在學習本教程[http://www.androidhive.info/2013/08/android-working-with-google-maps-v2/]的Android GPS V2教程問題 - 谷歌地圖
它的GPS地圖位置應用程序可以獲取您的位置或附近的位置。我和其他許多人都對此進行了測試,並且應用程序崩潰時似乎出現錯誤。 我已更改SHA1指紋和Google API密鑰。 代碼中沒有錯誤,我導入了Google Play商店。
有沒有人有這方面的任何想法,我看了網站上的評論和用戶分配有同樣的問題。 這裏是logcat的:
03-26 03:43:53.835: W/dalvikvm(15048): threadid=1: thread exiting with uncaught exception (group=0x42014700)
03-26 03:43:53.845: E/AndroidRuntime(15048): FATAL EXCEPTION: main
03-26 03:43:53.845: E/AndroidRuntime(15048): java.lang.RuntimeException: Unable to start activity ComponentInfo{info.androidhive.googlemapsv2/info.androidhive.googlemapsv2.MainActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.app.ActivityThread.access$700(ActivityThread.java:159)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.os.Handler.dispatchMessage(Handler.java:99)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.os.Looper.loop(Looper.java:176)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.app.ActivityThread.main(ActivityThread.java:5419)
03-26 03:43:53.845: E/AndroidRuntime(15048): at java.lang.reflect.Method.invokeNative(Native Method)
03-26 03:43:53.845: E/AndroidRuntime(15048): at java.lang.reflect.Method.invoke(Method.java:525)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
03-26 03:43:53.845: E/AndroidRuntime(15048): at dalvik.system.NativeStart.main(Native Method)
03-26 03:43:53.845: E/AndroidRuntime(15048): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:719)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.app.Activity.setContentView(Activity.java:1956)
03-26 03:43:53.845: E/AndroidRuntime(15048): at info.androidhive.googlemapsv2.MainActivity.onCreate(MainActivity.java:24)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.app.Activity.performCreate(Activity.java:5372)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)
03-26 03:43:53.845: E/AndroidRuntime(15048): ... 11 more
03-26 03:43:53.845: E/AndroidRuntime(15048): Caused by: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.google.android.gms.common.GooglePlayServicesUtil.t(Unknown Source)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.google.android.gms.maps.internal.q.B(Unknown Source)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.google.android.gms.maps.internal.q.A(Unknown Source)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.google.android.gms.maps.MapFragment$b.gW(Unknown Source)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.google.android.gms.dynamic.a.a(Unknown Source)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
03-26 03:43:53.845: E/AndroidRuntime(15048): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.app.Activity.onCreateView(Activity.java:4965)
03-26 03:43:53.845: E/AndroidRuntime(15048): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:695)
03-26 03:43:53.845: E/AndroidRuntime(15048): ... 21 more
你在模擬器中試試嗎? – Giridharan
請上傳您的AndroidManifest.xml文件 – Kedarnath