无法找到带有哈希字符串 android-23 的目标
尝试从 git://github.com/osmdroid/osmdroid 构建 OpenStreetMapView 时,出现此错误:
When trying to build OpenStreetMapView from git://github.com/osmdroid/osmdroid, I get this error:
failed to find target with hash string android-23: D:UsersmyusernameAppDataLocalAndroid
我该如何解决这个问题?以前与此类似的问题建议检查未安装 android 23,但在我的情况下,它是.
How can I fix this? Previous questions similar to this suggest checking that android 23 is not installed, but in my case, it is.
以下是一些相关信息:
ANDROID_HOME 是 D:UsersmyusernameAppDataLocalAndroidsdk
ANDROID_HOME is D:UsersmyusernameAppDataLocalAndroidsdk
D:UsersmyusernameAppDataLocalAndroidsdkplatforms
包含目录android-23,(以及android-19、android-21、android-22、android-MNC)
D:UsersmyusernameAppDataLocalAndroidsdkplatforms
contains the directory android-23, (as well as android-19, android-21, android-22, android-MNC)
build.gradle
build.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".
I tried changing targetSdkVersion and compileSdkVersion to 22. This causes the error message to change to "android-22" instead of "android-23".
SDK 管理器:
就我而言,清除缓存不起作用.
In my case, clearing caché didn't work.
在 SDK Manager 上,一定要勾选显示包描述";那么您还应该为您愿意安装的版本选择 Google API".
On SDK Manager, be sure to check the box on "show package descriptions"; then you should also select the "Google APIs" for the version you are willing to install.
安装它然后你应该没问题
Install it and then you should be ok