That is the error when i run my app
i need some help
i add liberary
just_audio:0:9:31
and i found this error and didn't run
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class com.google.android.exoplayer2.ui.DownloadNotificationHelper found in modules jetified-exoplayer-core-2.18.1-runtime (com.google.android.exoplayer:exoplayer-core:2.18.1) and jetified-exoplayer-ui-2.11.1-runtime (com.google.android.exoplayer:exoplayer-ui:2.11.1)
Duplicate class com.google.android.exoplayer2.ui.package-info found in modules jetified-exoplayer-common-2.18.1-runtime (com.google.android.exoplayer:exoplayer-common:2.18.1) and jetified-exoplayer-ui-2.11.1-runtime (com.google.android.exoplayer:exoplayer-ui:2.11.1)
Go to the documentation to learn how to Fix dependency resolution errors.
* 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 15s
Exception: Gradle task assembleDebug failed with exit code 1```
i expect to find some advice to solve it
in your android/app/build.gradle, try adding those dependencies:
dependencies {
// ...
def exoplayer_version = "2.18.1" // this is the version
implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-dash:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-hls:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-smoothstreaming:$exoplayer_version"
}
save and re build your app.
Related
I am getting the following Build failed with exception after I run my flutter project.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class com.google.android.exoplayer2.ui.DownloadNotificationHelper found in modules jetified-exoplayer-core-2.17.0-runtime (com.google.android.exoplayer:exoplayer-core:2.17.0) and jetified-exoplayer-ui-2.15.1-runtime (com.google.android.exoplayer:exoplayer-ui:2.15.1)
Go to the documentation to learn how to Fix dependency resolution errors.
* 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 3m 26s
Running Gradle task 'assembleDebug'... 208.9s
Exception: Gradle task assembleDebug failed with exit code 1
I am currently using Flutter's latest version that is Version 2.10.1. Also in my project, I used the 'better_player' pub package.
Please give me a solution to this.
Add following dependency in app/build.gradle in dependencies at the end of the file -
implementation 'com.google.android.exoplayer:exoplayer:2.17.0'
Example -
dependencies {
...
implementation 'com.google.android.exoplayer:exoplayer:2.17.0'
}
First : if you are using video_player
add this line in your app/build.gradle
implementation 'com.google.android.exoplayer:exoplayer:2.17.1'
Second : if you are using better_player
add this line in your app/build.gradle
implementation 'com.google.android.exoplayer:exoplayer:2.15.0'
Third : if you are using the both video_player & better_player
you should downgraded video_player version to 2.1.12 in pubspec.yaml
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve com.google.android.gms:play-services-ads-identifier:12.0.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.google.android.gms:play-services-ads-identifier:12.0.1.
Required by:
project :app > com.onesignal:OneSignal:3.15.3
> Skipped due to earlier error
* 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 3m 7s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I face this error 1 week please help me everyone my project was build from flutter 1.2.3
and I need to upgrade it because currently it's not working the problem is onesignal and firebase version not fit. Please give me any answer I need to complete this for my company I just in flutter internship
Android build failing with following exception.
Plugin: scan [https://pub.dev/packages/scan]
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDevReleaseAssets'.
Could not resolve all files for configuration ':app:devReleaseRuntimeClasspath'.
Could not resolve com.huawei.hms:scanplus:2.1.0.300.
Required by:
project :app > project :scan
> Could not resolve com.huawei.hms:scanplus:2.1.0.300.
> Could not get resource 'https://google.bintray.com/exoplayer/com/huawei/hms/scanplus/2.1.0.300/scanplus-2.1.0.300.pom'.
> Could not GET 'https://google.bintray.com/exoplayer/com/huawei/hms/scanplus/2.1.0.300/scanplus-2.1.0.300.pom'. Received status code 502 from server: Bad Gateway
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 2m 59s
add: maven {url 'http://developer.huawei.com/repo'}
check your build.gradle
My flutter project runs fine with Firebase ML Vision 0.9.x, if I try to upgrade to 0.10.0 (or higher), it yields the following errors:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\...\Cache\hosted\pub.dartlang.org\firebase_ml_vision-0.10.0\android\build.gradle' line: 26
* What went wrong:
A problem occurred evaluating project ':firebase_ml_vision'.
> Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':firebase_ml_vision'.
> compileSdkVersion is not specified. Please add it to build.gradle
* 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 889ms
Exception: Gradle task assembleDebug failed with exit code 1
The first of those two errors is weird because the setup instructions and the package install guidelines both say that firebase_core is not required (anymore).
The second is just plain wrong, as my app's build.gradle specifies compileSdkVersion 30 and the firebase_ml_vision package's build.gradle specifies compileSdkVersion 29.
Any ideas what's going on?
Found a solution that works:
Ignore the setup instructions and add firebase_core as a dependency. Then, add the 'implementations' according to this thread to solve the 'Duplicate class' issues.
I am trying to run flutter project on my phone but I get this exception:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not find com.android.tools.build:gradle:4.1.3.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.jar
Required by:
project :
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 2s
Exception: Gradle task assembleDebug failed with exit code 1
Please try the following steps:
Delete the android directory.
Run flutter clean comment
Run flutter create . comment
Run flutter pub get comment
Run the application.