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

reanimated 2.9.0 build issue on android #3342

Closed
2 tasks
mlecoq opened this issue Jun 30, 2022 · 17 comments
Closed
2 tasks

reanimated 2.9.0 build issue on android #3342

mlecoq opened this issue Jun 30, 2022 · 17 comments
Assignees
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@mlecoq
Copy link

mlecoq commented Jun 30, 2022

Description

I was using 3.0.0-rc.0 for rn 0.69 support and I have downgraded to 2.9.0

Expected behavior

successful build

Actual behavior & steps to reproduce

* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/libfolly_runtime.so' from inputs:
      - /Users/mlecoq/Developer/archireport/archireport-mobile/node_modules/react-native-reanimated/android/build/.transforms/c3cd520d4a2b5d5d580950f0336053f0/transformed/jetified-react-native-reanimated-69-hermes/jni/arm64-v8a/libfolly_runtime.so
      - /Users/mlecoq/.gradle/caches/transforms-3/c419917c6a2d843f216f918bd1f984b5/transformed/jetified-react-native-0.69.1-debug/jni/arm64-v8a/libfolly_runtime.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

I have tried to clean (gradlew clean) and to reinstall my dependencies without any success

putting back 3.0.0-rc.0 solves the issue

Snack or minimal code example

https://github.com/mlecoq/reanimated290

Package versions

name version
react-native 0.69.1
react-native-reanimated 2.9.0
NodeJS 16.13.1
Xcode
Java 11.0.13
Gradle
expo

Affected platforms

  • [v ] Android
  • iOS
  • Web
@mlecoq mlecoq added the Needs review Issue is ready to be reviewed by a maintainer label Jun 30, 2022
@github-actions github-actions bot added Platform: Android This issue is specific to Android Missing repro This issue need minimum repro scenario labels Jun 30, 2022
@mlecoq
Copy link
Author

mlecoq commented Jun 30, 2022

small example here : https://github.com/mlecoq/reanimated290

@github-actions github-actions bot added Repro provided A reproduction with a snippet of code, snack or repo is provided and removed Missing repro This issue need minimum repro scenario labels Jun 30, 2022
@souna23
Copy link

souna23 commented Jun 30, 2022

same issue, any solution ?

@CHANDRAMOHANnegi
Copy link

CHANDRAMOHANnegi commented Jun 30, 2022

"react-native": "0.69.1"
"react": "18.2.0"
"react-native-reanimated": "^2.9.0"

reanimated

@dopplerDistortion
Copy link

dopplerDistortion commented Jun 30, 2022

for now adding pickFirst to app/build.gradle should resolve the issue. like so

 android{
    /**
     *your existing code
     */
    packagingOptions {
        /**
         *your existing code
         */
        pickFirst '**/armeabi-v7a/libfolly_runtime.so'
        pickFirst '**/x86/libfolly_runtime.so'
        pickFirst '**/arm64-v8a/libfolly_runtime.so'
        pickFirst '**/x86_64/libfolly_runtime.so'
    }
  }

@piaskowyk
Copy link
Member

The temporary solution for this issue is to add pickFirst option as @dopplerDistortion did. I have already fixed it, tomorrow I will prepare a patch release.

@piaskowyk piaskowyk self-assigned this Jun 30, 2022
@OPITOs
Copy link

OPITOs commented Jul 1, 2022

The temporary solution for this issue is to add pickFirst option as @dopplerDistortion did. I have already fixed it, tomorrow I will prepare a patch release.

adding that doesn't help
ok, react-native-reanimated 2.9.1 works

@dopplerDistortion
Copy link

The temporary solution for this issue is to add pickFirst option as @dopplerDistortion did. I have already fixed it, tomorrow I will prepare a patch release.

adding that doesn't help

make sure to provide a reproducible scenario so @piaskowyk can identify if there is another issue

@piaskowyk
Copy link
Member

I have just published 2.9.1 with the fix for duplicated libfolly_runtime.so

@mlecoq mlecoq closed this as completed Jul 1, 2022
@MuhammadAhmedHassan
Copy link

I'm trying to build an application to upload to the play store using the following cmd:

./gradlew bundleRelease

The error that I'm getting is:

* What went wrong: Execution failed for task ':react-native-reanimated:buildCMakeRelWithDebInfo[arm64-v8a]'. ←[33m> ←[39mBuild command failed. Error while executing process C:\Users\DELL\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe with arguments {-C C:\Users\DELL\Downloads\local_disk\react-native-projects\AwesomeProject\node_modules\react-native-reanimated\android\.cxx\RelWithDebInfo\1l5s344w\arm64-v8a reanimated} ninja: Entering directory C:\Users\DELL\Downloads\local_disk\react-native-projects\AwesomeProject\node_modules\react-native-reanimated\android.cxx\RelWithDebInfo\1l5s344w\arm64-v8a'
[0/2] Re-checking globbed directories...
ninja: build stopped: .

ninja: error: mkdir(CMakeFiles/reanimated.dir/C_/Users/DELL/Downloads/local_disk/react-native-projects/AwesomeProject): No such file or directory

  • Try:
    ←[33m> ←[39mRun with ←[1m--stacktrace←[m option to get the stack trace.
    ←[33m> ←[39mRun with ←[1m--info←[m or ←[1m--debug←[m option to get more log output.
    ←[33m> ←[39mRun with ←[1m--scan←[m to get full insights.`

Things that I've tried are:

`./gradlew clean
./gradlew --stop

/** Pasted in android/app/build.gradle in the android section /
packagingOptions {
/
*
*your existing code
*/
pickFirst '/armeabi-v7a/libfolly_runtime.so'
pickFirst '
/x86/libfolly_runtime.so'
pickFirst '/arm64-v8a/libfolly_runtime.so'
pickFirst '
/x86_64/libfolly_runtime.so'
}
`
I'm able to run the project on an emulator, and local device and able to build it for assembleRelease.

I'm using:
"react-native-reanimated": "^2.10.0",
"react-native": "0.69.3",

@mikesz88
Copy link

mikesz88 commented Sep 9, 2022

I am having the same issue as @MuhammadAhmedHassan
Please help!

@MuhammadAhmedHassan
Copy link

@mlecoq sorry, I couldn't find any solution by now.
I think the problem is, we are giving wrong path to mkdir function:
ninja: error: mkdir(CMakeFiles/reanimated.dir/C_/Users/DELL/Downloads/local_disk/react-native-projects/AwesomeProject): No such file or directory
C_/User... is a wrong path.
Maybe @piaskowyk could help us.
I've tested it own Ubuntu and it's working fine, I think problem is only on windows.

@loyalty-thameem
Copy link

Task :react-native-reanimated:configureCMakeDebug[arm64-v8a] FAILED

Task failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-reanimated:configureCMakeDebug[arm64-v8a]'.

[CXX1405] error when building with cmake using D:\Practice\GmmcoProject\node_modules\react-native-reanimated\android\CMakeLists.txt: Build command failed.
Error while executing process C:\Users\CIPL1279\AppData\Local\Android\Sdk\cmake\3.18.1\bin\cmake.exe with arguments {-HD:\Practice\GmmcoProject\node_modules\react-native-reanimated\android -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=21 -DANDROID_PLATFORM=android-21 -DANDROID_ABI=arm64-v8a -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_NDK=C:\Users\CIPL1279\AppData\Local\Android\Sdk\ndk\21.4.7075529 -DCMAKE_ANDROID_NDK=C:\Users\CIPL1279\AppData\Local\Android\Sdk\ndk\21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=C:\Users\CIPL1279\AppData\Local\Android\Sdk\ndk\21.4.7075529\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\CIPL1279\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe -DCMAKE_CXX_FLAGS=-fstack-protector-all -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\Practice\GmmcoProject\node_modules\react-native-reanimated\android\build\intermediates\cxx\Debug\695xx5w3\obj\arm64-v8a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\Practice\GmmcoProject\node_modules\react-native-reanimated\android\build\intermediates\cxx\Debug\695xx5w3\obj\arm64-v8a -DCMAKE_BUILD_TYPE=Debug -BD:\Practice\GmmcoProject\node_modules\react-native-reanimated\android.cxx\Debug\695xx5w3\arm64-v8a -GNinja -DANDROID_STL=c++_shared -DNATIVE_DEBUG=false -DREACT_NATIVE_TARGET_VERSION=70 -DANDROID_TOOLCHAIN=clang -DBOOST_VERSION=1_76_0 -DNODE_MODULES_DIR=D:\Practice\GmmcoProject\node_modules -DJS_RUNTIME=hermes -DJS_RUNTIME_DIR=D:\Practice\GmmcoProject\node_modules\react-native\sdks\hermes -DCLIENT_SIDE_BUILD=true -DIS_NEW_ARCHITECTURE_ENABLED=false -DPLAYGROUND_APP_NAME=D:\Practice\GmmcoProject\android\app -DRNVERSION=70}
@dopplerDistortion

@loyalty-thameem
Copy link

I fixed the above issue. please try reinstall reanimated version.

1.npm uninstall react-native-reanimated
2.npm install react-native-reanimated@2.9.1

it's 100% working for me.

@mklb
Copy link

mklb commented Nov 5, 2022

Works

packagingOptions {
    pickFirst '**/libc++_shared.so'
    pickFirst '**/libfbjni.so'
}

@JamesGs1994
Copy link

2.9.1 version crashing my app after build

@danmesfin
Copy link


@JamesGs1994 did you find any solution ?

@super622
Copy link

I was using expo 48 and updated to the latest version (50.0.2).
Previously, the "react-native-reanimated" module worked well, but after updating the expo version, it no longer works.
Currently, I using "react-native-reanimated": "^3.6.1"

 WARN  new NativeEventEmitter() was called with a non-null argument without the required addListener method.
 WARN  new NativeEventEmitter() was called with a non-null argument without the required removeListeners method.
 WARN  [Reanimated] Couldn't determine the version of the native part of Reanimated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests