小编arn*_*vJJ的帖子

ApiException:9003:PLACES_API_ACCESS_NOT_CONFIGURED

我在以下位置关注当前位置教程:选择当前位置并在地图上显示详细信息

我不断收到以下运行时异常:

com.google.android.gms.common.api.ApiException:9003:PLACES_API_ACCESS_NOT_CONFIGURED

我尝试了以下步骤:

  1. 在开发人员控制台中启用Places API
  2. 使用迁移指南:迁移到New Places SDK客户端# 本教程使用的是不推荐使用的Places SDK,即新的依赖关系,因为本教程使用了新的Places SDK的新方法
  3. 在我的Android清单文件中添加以下代码
<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)
  1. 重新生成了我的API密钥。

我还使用了似乎运行良好的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)

android google-places-api google-places

10
推荐指数
1
解决办法
6173
查看次数

标签 统计

android ×1

google-places ×1

google-places-api ×1