Android 需要开发平台谷歌公司:谷歌API:23,但这是一个发布平台

Android 需要开发平台谷歌公司:谷歌API:23,但这是一个发布平台,android,sdk,Android,Sdk,我正试图从Zigurd Mednieks的书“Programming Android.Second Edition”(来源于github:)中构建示例项目。 示例项目使用GoogleMapsAPI 我使用的是Android Studio 2.1.2,Android 6.X(API 24)模拟器。 My build.gradle文件内容: apply plugin: 'com.android.application' android { compileSdkVersion "Goo

我正试图从Zigurd Mednieks的书“Programming Android.Second Edition”(来源于github:)中构建示例项目。 示例项目使用GoogleMapsAPI

我使用的是Android Studio 2.1.2,Android 6.X(API 24)模拟器。 My build.gradle文件内容:

    apply plugin: 'com.android.application'
android {
    compileSdkVersion "Google Inc.:Google APIs:23"
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.oreilly.demo.android.pa.microjobs"
        targetSdkVersion "Google Inc.:Google APIs:23"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
dependencies {
    compile 'com.google.android.gms:play-services:9.4.0'
}
AVD信息详情:

Name: Nexus_9_API_24

CPU/ABI: Intel Atom (x86)

Path: /home/dataminer/.android/avd/Nexus_9_API_24.avd

Target: default [] (API level 24)

Skin: nexus_9

SD Card: 100M

hw.dPad: no

runtime.network.speed: full

hw.accelerometer: yes

hw.device.name: Nexus 9

vm.heapSize: 128

hw.device.manufacturer: Google

hw.gps: yes

hw.initialOrientation: landscape

image.androidVersion.api: 24

hw.audioInput: yes

image.sysdir.1: system-images/android-24/default/x86/

tag.id: default

hw.camera.back: none

hw.mainKeys: no

AvdId: Nexus_9_API_24

hw.camera.front: none

hw.lcd.density: 320

runtime.scalefactor: auto

avd.ini.displayname: Nexus 9 API 24

hw.gpu.mode: auto

hw.device.hash2: MD5:b17ec930ff79ac39e6145decb0ebf013

hw.ramSize: 1536

hw.trackBall: no

hw.battery: yes

hw.sdCard: yes

tag.display: 

runtime.network.latency: none

hw.keyboard: yes

hw.sensors.proximity: no

disk.dataPartition.size: 800M

hw.sensors.orientation: yes

avd.ini.encoding: UTF-8

hw.gpu.enabled: yes
“将项目与Gradle文件同步”步骤成功完成,但在项目运行时出现以下错误:

    $ adb shell pm install -r "/data/local/tmp/com.oreilly.demo.android.pa.microjobs"
Failure [INSTALL_FAILED_OLDER_SDK: Failed parse during installPackageLI: /data/app/vmdl1110332747.tmp/base.apk (at Binary XML file line #7): Requires development platform Google Inc.:Google APIs:23 but this is a release platform.]

如何修复此错误?

调用
compileSdkVersion“23”
而不是
compileSdkVersion“Google Inc:Google API:23”
targetSdkVersion 23
我尝试并收到错误“error:package com.Google.android.maps不存在”。是的。你解决了吗?这不管用。我已经在Android SDK中安装了Google API,指定在清单XML中使用com.Google.Android.maps,并选择Google API作为构建目标(在原始build.gradle文件中)。它导致了主要问题“需要开发平台Google Inc.:Google API:23”中的错误,但这是一个发布平台“call
compileSdkVersion”23“
,而不是
compileSdkVersion”Google Inc.:Google API:23“
targetSdkVersion 23
,我已尝试并收到错误“错误:包com.google.android.maps不存在”。是的。您解决了吗?这不起作用。我已经在android SDK中安装了google API,指定在清单XML中使用com.google.android.maps,并选择google API作为构建目标(在原始build.gradle文件中)。这导致主要问题中出现错误”需要开发平台Google Inc.:Google API:23但这是一个发布平台“