我想运行我的应用,但出现此错误:
错误:仅从Android O开始支持调用自定义 (--min-api 26)
我在下面添加了thr 2行,但仍然收到相同的错误:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
等级:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "maa.packname.app"
minSdkVersion 15
targetSdkVersion 27
versionCode 22
versionName "5.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
renderscriptSupportModeEnabled true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
resolutionStrategy.force 'com.android.support:support-v4:27.1.1'
}
}
dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':library')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation('com.github.chrisbanes:PhotoView:2.1.4') {
exclude group: 'com.android.support'
}
implementation "com.android.support:customtabs:27.1.1"
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'dev.dworks.libs:volleyplus:0.1.4'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:support-v4:27.1.1'
implementation('com.github.bumptech.glide:okhttp3-integration:4.4.0', {
exclude group: 'com.android.support'
})
implementation('com.github.bumptech.glide:glide:4.8.0', {
exclude group: 'com.android.support'
})
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation('com.squareup.picasso:picasso:2.5.2') {
exclude group: "com.android.support"
}
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5@aar'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation('com.yarolegovich:discrete-scrollview:1.4.7') {
exclude group: 'com.android.support'
}
implementation('info.androidhive:imagefilters:1.0.7') {
exclude group: "com.android.support"
}
implementation 'com.waynejo:androidndkgif:0.3.3'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
implementation('com.github.esafirm.android-image-picker:imagepicker:1.12.0', {
exclude group: 'com.android.support'
})
implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.flying.xiaopo:sticker:1.6.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.github.BoD:aLibGlitch:1.0.0'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
implementation 'com.firebase:firebase-jobdispatcher:0.6.0'
implementation 'com.vodyasov:amr:0.5'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
implementation group: 'com.google.guava', name: 'guava', version: '27.1-android'
testImplementation 'junit:junit:4.12'
implementation('com.google.android.exoplayer:exoplayer:2.9.6')
implementation 'jp.co.cyberagent.android:gpuimage:2.0.3'
implementation 'com.squareup:otto:1.3.8'
implementation 'org.apache.commons:commons-collections4:4.3'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.2'
}
apply plugin: 'com.google.gms.google-services'
我怀疑 Exoplayer库是问题的原因,有人可以帮助我解决此问题。