You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting the following build error when running yarn example android
Steps to reproduce
Run npx create-react-native-library@latest awesome-lib
Go through the wizard with the selected options
Run cd awesome-lib
Run yarn
enable newArc in example/android/gradle.properties (newArchEnabled=true)
Run yarn prepack
Run yarn example android
i have tried uninstall ndk,cmake then reinstall it but nothing worked!!
Although no errors when not using newArc i.e. (newArchEnabled=false)
error is related to cmake!!
Gradle log
yarn run v1.22.19
$ yarn --cwd example android
$ react-native run-android
info Starting JS server...
warn Failed to automatically start the packager server. Please run "react-native start" manually. Error details: Command failed with exit code 1: sh /home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/.bin/launchPackager.command
/home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/.bin/.packager.env: line 2: export: libraries/awesome-library/example': not a valid identifier
/home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/.bin/.packager.env: line 3: export: `libraries/awesome-library/example/node_modules/react-native': not a valid identifier
/home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/.bin/launchPackager.command: line 4: cd: /home/adarsh/react-native-projects/react: No such file or directory
/home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/.bin/launchPackager.command: line 5: /home/adarsh/react-native-projects/react/cli.js: No such file or directory
Process terminated. Press <enter> to close the window
info Installing the app...
> Task :app:configureCMakeDebug[arm64-v8a] FAILED
C/C++: CMake Error at /home/adarsh/react-native-projects/react native libraries/awesome-library/example/android/app/build/generated/rncli/src/main/jni/Android-rncli.cmake:6 (add_subdirectory):
C/C++: add_subdirectory called with incorrect number of arguments
C/C++: Call Stack (most recent call first):
C/C++: /home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:121 (include)
C/C++: CMakeLists.txt:31 (include)
C/C++: CMake Error at /home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:124 (target_link_libraries):
C/C++: Cannot specify link libraries for target
C/C++: "react_codegen_RNAwesomeLibrarySpec" which is not built by this project.
C/C++: Call Stack (most recent call first):
C/C++: CMakeLists.txt:31 (include)
48 actionable tasks: 6 executed, 42 up-to-date
info 💡 Tip: Make sure that you have set up your development environment correctly, by running 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
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:configureCMakeDebug[arm64-v8a]'.
> [CXX1429] error when building with cmake using /home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/CMakeLists.txt: -- The C compiler identification is Clang 12.0.8
-- The CXX compiler identification is Clang 12.0.8
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/adarsh/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-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: /home/adarsh/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!
See also "/home/adarsh/react-native-projects/react native libraries/awesome-library/example/android/app/.cxx/Debug/5e5j28i3/arm64-v8a/CMakeFiles/CMakeOutput.log".
C++ build system [configure] failed while executing:
/home/adarsh/Android/Sdk/cmake/3.22.1/bin/cmake \
"-H/home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup" \
-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=/home/adarsh/Android/Sdk/ndk/23.1.7779620 \
-DCMAKE_ANDROID_NDK=/home/adarsh/Android/Sdk/ndk/23.1.7779620 \
-DCMAKE_TOOLCHAIN_FILE=/home/adarsh/Android/Sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake \
-DCMAKE_MAKE_PROGRAM=/home/adarsh/Android/Sdk/cmake/3.22.1/bin/ninja \
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/adarsh/react-native-projects/react native libraries/awesome-library/example/android/app/build/intermediates/cxx/Debug/5e5j28i3/obj/arm64-v8a" \
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/home/adarsh/react-native-projects/react native libraries/awesome-library/example/android/app/build/intermediates/cxx/Debug/5e5j28i3/obj/arm64-v8a" \
-DCMAKE_BUILD_TYPE=Debug \
"-DCMAKE_FIND_ROOT_PATH=/home/adarsh/react-native-projects/react native libraries/awesome-library/example/android/app/.cxx/Debug/5e5j28i3/prefab/arm64-v8a/prefab" \
"-B/home/adarsh/react-native-projects/react native libraries/awesome-library/example/android/app/.cxx/Debug/5e5j28i3/arm64-v8a" \
-GNinja \
"-DPROJECT_BUILD_DIR=/home/adarsh/react-native-projects/react native libraries/awesome-library/example/android/app/build" \
"-DREACT_ANDROID_DIR=/home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/react-native/ReactAndroid" \
-DANDROID_STL=c++_shared \
-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON
from /home/adarsh/react-native-projects/react native libraries/awesome-library/example/android/app
CMake Error at /home/adarsh/react-native-projects/react native libraries/awesome-library/example/android/app/build/generated/rncli/src/main/jni/Android-rncli.cmake:6 (add_subdirectory):
add_subdirectory called with incorrect number of arguments
Call Stack (most recent call first):
/home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:121 (include)
CMakeLists.txt:31 (include)
CMake Error at /home/adarsh/react-native-projects/react native libraries/awesome-library/example/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:124 (target_link_libraries):
Cannot specify link libraries for target
"react_codegen_RNAwesomeLibrarySpec" which is not built by this project.
Call Stack (most recent call first):
CMakeLists.txt:31 (include)
* 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 3s
error Failed to install the app.
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.182.0
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=true
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
Link to repro
No response
Environment
path: awesome-library
info Fetching system and libraries information...
System:
OS: Linux 5.15 Manjaro Linux
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 7.88 GB / 15.54 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.5.0
path: /usr/bin/node
Yarn:
version: 1.22.19
path: /usr/bin/yarn
npm:
version: 9.8.1
path: /usr/bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: AI-223.8836.35.2231.10406996
Languages:
Java:
version: 11.0.20
path: /usr/bin/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.4
wanted: 0.72.4
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: false
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
path: awesome-library/example
info Fetching system and libraries information...
System:
OS: Linux 5.15 Manjaro Linux
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 8.02 GB / 15.54 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.5.0
path: /usr/bin/node
Yarn:
version: 1.22.19
path: /usr/bin/yarn
npm:
version: 9.8.1
path: /usr/bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: AI-223.8836.35.2231.10406996
Languages:
Java:
version: 11.0.20
path: /usr/bin/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.4
wanted: 0.72.4
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
The text was updated successfully, but these errors were encountered:
I am also facing the same issue,
I tried to bootstrap the project with the options below.
✔ What type of library do you want to develop? › Turbo module
✔ Which languages do you want to use? › Java & Objective-C
Environment
System:
OS: Linux 6.2 Ubuntu 22.04 LTS 22.04 LTS (Jammy Jellyfish)
CPU: (8) x64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
Memory: 1.05 GB / 7.31 GB
Shell:
version: 5.8.1
path: /usr/bin/zsh
Binaries:
Node:
version: 18.16.1
path: /usr/bin/node
Yarn:
version: 1.22.19
path: /usr/bin/yarn
npm:
version: 9.5.1
path: /usr/bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java:
version: 11.0.20.1
path: /usr/bin/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.4
wanted: 0.72.4
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
CMake Version: 3.22.1
Description
I am getting the following build error when running
yarn example android
Steps to reproduce
npx create-react-native-library@latest awesome-lib
cd awesome-lib
yarn
yarn prepack
yarn example android
i have tried uninstall ndk,cmake then reinstall it but nothing worked!!
Although no errors when not using newArc i.e. (newArchEnabled=false)
error is related to cmake!!
Gradle log
Packages
Selected options
package.json
example/android/gradle.properties
Link to repro
No response
Environment
path: awesome-library
path: awesome-library/example
The text was updated successfully, but these errors were encountered: