【发布时间】:2016-12-01 20:54:21
【问题描述】:
我正在制作一个带有导航抽屉的安卓应用。我记得我使用了一些要求sdk版本为24的功能,所以compileSdkVersion和targetSdkVersion一样需要24,但是我的android手机只有19所以我没有看到手机上下载的应用程序,它打开了一次我完成了项目的运行,但是当我关闭手机上的选项卡时,我无法再次打开它。因此,我尝试将 compileSdkVersion 和 targetSdkVersion 更改为 19,但出现此错误:无法找到可选库:org.apache.http.legacy
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.marivel.cruz.threatmapping"
minSdkVersion 17
targetSdkVersion 19
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
signingConfigs {}
buildTypes {}
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.android.gms:play-services-maps:9.8.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.android.gms:play-services:9.8.0'
testCompile 'junit:junit:4.12'
}
【问题讨论】:
-
你试过了吗:useLibrary 'org.apache.http.legacy' ?
-
AndroidGorilla the useLibrary 'org.apache.http.legacy' 在吗?
-
@camille 我的坏人