Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AsyncStoragePackage is defined multiple times

What went wrong:

Execution failed for task ':app:multiDexListDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Error while merging dex archives:
     Type com.reactnativecommunity.asyncstorage.AsyncStoragePackage is defined multiple times: C:\Users\JesusGuillermoCiscom\Documents\a\exitusforce\android\app\build\intermediates\transforms\dynatraceTransformer\debug\101.jar:com/reactnativecommunity/asyncstorage/AsyncStoragePackage.class, C:\Users\JesusGuillermoCiscom\Documents\a\exitusforce\android\app\build\intermediates\transforms\dynatraceTransformer\debug\106.jar:com/reactnativecommunity/asyncstorage/AsyncStoragePackage.class
     Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

This happened after I installed this package.

It seems that dynatrace duplicates the async storage dependency and I don't know how to fix this.

I already deleted the node_module, cd/android gradlewclean and tried to rebuild the project.

like image 526
user10625391 Avatar asked Feb 20 '26 15:02

user10625391


1 Answers

The issue in my case was a definition of 2 packages in my package.json:

  • @react-native-community/async-storage (Deprecated)
  • react-native-async-storage/async-storage

Once I remove the deprecated one issue resolved.
Note that if you are using Yarn Workspaces that you might have the deprecated package in one of your workspaces.

like image 185
chenop Avatar answered Feb 23 '26 06:02

chenop