Skip to content

Android build fails with new architecture on RN 0.81 #847

@bmatasar

Description

@bmatasar

Steps

  1. Create new CLI project (RN 0.81, newArchitecture=true)
$ npx @react-native-community/cli@latest init AwesomeProject
  1. Add react-native-config as mentioned in the installation steps
$ yarn add react-native-config
$ npx react-native-integrate react-native-config
  1. Try to build on Android
$ yarn android

Result

The build fails with the output

> Task :app:configureCMakeDebug[arm64-v8a] FAILED
C/C++: CMake Error at /Users/bmatasar/git/AwesomeProject/android/app/build/generated/autolinking/src/main/jni/Android-autolinking.cmake:9 (add_subdirectory):
C/C++:   add_subdirectory given source
C/C++:   "/Users/bmatasar/git/AwesomeProject/node_modules/react-native-config/android/build/generated/source/codegen/jni/"
C/C++:   which is not an existing directory.
C/C++: Call Stack (most recent call first):
C/C++:   /Users/bmatasar/git/AwesomeProject/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:94 (include)
C/C++:   CMakeLists.txt:31 (include)
C/C++: CMake Error at /Users/bmatasar/git/AwesomeProject/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:97 (target_link_libraries):
C/C++:   Cannot specify link libraries for target "react_codegen_RNCConfigModule"
C/C++:   which is not built by this project.
C/C++: Call Stack (most recent call first):
C/C++:   CMakeLists.txt:31 (include)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions