我已经完成了在Android中显示Google地图的所有步骤。
我已经下载了最新版本的Google Play服务,但我仍然有以下例外情况:
07-18 05:25:36.319: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:36.389: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:36.389: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:36.489: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:36.529: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:36.559: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:36.629: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:36.709: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:36.769: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:36.949: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:36.989: W/GooglePlayServicesUtil(2054): Google Play services is missing.
07-18 05:25:40.239: I/Choreographer(2054): Skipped 494 frames! The application may be doing too much work on its main thread.
07-18 05:25:44.689: D/gralloc_goldfish(2054): Emulator without GPU emulation detected.
07-18 05:25:55.930: D/AndroidRuntime(2054): Shutting down VM
07-18 05:25:55.930: W/dalvikvm(2054): threadid=1: thread exiting with uncaught exception (group=0xb1f58648)
07-18 05:25:56.010: E/AndroidRuntime(2054): FATAL EXCEPTION: main
07-18 05:25:56.010: E/AndroidRuntime(2054): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.gms flg=0x80000 pkg=com.android.vending }
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.app.Activity.startActivityForResult(Activity.java:3390)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.app.Activity.startActivityForResult(Activity.java:3351)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:839)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.app.Activity.startActivity(Activity.java:3587)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.app.Activity.startActivity(Activity.java:3555)
07-18 05:25:56.010: E/AndroidRuntime(2054): at com.google.android.gms.dynamic.a$5.onClick(Unknown Source)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.view.View.performClick(View.java:4240)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.view.View$PerformClick.run(View.java:17721)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.os.Handler.handleCallback(Handler.java:730)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.os.Handler.dispatchMessage(Handler.java:92)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.os.Looper.loop(Looper.java:137)
07-18 05:25:56.010: E/AndroidRuntime(2054): at android.app.ActivityThread.main(ActivityThread.java:5103)
07-18 05:25:56.010: E/AndroidRuntime(2054): at java.lang.reflect.Method.invokeNative(Native Method)
07-18 05:25:56.010: E/AndroidRuntime(2054): at java.lang.reflect.Method.invoke(Method.java:525)
07-18 05:25:56.010: E/AndroidRuntime(2054): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
07-18 05:25:56.010: E/AndroidRuntime(2054): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-18 05:25:56.010: E/AndroidRuntime(2054): at dalvik.system.NativeStart.main(Native Method)
07-18 05:26:02.570: I/Process(2054): Sending signal. PID: 2054 SIG: 9
这是我的应用程序的清单,我添加了permisions和api密钥:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tunivote"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"/>
<permission android:name="com.example.tunivote.MAPS_RECEIVE" android:protectionLevel="signature"></permission>
<uses-permission android:name="com.example.tunivote.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="com.example.tunivote.providres.gsf.permission.READ_GSERVICES"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="my api key" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="authentification"></activity>
</application>
</manifest>
答案 0 :(得分:0)
检查您的模拟器类型后,无论是Android还是Google模拟器。请确保您在Google API模拟器上运行。