Skip to content
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

2 files found with path 'lib/arm64-v8a/libc++_shared.so #3311

Open
atifaziz1 opened this issue Dec 30, 2024 · 9 comments
Open

2 files found with path 'lib/arm64-v8a/libc++_shared.so #3311

atifaziz1 opened this issue Dec 30, 2024 · 9 comments
Assignees
Labels
Missing info Missing repro Platform: Android This issue is specific to Android

Comments

@atifaziz1
Copy link

Description

I install react-native-gesture handler for my project 0.76.4. I am getting below error.

`2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:

  • /Users/userName/Documents/sme/smeApp/node_modules/react-native-gesture-handler/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libc++_shared.so

  • /Users/userName/.gradle/caches/8.10.2/transforms/e909c4aa1d8360d422ffdf1faa726e0b/transformed/jetified-react-android-0.76.4-debug/jni/arm64-v8a/libc++_shared.so`

Steps to reproduce

npm i react-native-gesture-handler

Snack or a link to a repository

..

Gesture Handler version

2.21.2

React Native version

0.73.5

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

Oppo

Acknowledgements

Yes

Copy link

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?

@github-actions github-actions bot added Missing repro Platform: Android This issue is specific to Android labels Dec 30, 2024
Copy link

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.

@m-bert
Copy link
Contributor

m-bert commented Jan 7, 2025

Hi @atifaziz1! Have you tried clearing gradle caches?

@atifaziz1
Copy link
Author

HI @m-bert !

Yes i did multiple times.

@m-bert
Copy link
Contributor

m-bert commented Jan 7, 2025

Well that's strange, one of those is definitely from cache:

/Users/userName/Documents/sme/smeApp/node_modules/react-native-gesture-handler/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libc++_shared.so

/Users/userName/.gradle/caches/8.10.2/transforms/e909c4aa1d8360d422ffdf1faa726e0b/transformed/jetified-react-android-0.76.4-debug/jni/arm64-v8a/libc++_shared.so`

After cleaning caches, have you performed clean build?

@m-bert m-bert self-assigned this Jan 7, 2025
@atifaziz1
Copy link
Author

Dear @m-bert Yes, I did multiple times.

  1. delete node_modules
  2. delete npm cache
  3. delete android/app/build and android/app/.cxx folder
  4. Invalidate cache and restart from android studio
  5. rebuild the project and getting same error.

@m-bert
Copy link
Contributor

m-bert commented Jan 7, 2025

Correct me if I'm wrong, but there is no step in which you clear gradle cache.

Anyway, adding pickFirst into your build.gradle should help (like here)

packagingOptions {
...
+  pickFirst 'lib/arm64-v8a/libc++_shared.so'
}

@m-bert
Copy link
Contributor

m-bert commented Jan 8, 2025

Hi @atifaziz1! Have you been able to check if adding packagingOptions helps?

@m-bert m-bert added the Close when stale The issue will be closed automatically if it remains inactive label Jan 9, 2025
@Nordsword3m
Copy link

Hi, I'm currently experiencing this problem on [email protected], [email protected], [email protected]

I'm currently trying to set up detox for e2e testing, and am running into the error when running ./gradlew assembleAndroidTest (note ./gradlew assembleDebug does work)

Execution failed for task ':react-native-gesture-handler:mergeDebugAndroidTestNativeLibs'.  
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:
      - C:\Users\kiera\Desktop\redenbot\node_modules\react-native-gesture-handler\android\build\intermediates\library_jni\debug\copyDebugJniLibsProjectOnly\jni\arm64-v8a\libc++_shared.so
      - C:\Users\kiera\.gradle\caches\8.10.2\transforms\8ab812ce1f3114aaddddfebd3794d6a8\transformed\jetified-react-android-0.76.3-debug\jni\arm64-v8a\libc++_shared.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

I have tried:

  • Deleting C:\Users\kiera\.gradle\caches to clear the cache
  • Adding the following to android\app\build.gradle
android {
+   packagingOptions {
+      pickFirst 'lib/x86/libc++_shared.so'
+      pickFirst 'lib/x86_64/libc++_shared.so'
+      pickFirst 'lib/armeabi-v7a/libc++_shared.so'
+      pickFirst 'lib/arm64-v8a/libc++_shared.so'
    }
...
}
  • Adding the following to android\app\build.gradle
+ sourceSets.main {
+       jniLibs.srcDir 'libs'
+       jni.srcDirs = []
+  }

@github-actions github-actions bot removed the Close when stale The issue will be closed automatically if it remains inactive label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing info Missing repro Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

3 participants