我在以下位置关注当前位置教程:选择当前位置并在地图上显示详细信息
我不断收到以下运行时异常:
com.google.android.gms.common.api.ApiException:9003:PLACES_API_ACCESS_NOT_CONFIGURED
我尝试了以下步骤:
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/api_key" />
Run Code Online (Sandbox Code Playgroud)
我还使用了似乎运行良好的Maps SDK。开发者控制台上同时启用了Maps SDK和Places API。
即使尝试了所有这些步骤,我仍然收到运行时错误:
ApiException:9003:PLACES_API_ACCESS_NOT_CONFIGURED错误
我的代码:
package com.arnav.akapplications.mapfinder;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.Uri;
import android.os.PersistableBundle;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import …Run Code Online (Sandbox Code Playgroud)