03-05 15:47:47.015 20062-20062/com.electivechaos.checklist E/ContentValues: Exception: %s
com.google.android.gms.common.api.ApiException: 13: ERROR
at com.google.android.gms.common.internal.zzb.zzy(Unknown Source)
at com.google.android.gms.common.internal.zzbk.zzz(Unknown Source)
at com.google.android.gms.common.internal.zzbl.zzr(Unknown Source)
at com.google.android.gms.common.api.internal.BasePendingResult.zzc(Unknown Source)
at com.google.android.gms.common.api.internal.BasePendingResult.setResult(Unknown Source)
at com.google.android.gms.location.places.zzm.zzao(Unknown Source)
at com.google.android.gms.location.places.internal.zzx.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:565)
我的清单:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCA-2HMYGs_AiUC3cvCDw49o2AuHkp5A40"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
答案 0 :(得分:1)
标识。我在这里做错了:
android:name="com.google.android.maps.v2.API_KEY"
替换为
"android:name="com.google.android.geo.API_KEY"
答案 1 :(得分:0)
经过多次尝试,当我在真实设备上运行时,它终于可以工作了。我的模拟器安装了Google Play服务,但我仍然遇到异常。
确保在真实设备上进行测试。