我试图从Zigurd Mednieks的书中构建示例项目"编程Android。第二版" (来自github:https://github.com/bmeike/ProgrammingAndroid2Examples/tree/master/MicroJobs)。 示例项目使用Google Maps API。
我使用Android Studio 2.1.2,Android 6.X(API 24)模拟器。 我的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 Files同步项目步骤成功完成,但在项目运行中我收到此错误:
$ 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.]
如何解决此错误?