当尝试从 git://github.com/osmdroid/osmdroid 构建 OpenStreetMapView 时,出现以下错误:
failed to find target with hash string android-23: D:\Users\myusername\AppData\Local\Android
我怎样才能解决这个问题?之前与此类似的问题建议检查 android 23 是否未安装,但就我而言,它是安装的。
以下是一些相关信息:
ANDROID_HOME 是D:\Users\myusername\AppData\Local\Android\sdk
D:\Users\myusername\AppData\Local\Android\sdk\platforms\
包含目录 \android-23\(以及 android-19、android-21、android-22、android-MNC)
构建.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "org.osmdroid.example"
minSdkVersion 8
targetSdkVersion 23
versionCode 16
versionName "4.4-SNAPSHOT"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'android.support:compatibility-v4:23+'
compile project(':osmdroid-android')
//compile 'org.osmdroid:osmdroid-third-party:4.4-SNAPSHOT'
}
我尝试将 targetSdkVersion 和compileSdkVersion 更改为 22。这会导致错误消息更改为“android-22”而不是“android-23”。
SDK Manager:
![enter image description here](https://i.stack.imgur.com/kHBxd.png)
就我而言,清除缓存不起作用。
在 SDK Manager 上,请务必选中复选框“显示包描述”;那么你还应该选择“Google API”对于您愿意安装的版本。
安装它然后你应该就可以了
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)