android target 23,gradle - failed to find target with hash string android-23 - Stack Overflow

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:\Users\myusername\AppData\Local\Android

How can I fix this? Previous questions similar to this suggest checking that android 23 is not installed, but in my case, it is.

Below is some pertinent info:

ANDROID_HOME is D:\Users\myusername\AppData\Local\Android\sdk

D:\Users\myusername\AppData\Local\Android\sdk\platforms\ contains the directory \android-23\, (as well as android-19, android-21, android-22, android-MNC)

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'

}

I tried changing targetSdkVersion and compileSdkVersion to 22. This causes the error message to change to "android-22" instead of "android-23".

SDK Manager:

120ddf41708cb97ddfb1f6c0c9ff9812.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值