Description
Issue description
Today I wanted to make a POC of muxing video&audio, and use ExoPlayer to view the output video.
All went fine, till I wanted to add ExoPlayer dependency, which caused a build error when trying to run the app.
Reproduction steps
- Import project:
-
add the ExoPlay dependency:
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.5'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.5' -
Try to run the app.
Link to test content
There is no content to test. It's a build error.
Here's a video showing the issue:
Version of ExoPlayer being used
2.9.5 , but it seems to occur on previous ones too.
Device(s) and version(s) of Android being used
Android Studio 3.3.1
Build #AI-182.5107.16.33.5264788, built on January 29, 2019
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
A full bug report captured from the device
IDE log:
This is the build error log:
Transform exoplayer-core.aar (com.google.android.exoplayer:exoplayer-core:2.9.5) with DexingTransform
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): void com.google.android.exoplayer2.Player$EventListener.onLoadingChanged(boolean)","sources":[{}],"tool":"D8"}Task :app:transformNativeLibsWithMergeJniLibsForDebug
Task :app:mergeExtDexDebug
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): java.lang.String com.google.android.exoplayer2.ui.PlayerNotificationManager$MediaDescriptionAdapter.getCurrentSubText(com.google.android.exoplayer2.Player)","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): void com.google.android.exoplayer2.Player$EventListener.onLoadingChanged(boolean)","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): void com.google.android.exoplayer2.Player$EventListener.onLoadingChanged(boolean)","sources":[{}],"tool":"D8"}Task :app:mergeExtDexDebug FAILED
FAILURE: Build failed with an exception.
- What went wrong:
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.Failed to transform file 'classes.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=16} using transform DexingTransform
Error while dexing.
Failed to transform file 'classes.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=16} using transform DexingTransform
Error while dexing.
Failed to transform file 'classes.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=16} using transform DexingTransform
Error while dexing.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.Get more help at https://help.gradle.org
BUILD FAILED in 11s
23 actionable tasks: 8 executed, 15 up-to-date
Activity
AndroidDeveloperLB commentedon Feb 20, 2019
Damn it's again the issue of the Java 1.8...
Had to add this:
This should be the default for new projects on the IDE...
gdky005 commentedon Apr 17, 2019
太感谢了,昨天折腾了好久,终于搞定了。