下面的gradle文件是我在我的应用程序中使用的。它在api级别23下工作正常,但是当我从23更新到26时,我遇到了这个问题。请帮助我解决这个问题。
//顶级构建文件
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
task wrapper(type: Wrapper) {
gradleVersion = "3.1.0"
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
}
和我的应用程序gradle文件在下面。此应用程序gradle在compile上工作正常,目标sdk为23。
import java.util.regex.Pattern
apply plugin: 'com.android.application'
android {
lintOptions {
abortOnError false
}
//compileSdkVersion 21
compileSdkVersion 26
flavorDimensions "default"
defaultConfig {
applicationId "**********"
minSdkVersion 14
targetSdkVersion 26
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt'
signingConfig signingConfigs.release
zipAlignEnabled true
debuggable false
}
debug {
minifyEnabled false
zipAlignEnabled true
debuggable true
}
}
sourceSets {
main {
java {
//
}
}
androidTest {
java {
}
}
}
productFlavors {
devel {
repositories {
jcenter()
maven {
url
}
}
}
stag {
repositories {
jcenter()
maven {
url ""
}
}
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ASL2.0'
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
implementation('org.apache.httpcomponents:httpmime:4.3.5') {
exclude module: 'org.apache.httpcomponents:httpclient'
}
implementation 'com.google.android.gms:play-services-plus:11.8.0'
implementation 'com.google.android.gms:play-services-analytics:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation "com.splunk.mint:mint:4.4.0"
}
repositories {
maven {
url "https://mint.splunk.com/gradle/"
}
}
}