【发布时间】:2017-11-16 04:32:49
【问题描述】:
我的应用在 targetSdkversion = 25 和 compileSdkversion = 25 时运行良好
现在我需要让它在 targetSdkversion 为 21 时工作。应用程序失败并出现错误应用程序停止工作。
我需要更改任何工具版本或任何其他参数吗?
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "MY.APP.NAME"
minSdkVersion 17
targetSdkVersion 21
versionCode 11
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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'
exclude group: 'com.google.code.findbugs'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.android.support:design:25.3.1'
compile 'com.squareup.okhttp3:okhttp:3.0.1'
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
testCompile 'junit:junit:4.12'
}
【问题讨论】:
-
@Sara 谢谢你,但在读完这篇文章后,我发现自己更加困惑了。是不是说,targetversion和我的问题无关?