Open JR-05 opened 1 year ago
I also need to add a special configuration, that is, if minifyEnabled = true, everything will be normal.
I also encountered this problem
I also encountered this problem. Did anyone able to fix this?
As mentioned above, I tried making minifyEnabled = true, but that did not solve the problem for me.
I found out that in my case, the issue triggers if I add this in build.gradle
dependencies {
implementation("org.mongodb:mongodb-driver-kotlin-coroutine:5.2.0")
}
I followed these steps from MongoDB documentation.
Still trying to find a fix for it.
Updated my comment 👆 @rohandakua @mongodb
packaging { resources { excludes += "/META-INF/DISCLAIMER" } } packagingOptions { resources { excludes += setOf( "META-INF/LICENSE.md", "META-INF/LICENSE.txt", "META-INF/NOTICE", "META-INF/NOTICE.txt", "META-INF/LICENSE-notice.md" ) } } add this in our build.gradle of our app inside android section and also make sure the java version is 17 in app.build.gradle
packagingOptions { resources { excludes += setOf( "META-INF/LICENSE.md", "META-INF/LICENSE.txt", "META-INF/NOTICE", "META-INF/NOTICE.txt", "META-INF/LICENSE-notice.md" ) } }
@rohandakua This didn't fix the issue for me unfortunately.
packagingOptions { resources { excludes += setOf( "META-INF/LICENSE.md", "META-INF/LICENSE.txt", "META-INF/NOTICE", "META-INF/NOTICE.txt", "META-INF/LICENSE-notice.md" ) } }
@rohandakua This didn't fix the issue for me unfortunately.
Can you use 4.12.1 version of web3j implementation("org.web3j:core:4.12.1")
implementation("org.web3j:core:4.12.1")
That didn't work. In fact, it got worse. Before, org.mongodb:mongodb-driver-kotlin-coroutine
dependency was causing the issue. But when I added the dependency org.web3j:core:4.12.1
, I get the same failure even if I comment out coroutine.
Finally solved the issues. 🎉
Issue 1:
Invalid build configuration. Attempt to create a global synthetic for 'Record desugaring' without a global-synthetics consumer.
This issue was happening because my Kotlin and Java versions were not aligned.The JVM target mentioned in the build.gradle was 1.8 and I was using JDK 17.
I changed the following in android block of build.gradle
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
Issue 2:
2 files found with path 'META-INF/native-image/native-image.properties'
I added this in build.gradle to fix it:
excludes += "META-INF/native-image/**"
@rohandakua - Thanks for the idea 🥳 👆
This helped exclude all files and folders inside the META-INF/native-image directory from my final APK or AAB.
congrats sir 🎉
Issuetitle
Execution failed for task ':app:mergeExtDexDevDebug'.
Environment
IDEA: AndroidStudio Web3j 4.10.2 Java version: zuluDK17 Operating System Win10 Gradle version: 7.6
Error