-
-
Notifications
You must be signed in to change notification settings - Fork 981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Execution failed for task ':app:mergeLibDexDebug'. RNGH conflicts with MMKV when fabric enabled #2382
Comments
Hey! 👋 It looks like you've omitted a few important sections from the issue template. Please complete Snack or a link to a repository section. |
Hey! 👋 The issue doesn't seem to contain a minimal reproduction. Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem? |
@devoren, how did you solve the issue? |
@sshestopalov after updating RN to version 0.71.1 the problem disappeared, but RNGH conflicts with react-native-MMKV |
@devoren yes, I have RNGH and react-native-mmkv in my project, that must the problem. thanks! |
Having the same conflict. |
Summary: Fixes software-mansion/react-native-gesture-handler#2382 I've just realized that the default value fo `jsRootDir` is not entirely correct. That's the root of the folder where the codegen should run. For apps, it should be defaulted to `root` (i.e. ../../) For libraries, it should be defaulted to `../` (currently is root). This causes a problem where libraries without either a `codegenConfig` or a `react{ jsRootDir = ... }` specified in the build.gradle will be invoking the codegen and generating duplicated symbols. Changelog: [Android] [Fixed] - RNGP - Properly set the `jsRootDir` default value Differential Revision: D42806411 fbshipit-source-id: 44371edec593aba5a5115d05e6f8d2e86ec6dc11
Just a heads up that this caused by an underlying bug in the codegen. It's addressed here: facebook/react-native#35992 |
Summary: Pull Request resolved: #35992 Fixes software-mansion/react-native-gesture-handler#2382 I've just realized that the default value fo `jsRootDir` is not entirely correct. That's the root of the folder where the codegen should run. For apps, it should be defaulted to `root` (i.e. ../../) For libraries, it should be defaulted to `../` (currently is root). This causes a problem where libraries without either a `codegenConfig` or a `react{ jsRootDir = ... }` specified in the build.gradle will be invoking the codegen and generating duplicated symbols. Changelog: [Android] [Fixed] - RNGP - Properly set the `jsRootDir` default value Reviewed By: cipolleschi Differential Revision: D42806411 fbshipit-source-id: ffe45f9684a22494cc2e4d0a19de9077cb341365
Summary: Pull Request resolved: #35992 Fixes software-mansion/react-native-gesture-handler#2382 I've just realized that the default value fo `jsRootDir` is not entirely correct. That's the root of the folder where the codegen should run. For apps, it should be defaulted to `root` (i.e. ../../) For libraries, it should be defaulted to `../` (currently is root). This causes a problem where libraries without either a `codegenConfig` or a `react{ jsRootDir = ... }` specified in the build.gradle will be invoking the codegen and generating duplicated symbols. Changelog: [Android] [Fixed] - RNGP - Properly set the `jsRootDir` default value Reviewed By: cipolleschi Differential Revision: D42806411 fbshipit-source-id: ffe45f9684a22494cc2e4d0a19de9077cb341365
After upgrading RN to v0.71.2 issue was resolved |
Awesome :) |
Summary: Pull Request resolved: facebook#35992 Fixes software-mansion/react-native-gesture-handler#2382 I've just realized that the default value fo `jsRootDir` is not entirely correct. That's the root of the folder where the codegen should run. For apps, it should be defaulted to `root` (i.e. ../../) For libraries, it should be defaulted to `../` (currently is root). This causes a problem where libraries without either a `codegenConfig` or a `react{ jsRootDir = ... }` specified in the build.gradle will be invoking the codegen and generating duplicated symbols. Changelog: [Android] [Fixed] - RNGP - Properly set the `jsRootDir` default value Reviewed By: cipolleschi Differential Revision: D42806411 fbshipit-source-id: ffe45f9684a22494cc2e4d0a19de9077cb341365
Description
I'm facing some difficulties in building my project with the new architecture enabled and disabled. I created new React Native app in version 0.71 and installed RN-GH. Please let me know if you are familiar with this issue and have resolved.
Build logs:
ERROR:C:\Programs...\node_modules\react-native-gesture-handler\android\build.transforms\c4565ac0bfe4bc3cd8cc31ed594058d4\transformed\classes\classes.dex: D8: Type com.facebook.react.viewmanagers.RNGestureHandlerButtonManagerDelegate is defined multiple times: C:\Programs...\node_modules\react-native-gesture-handler\android\build.transforms\c4565ac0bfe4bc3cd8cc31ed594058d4\transformed\classes\classes.dex, C:\Programs...\node_modules\react-native-mmkv\android\build.transforms\4dc488954a239fc51aa940d208820628\transformed\classes\classes.dex
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Type com.facebook.react.viewmanagers.RNGestureHandlerButtonManagerDelegate is defined multiple times: C:\Programs...\node_modules\react-native-gesture-handler\android\build.transforms\c4565ac0bfe4bc3cd8cc31ed594058d4\transformed\classes\classes.dex, C:\Programs...\node_modules\react-native-mmkv\android\build.transforms\4dc488954a239fc51aa940d208820628\transformed\classes\classes.dex
at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:151)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:138)
at com.android.build.gradle.internal.tasks.DexMergingWorkAction.merge(DexMergingTask.kt:859)
at com.android.build.gradle.internal.tasks.DexMergingWorkAction.run(DexMergingTask.kt:805)
...
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Programs...\node_modules\react-native-gesture-handler\android\build.transforms\c4565ac0bfe4bc3cd8cc31ed594058d4\transformed\classes\classes.dex
...
Caused by: com.android.tools.r8.internal.f: Type com.facebook.react.viewmanagers.RNGestureHandlerButtonManagerDelegate is defined multiple times: C:\Programs...\node_modules\react-native-gesture-handler\android\build.transforms\c4565ac0bfe4bc3cd8cc31ed594058d4\transformed\classes\classes.dex, C:\Programs\rn\SM\node_modules\react-native-mmkv\android\build.transforms\4dc488954a239fc51aa940d208820628\transformed\classes\classes.dex
...
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Execution failed for task ':app:mergeLibDexDebug'.
2: Task failed with an exception.
What went wrong:
java.lang.StackOverflowError (no error message)
Try:
BUILD FAILED in 1m 8s
Steps to reproduce
Snack or a link to a repository
NA
Gesture Handler version
2.9.0
React Native version
0.71.0
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
Android emulator
Device model
Pixel 4 API 31
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: