Closed DigohD closed 1 year ago
Hi @DigohD. I couldn't reproduce the error you mentioned - my android build works just fine on cloning the repo you provided.
Although looking at this:
Task :react-native-reanimated:configureCMakeDebug[arm64-v8a] FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-reanimated:configureCMakeDebug[arm64-v8a]'.
> Picked up _JAVA_OPTIONS: -Xmx2048M
I think this might be architecture related. Do you have Rosetta installed on your machine?
Hi! Thanks for the quick answer.
Pardon me, I forgot mentioning that I am working on a windows 11 machine. My colleague who also uses a PC encounter the same error when testing the repo I linked.
Edit: I will try on my home PC as well later tonight
can you try with ndk 24.0.8215888
?
@DigohD I'm no expert in these things but we have a CI that uses windows-latest
GitHub virtual machine. Maybe take a look at its config, especially that NDK @efstathiosntonas mentioned and see if there are any key differences compared to your machine.
Encountered a similar issue here: https://github.com/react-native-community/react-native-circleci-orb/issues/171
With some (ndk? sdk?) versions, the Picked up _JAVA_OPTIONS
output causes a failure. Removing _JAVA_OPTIONS
from the environment will fix it.
I reset my PC and reinstalled everything and now it works. I tried re-adding the _JAVA_OPTIONS variable just to check if that could be the issue I had before, and it indeed causes the error to come back.
I did not try ndk 24.0.8215888, but tried ndk 25 yesterday which did not solve the issue.
Thank you all for helping me out.
Encountered a similar issue here: https://github.com/react-native-community/react-native-circleci-orb/issues/171 With some (ndk? sdk?) versions, the Picked up _JAVA_OPTIONS output causes a failure. Removing _JAVA_OPTIONS from the environment will fix it.
Remove _JAVA_OPTIONS
in cimg/android on circleci and it works now
Thank you
This worked for me (Windows 10 | react-native 0.72.5 | react-native-reanimated 3.5.4)
cd android
./gradlew clean
cd ..
npm start -- --reset-cache
Check your JDK versions, in my case, I had JDK 11.0.18, and a simple update to version 11.0.20
solved all the problems. Don't forget to run yarn start --reset-cache
before you try to build.
I do not have JDK, only JRE. And I don't see what's wrong with what I said. I also suggested to clean the cache and run again, and I said that's what worked for me so it's worth a try. Never said it will solve everyone's problems.
Any updates here?
I've got the same error after trying to update one lib using reanimated, but after remove any change (come back to a previous version on my git project), I can not remove this error
can you try with ndk
24.0.8215888
?
<= This fix my project build after a 10 min gradlew clean. I don't understand why, but this works. Thank's :)
I've got the same error after trying to update one lib using reanimated, but after remove any change (come back to a previous version on my git project), I can not remove this error
can you try with ndk
24.0.8215888
?<= This fix my project build after a 10 min gradlew clean. I don't understand why, but this works. Thank's :)
And what is your react-native or reanimated or cmake version ?
It's funny and absurd, but the issue is due to the project path being too long. I recommend copying or moving your project to c:\ or desktop. Delete the node_modules folder, run npm i, cd android & ./gradlew clean, and then build.
It's funny and absurd, but the issue is due to the project path being too long. I recommend copying or moving your project to c:\ or desktop. Delete the node_modules folder, run npm i, cd android & ./gradlew clean, and then build.
moving the project to a folder with a shorter path solved my problem. Yes it is funny and absurd but also very frustrating. I wasted a lot time to solve this issue.
installing the latest version of react-native-reanimated
npm i react-native-reanimated@latest
and then clearing the metro cache
npm start -- --reset-cache
fixed it for me
It's funny and absurd, but the issue is due to the project path being too long. I recommend copying or moving your project to c:\ or desktop. Delete the node_modules folder, run npm i, cd android & ./gradlew clean, and then build.
@GaboRocker1992 Hi, guy, you're just my super rock star and save my day! It costs me the whole day to fix this one! Who's gonna believe the root cause is a project folder with a long name?
It's funny and absurd, but the issue is due to the project path being too long. I recommend copying or moving your project to c:\ or desktop. Delete the node_modules folder, run npm i, cd android & ./gradlew clean, and then build.
This one is AMAAAAAZING!! Thanks a lot!
Resolved by following steps
newArchEnabled=false
1. Enable Bridgeless flag in native
Android
In your MainApplication.kt file, update the onCreate function by passing the bridglessEnabled = true
flag to the load invocation.
// MyMainApplication.kt
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
override fun onCreate() {
...
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// Set bridgelessEnabled to true here to enable Bridgeless, it's false by default
- load()
+ load(bridgelessEnabled = true)
}
...
}
iOS
To enable Bridgeless for your React Native app, you need to override function bridgelessEnabled in app’s AppDelegate.mm:
// AppDelegate.mm
- (BOOL)bridgelessEnabled
{
return YES;
}
2. Enable New Architectures
Open gradle.properties file
newArchEnabled=true
FINALLY, Complete the configuration for Enable Bridgeless Mode.
try to install cmake with help of brew and update the rosseta. this thing worked for me
It's funny and absurd, but the issue is due to the project path being too long. I recommend copying or moving your project to c:\ or desktop. Delete the node_modules folder, run npm i, cd android & ./gradlew clean, and then build.
Haaaa, funny but true
What worked for me is running cd android and ./gradleW assembleDebug --stacktrace. This gave me the error stack trace which showed an IllegalStateException the cause of which was the JAVA_TOOL_OPTIONS env variable. So I unset it. After that an issue appeared about CMakeLists - this was caused by having env var _JAVA_OPTIONS set. Unset this well and it builds successfully!
Thank you everyone for figuring this out! Indeed unsetting JAVA_TOOL_OPTIONS
worked for us.
Question: does it make sense to reopen this issue, since AFAICT there is only a workaround, but the underlying issue seems to still exist :thinking:
Most of the time you install react-native-reanimated
for react-native-gesture-handler
.
My solution is to go to node_modules/react-native-gesture-handler/package.json
and install the same version that is installed in this package. in my case, that was "^2.3.1".
It's funny and absurd, but the issue is due to the project path being too long. I recommend copying or moving your project to c:\ or desktop. Delete the node_modules folder, run npm i, cd android & ./gradlew clean, and then build.
This worked for me too. Thank you so much @GaboRocker1992 .
Resolved by following steps
- Remove build and .cxx folder in the android/app/ directory.
- Run the command in terminal :
- cd android && ./gradlew clean
- Open gradle.properties files
newArchEnabled=false
- Run the project :
- cd .. && npm start -- --reset-cache
- npm run android
This worked for me. Not exactly related to native-reanimate, but same error on other library.
installing the latest version of react-native-reanimated
npm i react-native-reanimated@latest
and then clearing the metro cachenpm start -- --reset-cache
fixed it for me
PROBLEM WAS IN THE NDK VERSION I WAS USING LATEST 27 BUT NOW USED 25
I encountered an error while updating my React Native project from version 0.72.x to 0.74.3. The project configuration includes:
React Native: 0.74.3
React Native Reanimated: ^3.14.0
Gradle: Updated from 7.5 to 8.7
Build Tool: Fastlane
CI Environment: CircleCI
Docker Image: cimg/android:2023.08.1-node
Problem
The project works fine on my local machine in development mode, and I can generate builds using Fastlane on my machine without any issues. However, when running the build job on CircleCI using
bundle exec fastlane staging
I encounter the following error:
> Task :react-native-reanimated:configureCMakeRelWithDebInfo[arm64-v8a] FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-reanimated:configureCMakeRelWithDebInfo[arm64-v8a]'.
> [CXX1416] Could not find Ninja on PATH or in SDK CMake bin folders.
Has anyone encountered a similar issue or found a solution for this? Any steps or suggestions to fix this would be greatly appreciated. Thank you!
run react-native with sudo
On Fri, 26 Jul 2024 at 4:44 PM, Asad-wego @.***> wrote:
I encountered an error while updating my React Native project from version 0.72.x to 0.74.3. The project configuration includes:
React Native: 0.74.3 React Native Reanimated: ^3.14.0 Gradle: Updated from 7.5 to 8.7 Build Tool: Fastlane CI Environment: CircleCI Docker Image: cimg/android:2023.08.1-node Problem The project works fine on my local machine in development mode, and I can generate builds using Fastlane on my machine without any issues. However, when running the build job on CircleCI using bundle exec fastlane staging I encounter the following error:
Task :react-native-reanimated:configureCMakeRelWithDebInfo[arm64-v8a] FAILED
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':react-native-reanimated:configureCMakeRelWithDebInfo[arm64-v8a]'.
[CXX1416] Could not find Ninja on PATH or in SDK CMake bin folders.
Has anyone encountered a similar issue or found a solution for this? Any steps or suggestions to fix this would be greatly appreciated. Thank you!
— Reply to this email directly, view it on GitHub https://github.com/software-mansion/react-native-reanimated/issues/4712#issuecomment-2252587132, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH27UKHH4NG2FSAJ4YHMFITZOIZC5AVCNFSM6AAAAAA2GDY2G6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJSGU4DOMJTGI . You are receiving this because you commented.Message ID: @.*** com>
Can confirm unsetting _JAVA_OPTIONS fixes build issue. Surprising this is still an issue!
Task :react-native-reanimated:configureCMakeRelWithDebInfo[arm64-v8a] FAILED
FAILURE: Build failed with an exception.
[CXX1416] Could not find Ninja on PATH or in SDK CMake bin folders.
same issue i am facing please help to resolve
same error.
Task :react-native-reanimated:configureCMakeDebug[arm64-v8a] FAILED 65 actionable tasks: 10 executed, 55 up-to-date
info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor
Warning: SDK processing. This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times. Note: C:\AwesomeProject\node_modules\react-native-gesture-handler\android\paper\src\main\java\com\swmansion\gesturehandler\NativeRNGestureHandlerModuleSpec.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.
I am having the same issue with some other library,
Execution failed for task ':react-native-fast-openpgp:configureCMakeDebug[arm64-v8a]'.
[CXX1410] ..../node_modules/react-native-fast-openpgp/android/.cxx/Debug/5v282i3v/arm64-v8a/android_gradle_build.json debug|arm64-v8a : expected buildTargetsCommandComponents command 'ninja' to exist
Execution failed for task ':react-native-reanimated:buildCMakeRelWithDebInfo[armeabi-v7a]'. getting same issue today Any Luck?
I encountered an error while updating my React Native project from version 0.72.x to 0.74.3. The project configuration includes:
React Native: 0.74.3 React Native Reanimated: ^3.14.0 Gradle: Updated from 7.5 to 8.7 Build Tool: Fastlane CI Environment: CircleCI Docker Image: cimg/android:2023.08.1-node Problem The project works fine on my local machine in development mode, and I can generate builds using Fastlane on my machine without any issues. However, when running the build job on CircleCI using
bundle exec fastlane staging
I encounter the following error:> Task :react-native-reanimated:configureCMakeRelWithDebInfo[arm64-v8a] FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-reanimated:configureCMakeRelWithDebInfo[arm64-v8a]'. > [CXX1416] Could not find Ninja on PATH or in SDK CMake bin folders.
Has anyone encountered a similar issue or found a solution for this? Any steps or suggestions to fix this would be greatly appreciated. Thank you!
Have you get any solution?
Execution failed for task ':react-native-reanimated:buildCMakeRelWithDebInfo[armeabi-v7a]'. getting same issue today Any Luck?
Get resolved after doing the below steps
Work like a charm!!! Happy Coding!
If you want to have the "new architecture" and "bridgeless" mode enabled, I resolved this by updating to "react-native:0.75.1" and "react-native-reanimated:3.15.0"
I used this as a reference: https://github.com/software-mansion/react-native-reanimated/tree/main/apps/fabric-example
Description
We recently upgraded to latest React-Native (0.72.2) and upgraded Reanimated to 3.3.0. After this upgrade, we get the following error when running assembleDebug for Android:
After failing to find a solution to the issue I created a brand new react native project with react-native-reanimated and tried building it for Android:
Also added to babel config.:
The same error occurs in the brand new project.
npx react-native run-android fails with the same error as assembleDebug.
Reanimated builds and runs as expected on iOS devices using Xcode.
Steps to reproduce
Snack or a link to a repository
https://github.com/DigohD/Reanimated-build-error-cmake-config-issue-repo
Reanimated version
3.3.0
React Native version
0.72.2
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
None
Device model
No response
Acknowledgements
Yes