I get a error while building a release for android:
Error: /my-app/node_modules/@react-native-community/async-storage/android/build/.transforms/fc2daeb4ff0db30fd0f1f5e68862f91b/classes/classes.dex, Type com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil is defined multiple times: /my-app/node_modules/@react-native-community/async-storage/android/build/.transforms/fc2daeb4ff0db30fd0f1f5e68862f91b/classes/classes.dex, /my-app/android/app/build/intermediates/external_libs_dex/release/out/classes2.dex
That I can build my release.
Have you tried to clean build folders, ./gradlew clean?
I have migrated from AsyncStorage (react-native) to that, and I needed to do the clean like @Krizzu said.
Thanks
Please reopen if issue still exist
Sorry for the late response, but no ./gradlew clean was the first thing i tried but that does not solve the problem
`Type com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil is defined multiple times: /Users/ansh/Documents/ANSH/FitnerApp/node_modules/@react-native-community/async-storage/android/build/.transforms/a5435cadaa866449cc02394986475e6b/classes/classes.dex, /Users/ansh/Documents/ANSH/FitnerApp/android/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes2.dex
`
i am also facing this issue when generating apk but app is running well on device in debug mode. Please tell me the solution if you have solved.? Thanks in advance.
@anshumanburman i am also facing same issue . have you found any solution ?
@anshumanburman @HimaniPatelTH the problem for me was that async-storage had a conflict with react-native-jitsi-meet dependency. Not only async-storage but also react-native-svg. So i had to exclude those inside my /app/build.gradle file:
implementation(project(':react-native-jitsi-meet')) {
exclude group: 'com.facebook',module:'hermes'
exclude group: 'com.facebook.react',module:'react-native-svg'
exclude group: 'com.facebook.react',module:'react-native-community-async-storage'
transitive = true
}
implementation ('org.jitsi.react:jitsi-meet-sdk:2.+') {
exclude group: 'com.facebook',module:'hermes'
exclude group: 'com.facebook.react',module:'react-native-svg'
exclude group: 'com.facebook.react',module:'react-native-community-async-storage'
transitive = true
}
This fixed it for me. So you might also have a dependency that already includes async-storage and you might also want to exclude it in the same way. Hope this helps.
@RicardoDolNL i have added dependency as jar file so this solution is not working .
Most helpful comment
Have you tried to clean build folders,
./gradlew clean?