D8: Program type already present: com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil
See original GitHub issueCurrent behavior
gradlew buildRelease
don’t build my app because of an issue with async-storage
.
Expected behavior
It should build without errors.
Repro steps
I added this library on my project.
Environment
- Async Storage version: 1.8.1
- React-Native version: 0.61.5
- Platform tested: Android
- Logs/Error that are relevant: `> Task :app:transformClassesAndResourcesWithR8ForRelease FAILED R8 is the new Android code shrinker. If you experience any issues, please file a bug at https://issuetracker.google.com, using ‘Shrinker (R8)’ as component name. You can disable R8 by updating gradle.properties with ‘android.enableR8=false’. Current version is: 1.4.94 (build 390954928f0db9c3b888a367f7f128ce3bbfb160 from go/r8bot (luci-r8-ci-archive-0-5g74)).
D8: Program type already present: com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ‘:app:transformClassesAndResourcesWithR8ForRelease’.
com.android.tools.r8.CompilationFailedException: Compilation failed to complete
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (2 by maintainers)
Top Results From Across the Web
React-native android "Program type already present
This is because you have linked library by yourself just run following command: react-native unlink @react-native-community/async-storage.
Read more >[Solved]-React-native android "Program type already present
Coding example for the question React-native android "Program type already present: com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil"-React ...
Read more >Developers - Cannot take build for android - Task :app ...
... FAILED - Program type already present: com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil.
Read more >解决RN开发报错Program type already present - 程序员大本营
解决RN开发报错Program type already present: com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil,程序员大本营,技术文章内容聚合第一站。
Read more >app:assembleRelease failed, conflicting react native netinfo ...
Type com.reactnativecommunity.netinfo. ... D8.run(:11) at com.android.builder.dexing.D8DexArchiveMerger.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into the similar issue, tried all steps, didn’t work. I checked my package.json file and I figured out that i had 2 versions of react-native-async-storage, the community one and the oldest one. Just delete the old one, re-install with yarn on NPM, and it should work.
@Krizzu thank you for your reply. I solved it. At the time I installed this package at first I linked it manually, then, I unlinked it via
react-native unlink @react-native-community/async-storage
. But I found out there were still some references insettings.gradle
andbuild.gradle
, I removed them and now it works fine!