Wednesday, 12 October 2022

Detected multiple Kotlin daemon sessions at build/kotlin/sessions

When building apk with ./gradlew assembleRelease under Android for React Native 0.70.1/gradle 7.3.3/7.4.2/7.5.1/Android Studio 2021.3.1/macOS Monterey, it failed with error. The app runs fine (npx react-native run-android) on Android simulator:

> Task :rn-alioss:verifyReleaseResources FAILED
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':rn-alioss:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/Users/macair/Documents/code/js/xyz_app6/node_modules/rn-alioss/android/build/intermediates/merged_res/release/values/values.xml:2723: AAPT: error: resource android:attr/lStar not found.

It is a common error related to gradle but solutions posted were not working in my case. What I did was to downgrade gradle from 7.5.1 to 7.4.2 with:

./gradlew wrapper --gradle-version 7.4.2 --distribution-type=all

Then downgrade to 7.3.3 and the error remains the same. Deleting android/.gradle and ./gradlew clean didn't help. Adding org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m ,,,, to /android/gradle.properties causing error of MaxPerSize unrecognized.



from Detected multiple Kotlin daemon sessions at build/kotlin/sessions

No comments:

Post a Comment