All of sudden my flutter android project build is failing with the following errors.
FAILURE: Build completed with 2 failures.
1: Task 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 org.bouncycastle.LICENSE found in modules jetified-bcprov-jdk15on-1.65 (org.bouncycastle:bcprov-jdk15on:1.65) and jetified-bcprov-jdk15to18-1.69 (org.bouncycastle:bcprov-jdk15to18:1.69)
2: Task failed with an exception.
- What went wrong: Execution failed for task ':app:mergeDebugJavaResource'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade More than one file was found with OS independent path 'org/bouncycastle/x509/CertPathReviewerMessages_de.properties'.
My gradle properties : org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true
Target and compile SDK's are 31. "com.android.tools.build:gradle:4.1.3"
Flutter configuration: Flutter 3.3.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision ffccd96b62 (4 weeks ago) • 2022-08-29 17:28:57 -0700 Engine • revision 5e9e0e0aa8 Tools • Dart 2.18.0 • DevTools 2.15.0
CodePudding user response:
I am also getting the following error Duplicate class org.bouncycastle.LICENSE found in modules jetified-bcprov-jdk15on-1.65 (org.bouncycastle:bcprov-jdk15on:1.65) and jetified-bcprov-jdk15to18-1.69 (org.bouncycastle:bcprov-jdk15to18:1.69) but in react-native.
My gradle properties : org.gradle.jvmargs=-Xmx4096m android.useAndroidX=true android.enableJetifier=true Target and compile SDK's are 31. "com.android.tools.build:gradle:4.2.2"
CodePudding user response:
Edit: This issue has been fixed, find the image in the github url:
OR
Im also getting the same error but the thing is I havent pushed the code on my git over a week. It was working fine, Ive just ran it again after a week with same settings. Even a month ago code having the same error
Fvm Flutter Version 3.3.0 | 3.0.3
1: Task failed with an exception.
Execution failed for task ':app:checkDebugDuplicateClasses'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class org.bouncycastle.LICENSE found in modules jetified-bcprov-jdk15on-1.65 (org.bouncycastle:bcprov-jdk15on:1.65) and jetified-bcprov-jdk15to18-1.69 (org.bouncycastle:bcprov-jdk15to18:1.69) ...
2: Task failed with an exception. Execution failed for task ':app:mergeDebugJavaResource'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade More than one file was found with OS independent path 'org/bouncycastle/x509/CertPathReviewerMessages_de.properties'.