Я использую
com.amazon.android: exoplayer-ui: r2.5.4
В своем проекте я только что обновил IDE до Android Studio 3.3.1,в моем build.gradle
у меня есть код ниже для компиляции
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
При попытке собрать, я получаю эту ошибку:
Задача: app: mergeExtDexDebug FAILED AGPBI: {"kind":" error "," text ":" Поддерживаются только методы интерфейса по умолчанию, начиная с Android N (--min-api 24): void com.google.android.exoplayer2.Player $ EventListener.onLoadingChanged (boolean) ","sources ": [{}]," tool ":" D8 "}
FAILURE: сборка не удалась, исключение.
- Что пошло не так: не удалось разрешить все файлы для конфигурации': приложение: debugRuntimeClasspath.Не удалось преобразовать файл 'classes.jar' для соответствия атрибутам {artifactType = android-dex, dexing-is-debuggable = true, dexing-min-sdk = 21} с использованием преобразования DexingTransform Error во время dexing.
Когда я изменяю sourceCompatibility
и targetCompatibility
на JavaVersion.VERSION_1_8
, он успешно собирается, но приложение вылетает со следующей ошибкой:
E / AndroidRuntime: FATAL EXCEPTION: main Process: com.mypackage, PID: 4374 java.lang.NoSuchMethodError: Прямой метод отсутствует (Lcom / google / android / exoplayer2 / upstream / DefaultAllocator; IIJJLcom / google / android / exoplayer2 / util / PriorityTaskManager;) V в классе Lcom / gAndroid / exoplayer2 / DefaultLoadControl;или его суперклассы (объявление com.google.android.exoplayer2.DefaultLoadControl 'отображается в /data/app/mypackagename/base.apk:classes5.dex)
Есть предложения?
проект build.gradle
buildscript {
System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
repositories {
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://maven.google.com' }
google()
}
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.android.tools.build:gradle:3.3.1'
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
приложение build.gradle
buildscript {
repositories {
google()
mavenLocal()
maven { url 'https://maven.fabric.io/public' }
jcenter()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.27.0'
classpath 'com.google.gms:google-services:4.2.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
applicationId ‘myAppId’
minSdkVersion 21
targetSdkVersion 26
versionCode 31
versionName "1.3.5"
multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation":
"$projectDir/schemas".toString()]
}
}
sourceSets {
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}
}
dexOptions {
javaMaxHeapSize "6g"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
productFlavors {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'META-INF/android.arch.lifecycle_runtime.version'
}
}
dependencies {
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:leanback-v17:23.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.google.code.gson:gson:2.2.4'
implementation 'com.google.android.gms:play-services-ads:9.8.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.jakewharton:butterknife:7.0.1'
implementation 'com.makeramen:roundedimageview:2.2.1'
implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
implementation 'com.android.support:support-vector-drawable:26.1.0'
implementation 'com.android.support:animated-vector-drawable:26.1.0'
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.8.5'
implementation('com.amazon.android:exoplayer-ui:r2.5.4') {
exclude module: 'exoplayer-core'
}
api 'com.amazon.android:exoplayer-core:r2.5.4'
implementation 'com.amazon.android:exoplayer-hls:r2.5.4'
implementation 'com.amazon.android:exoplayer-dash:r2.5.4'
implementation 'com.amazon.android:extension-okhttp:r2.5.4'
implementation 'commons-net:commons-net:3.3'
implementation('android.arch.persistence.room:rxjava2:1.0.0-rc1') {
exclude group: 'com.android.support', module: 'support-compat'
exclude group: 'android.arch.persistence.room', module: 'runtime'
exclude group: 'com.android.support', module: 'support-core-utils'
}
implementation('android.arch.persistence.room:runtime:1.0.0-rc1') {
exclude group: 'com.android.support', module: 'support-compat'
exclude group: 'com.android.support', module: 'support-core-utils'
}
implementation 'android.arch.lifecycle:runtime:1.0.0-rc1'
implementation('android.arch.lifecycle:extensions:1.0.0-rc1') {
exclude group: 'com.android.support', module: 'support-compat'
exclude group: 'com.android.support', module: 'support-core-ui'
exclude group: 'com.android.support', module: 'support-core-utils'
}
annotationProcessor "android.arch.persistence.room:compiler:1.0.0-rc1"
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-rc1"
annotationProcessor "com.jakewharton:butterknife:7.0.1"
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.0'
}
configurations.all {
resolutionStrategy.force 'com.android.support:support-v4:26.1.0'
}