numandev1 / react-native-keys

🔐 Protected .ENVs variables in React Native 🚀✨
MIT License
313 stars 27 forks source link

2 files found with path 'META-INF/com.android.tools/proguard/coroutines.pro' #77

Open jonathanm-tkf opened 5 months ago

jonathanm-tkf commented 5 months ago

Current behavior

Hi guys I have a litter problem with the library, when I try to compile I have this error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-keys:mergeDebugAndroidTestJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'META-INF/com.android.tools/proguard/coroutines.pro' from inputs:
      - /Users/j{user-name}/.gradle/caches/transforms-3/b207d690a4debb38ef8061a3ea8c4b4a/transformed/jetified-kotlinx-coroutines-core-jvm-1.6.1.jar
      - /Users/{user-name}/.gradle/caches/transforms-3/017a23198fed8b7afa4e7f3e58e24b6f/transformed/jetified-kotlinx-coroutines-android-1.6.1.jar
     Adding a packagingOptions block may help, please refer to
     https://developer.android.com/reference/tools/gradle-api/8.1/com/android/build/api/dsl/ResourcesPackagingOptions
     for more information

Could you help me please, thanks

Expected behavior

Platform

React Native Version

0.73.6

github-actions[bot] commented 5 months ago

👋 @jonathanm-tkf Thanks for opening your issue here! If you find this package useful hit the star🌟!

deepakv-z14 commented 2 months ago

facing similar issue. @numandev1 any idea how to fix this?

renatop7 commented 1 month ago

@jonathanm-tkf @deepakv-z14 This is how I fixed:

Line 154 of node_modules/react-native-keys/android/build.gradle:

  packagingOptions {
    excludes = [
      "**/libc++_shared.so",
      "**/libfbjni.so",
      "**/libreactnativejni.so",
      "**/libjsi.so",
      "**/libreact_nativemodule_core.so",
      "**/libturbomodulejsijni.so",
      "**/MANIFEST.MF",
      "META-INF/com.android.tools/proguard/coroutines.pro", //<--- Add this 
      "META-INF/proguard/coroutines.pro", //<--- Add this 
      ""
    ]
    doNotStrip '**/*.so'
  }

Run gradle clean and rebuild the project.

Maybe @numandev1 has a better way to fix this but in the meantime I'm using this fix with a patch-package patch