build rn 0.70.5 with new Architecture on M1
Description
i got this error when add this flag newArchEnabled=true
to gradle.properties.
CMake Error in CMakeLists.txt:
Imported target "folly_runtime" includes non-existent path
Version
0.70.5
Output of npx react-native info
System: OS: macOS 12.6 CPU: (10) arm64 Apple M1 Pro Memory: 101.59 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.11.0 - /opt/homebrew/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 8.19.2 - /opt/homebrew/bin/npm Watchman: 2022.10.31.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/Hamid/.gem/ruby/2.7.5/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.1/14B47b - /usr/bin/xcodebuild Languages: Java: 11.0.17 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.4 => 0.70.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Enable new architecture on android. when I try to build via android studio project I get the above error. When I try yarn android, it builds properly.
Snack, code example, screenshot, or link to a repository
https://github.com/sssajjad007/react-native-0.70.5-template
i got this error too ...
+1
my os is windows 10 and it doesn't seem to matter
CMake Error in CMakeLists.txt: Imported target "folly_runtime" includes non-existent path
Can you share your whole build log?
CMake Error in CMakeLists.txt: Imported target "folly_runtime" includes non-existent path
Can you share your whole build log?
This is what I see in Android Studio:

[CXX1405] error when building with cmake using /Users/delino/Delino/rn70/android/app/src/main/jni/CMakeLists.txt: Build command failed.
Error while executing process /Users/delino/Library/Android/sdk/cmake/3.18.1/bin/cmake with arguments {-H/Users/delino/Delino/rn70/android/app/src/main/jni -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=21 -DANDROID_PLATFORM=android-21 -DANDROID_ABI=x86 -DCMAKE_ANDROID_ARCH_ABI=x86 -DANDROID_NDK=/Users/delino/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_ANDROID_NDK=/Users/delino/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=/Users/delino/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=/Users/delino/Library/Android/sdk/cmake/3.18.1/bin/ninja -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/delino/Delino/rn70/android/app/build/intermediates/cxx/Debug/563t1e2m/obj/x86 -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/Users/delino/Delino/rn70/android/app/build/intermediates/cxx/Debug/563t1e2m/obj/x86 -DCMAKE_BUILD_TYPE=Debug -B/Users/delino/Delino/rn70/android/app/.cxx/Debug/563t1e2m/x86 -GNinja -DPROJECT_BUILD_DIR=/Users/delino/Delino/rn70/android/app/build -DREACT_ANDROID_DIR=/Users/delino/Delino/rn70/android/../node_modules/react-native/ReactAndroid -DREACT_ANDROID_BUILD_DIR=/Users/delino/Delino/rn70/android/../node_modules/react-native/ReactAndroid/build -DNODE_MODULES_DIR=/Users/delino/Delino/rn70/android/../node_modules -DANDROID_STL=c++_shared}
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/delino/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/delino/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Error in CMakeLists.txt:
Imported target "folly_runtime" includes non-existent path
"/Users/delino/Delino/rn70/android/../node_modules/react-native/ReactAndroid/build/third-party-ndk/boost/boost_1_76_0"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
CMake Warning:
Manually-specified variables were not used by the project:
NODE_MODULES_DIR
CMake Generate step failed. Build files cannot be regenerated correctly.
Affected Modules: ReactAndroid, hermes-engine, app
@cortinico
@sssajjad007 @hamidrahimi Could you try on 0.71.0-rc2 as the issue should be solved there
@sssajjad007 @hamidrahimi Could you try on
0.71.0-rc2as the issue should be solved there
hi. I got this error when building on Windows. I will try on M1 later & I'll let you know
info Starting JS server...
* daemon not running; starting now at tcp:5037
* daemon started successfully
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
5 actionable tasks: 5 executed
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Illegal character in authority at index 7: file://C:\Users\Acer\Documents\RN0710RC2\node_modules\react-native/android
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Illegal character in authority at index 7: file://C:\Users\Acer\Documents\RN0710RC2\node_modules\react-native/android
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
at makeError (C:\Users\Acer\Documents\RN0710RC2\node_modules\execa\index.js:174:9)
at C:\Users\Acer\Documents\RN0710RC2\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\Acer\Documents\RN0710RC2\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\Acer\Documents\RN0710RC2\node_modules\@react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.
Illegal character in authority at index
Interesting, that's a duplicate of https://github.com/facebook/react-native/issues/35472 We definitely need to fix this before we release 0.71.0
Thank you very much for testing it 🙏
@cortinico I tested everything on a Macbook M1 Pro with newArchEnabled, and everything worked without a hitch 🙏
@cortinico everything work fine in M1 and iMac ( Intel ), android & iOS with newArchEnabled = true, thanks a lot :v:
Illegal character in authority at index
Interesting, that's a duplicate of #35472 We definitely need to fix this before we release 0.71.0
Thank you very much for testing it 🙏
Hi, I made a new project with version 0.71.0-rc.3 & newArchEnabled and it works without any problems on Windows.
Great, closing this then 👍
I have Cmake error on RN 0.70.5 and gradle plugin 7.2.1 Try change to gradle plugin to 7.3.1 and find new error "Could not create task ':ReactAndroid:compileDebugKotlin'"