如何 运行 映射到 avd Android Studio ide?

how to run map on avd Android Studio ide?

大家早上好,

我正在尝试 运行 在我的 avd 上进行映射。但这给了我一些错误。我是 Android 上的新人。以下是我的步骤:

1.My avd 显示,Map1 不会 运行 除非你更新 Google 播放服务。

2.Run 日志显示:

W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9877000 but found 9683270.

3.I 尝试搜索发现我需要更新我的播放服务。

3.1。所以我手动下载了 apk 文件并尝试在 AVD 内安装它。但它不会工作。

3.2。所以我关注SDKManager->AndroidSDK->SDKTools->and updated all.

3.3。还有 File->Project Structure->App->Dependencies->added Play Services Manually.

3.4 然后最后我尝试使用不同 AVD API 20-25 级别的相同代码并获得相同的输出: '

$ adb shell am start -n "***********.map1/***********.map1.MapsActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Connected to process 4080 on device Nexus_4_API_22 [emulator-5554] I/InstantRun: Instant Run Runtime started. Android package is ***********.map1, real application class is null. W/art: Failed to find OatDexFile for DexFile /data/data/**********.map1/files/instant-run/dex/slice-slice_2-classes.dex ( canonical path /data/data/***********.map1/files/instant-run/dex/slice-slice_2-classes.dex) with checksum 0xfc12792c in OatFile /data/data/*********.map1/cache/slice-slice_2-classes.dex I/FirebaseInitProvider: FirebaseApp initialization unsuccessful W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 W/GooglePlayServicesUtil: Google Play services out of date. Requires 9877000 but found 9683270 D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

              [ 11-03 11:15:10.206  4080: 4080 D/         ]
              HostConnection::get() New Host Connection established 0xa2c050d0, tid 4080 D/Atlas: Validating map...

I/OpenGLRenderer: Initialized EGL, version 1.4 D/OpenGLRenderer: Enabling debug mode 0 W/EGL_emulation: eglSurfaceAttrib not implemented W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2c065e0, error=EGL_SUCCESS`

  1. 我的代码在我的设备上正常运行。我想 运行 它在我的 AVD 上。

5.My AVD 有:

5.1:

` 姓名:Nexus_5_API_21

CPU/ABI: Google APIs Intel Atom (x86)

Path: C:\**\*****\.android\avd\Nexus_5_API_21.avd

Target: google_apis [Google APIs] (API level 21)

Skin: nexus_5

SD Card: 100M

hw.dPad: no

runtime.network.speed: full

hw.accelerometer: yes

hw.device.name: Nexus 5

vm.heapSize: 64

skin.dynamic: yes

hw.device.manufacturer: Google

hw.gps: yes

hw.initialOrientation: Portrait

image.androidVersion.api: 21

hw.audioInput: yes

image.sysdir.1: system-images\android-21\google_apis\x86\

tag.id: google_apis

showDeviceFrame: yes

hw.camera.back: emulated

hw.mainKeys: no

AvdId: Nexus_5_API_21

hw.camera.front: emulated

hw.lcd.density: 480

avd.ini.displayname: Nexus 5 API 21

hw.gpu.mode: auto

hw.device.hash2: MD5:*********ceb7d385183***********

hw.ramSize: 1536

hw.trackBall: no

hw.battery: yes

hw.cpu.ncore: 2

hw.sdCard: yes

tag.display: Google APIs

runtime.network.latency: none

hw.keyboard: yes

hw.sensors.proximity: yes
1
disk.dataPartition.size: 800M

hw.sensors.orientation: yes

avd.ini.encoding: UTF-8

hw.gpu.enabled: yes`

首先尝试更新您的 AVD 服务。如果你运气好,那么它会起作用,否则你的地图就会开始。

您需要做的就是启动 AVD 并按照以下步骤操作:-

  1. 进入设置->应用程序->全部->Google Play 服务 并记下您的 AVD 中的版本。

  2. 现在打开你的 build.gradle(Module:app) 而不是 build.gradle(Project: '****') 并将依赖项更改为 [compile 'com.google.android.gms:play-services:{你的服务版本}].

祝你好运;)