Error when trying to deploy on Android, IOS works fine.
The error started when I added the PushNotification plugin.
:apkDebug FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':apkDebug'.
com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK LICENSE
File 1: /Users/antoniopereira/.gradle/caches/modules-2/files-2.1/com.google.gms/google-services/3.0.0/ee538ce9cf4148485e43017c5542202b8c78ff8e/google-services-3.0.0.jar
File 2: /Users/antoniopereira/.gradle/caches/modules-2/files-2.1/com.google.gms/google-services/3.0.0/ee538ce9cf4148485e43017c5542202b8c78ff8e/google-services-3.0.0.jar
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I found the simple and already made solution of excludes:
packagingOptions {
exclude 'LICENSE'
}
Related
I just upgraded to Firestore 0.14.4 from 0.13.* for my VSCode/Flutter project and am now getting the build errors below.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\projects\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.14.4\android\build.gradle' line: 54
* What went wrong:
A problem occurred evaluating project ':cloud_firestore'.
> Could not find method platform() for arguments [com.google.firebase:firebase-bom:25.12.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* 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
Exited (sigterm)
My build.gradle file has the line classpath 'com.android.tools.build:gradle:3.3.2 which makes me think my gradle needs upgrading? So, I did the usual Google search but it didn't seem straightforward to upgrade gradle (though I'm sure I missed something). Does it sound like I need to upgrade and, if so, how do I do that?
i am getting an error when i trying to run the app. please help. The error in cmd is below -
Error running Gradle:
ProcessException: Process "C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\gradlew.bat" exited abnormally:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\app\build.gradle' line: 14
What went wrong:
A problem occurred evaluating project ':app'.
ASCII
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 14s
Command: C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
line nine in app-build-gradle is below-
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
There could be many reasons for such a error. I had a similar error. I would suggest you to open your project in android studio and check your gradel versions. I see by the name of you app that you are using firebase. Some of those plugins use Androidx. So migrating your project to Androidx might help. Here's how to migrate your project to Androidx.
Hope it helps!
I had the same issue this may because of the incompatibility of Gradle versions.
I opened the android part in Android Studio and updated Gradle as recommended by Android Studio with Alt+Enter and it solved my problem.
I can elaborate more if you can post more details about it e.g your app/gradle file.
I'm new react-native developer. When i run react native in windows with "react-native run-android", it return error :
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library
:app:prepareComAndroidSupportSupportV42301Library FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:prepareComAndroidSupportSupportV42301Library'.
Could not expand ZIP 'C:\Android\sdk\extras\android\m2repository\com\android\support\support-v4\23.0.1\support-v4-23.0.1.aar'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 15 mins 33.768 secs
Can you help me fix this problem? thank!
I had the exact same issue and it turns out it's got to do with the google play-services-analytics version.
and by adding the following code to the build.gradle file I was able to get rid of the error.
compile("com.google.android.gms:play-services-analytics:8.3.0"){
force = true
}
add it at the top of the dependencies curly braces.
so that it looks like this.
dependencies { compile("com.google.android.gms:play-services- analytics:8.3.0"){
force = true
}
//the rest of the dependencies follow
Go t the page below for a better and more detailed explanation
https://github.com/idehub/react-native-google-analytics-bridge/issues/31
Tried to create my first project in android studio, using one of the examples im trying to run the application, but gradle gives me this build error (didnt change one line of code - just trying to run the Empty activity):
Gradle: FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':Passivelocation:packageDebug'.
org.bouncycastle.asn1.ASN1Integer.(J)V
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Ive tried adding info and debug while running the command on with the cli but i cant make much of the output it gives me.
Any suggestions?
I faced the same failure and the problem was with my jdk/jre because some time ago I added the Bouncy Castle Crypto APIs functionality by adding the jar to my jdk/jre path.
I tried a gradle build with a "clean" jdk/jre and problem was solved
I am using new android studio for my project.
i am getting compilation error.
i am also using two external jar file in my project.
1:-commons-net-3.2.jar
2:-commons-net-3.2-sources.jar
Cant get what goes wrong please help.
following is error message.
Gradle: FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':FtpSample:compileDebug'.
Compilation failed; see the compiler error output for details.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
EDIT : this was a workaround available up to Android-Studio 0.2.0
One thing you can do is deactivate the external build. To do so click on "compiler settings icon".
Uncheck "Use External build
And you will see the errors in the console
I found the problem with some external jar and gradle system .
if your jar file dosent compile then just open
build.gradle--> then edit following code .
dependencies {
compile files('libs/android-support-v4.jar')
compile files('libs/your jar file')
}
i hope this help people with same error