Skip to content

Issue building for Android on new architecture #9

@Abdulazeez-98

Description

@Abdulazeez-98

Hi,
Thank you for this useful library.

The build process runs normally when newArchEnabled is set to false. However, when I enable the new architecture (newArchEnabled: true), I get this build error when building for Android:


[RUN_GRADLEW] C/C++:   Cannot specify link libraries for target "react_codegen_RNDetectFridaSpec"
[RUN_GRADLEW] C/C++:   which is not built by this project.
[RUN_GRADLEW] C/C++: Call Stack (most recent call first):
[RUN_GRADLEW] C/C++:   CMakeLists.txt:31 (include)
[RUN_GRADLEW] > Task :app:mergeDebugJavaResource
[RUN_GRADLEW] [Incubating] Problems report is available at: file:///private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/android/build/reports/problems/problems-report.html
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':app:configureCMakeDebug[arm64-v8a]'.
[RUN_GRADLEW] > [CXX1429] error when building with cmake using /private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/CMakeLists.txt: -- The C compiler identification is Clang 18.0.2
[RUN_GRADLEW]   -- The CXX compiler identification is Clang 18.0.2
[RUN_GRADLEW]   -- Detecting C compiler ABI info
[RUN_GRADLEW]   -- Detecting C compiler ABI info - done
[RUN_GRADLEW]   -- Check for working C compiler: /Users/abdulazeez/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped
[RUN_GRADLEW]   -- Detecting C compile features
[RUN_GRADLEW]   -- Detecting C compile features - done
[RUN_GRADLEW]   -- Detecting CXX compiler ABI info
[RUN_GRADLEW]   -- Detecting CXX compiler ABI info - done
[RUN_GRADLEW]   -- Check for working CXX compiler: /Users/abdulazeez/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped
[RUN_GRADLEW]   -- Detecting CXX compile features
[RUN_GRADLEW]   -- Detecting CXX compile features - done
[RUN_GRADLEW]   -- Configuring incomplete, errors occurred!
[RUN_GRADLEW]   See also "/private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/android/app/.cxx/Debug/32m53j65/arm64-v8a/CMakeFiles/CMakeOutput.log".
[RUN_GRADLEW]   
[RUN_GRADLEW]   C++ build system [configure] failed while executing:
[RUN_GRADLEW]       /Users/abdulazeez/Library/Android/sdk/cmake/3.22.1/bin/cmake \
[RUN_GRADLEW]         -H/private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup \
[RUN_GRADLEW]         -DCMAKE_SYSTEM_NAME=Android \
[RUN_GRADLEW]         -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
[RUN_GRADLEW]         -DCMAKE_SYSTEM_VERSION=26 \
[RUN_GRADLEW]         -DANDROID_PLATFORM=android-26 \
[RUN_GRADLEW]         -DANDROID_ABI=arm64-v8a \
[RUN_GRADLEW]         -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \
[RUN_GRADLEW]         -DANDROID_NDK=/Users/abdulazeez/Library/Android/sdk/ndk/27.1.12297006 \
[RUN_GRADLEW]         -DCMAKE_ANDROID_NDK=/Users/abdulazeez/Library/Android/sdk/ndk/27.1.12297006 \
[RUN_GRADLEW]         -DCMAKE_TOOLCHAIN_FILE=/Users/abdulazeez/Library/Android/sdk/ndk/27.1.12297006/build/cmake/android.toolchain.cmake \
[RUN_GRADLEW]         -DCMAKE_MAKE_PROGRAM=/Users/abdulazeez/Library/Android/sdk/cmake/3.22.1/bin/ninja \
[RUN_GRADLEW]         -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/android/app/build/intermediates/cxx/Debug/32m53j65/obj/arm64-v8a \
[RUN_GRADLEW]         -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/android/app/build/intermediates/cxx/Debug/32m53j65/obj/arm64-v8a \
[RUN_GRADLEW]         -DCMAKE_BUILD_TYPE=Debug \
[RUN_GRADLEW]         -DCMAKE_FIND_ROOT_PATH=/private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/android/app/.cxx/Debug/32m53j65/prefab/arm64-v8a/prefab \
[RUN_GRADLEW]         -B/private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/android/app/.cxx/Debug/32m53j65/arm64-v8a \
[RUN_GRADLEW]         -GNinja \
[RUN_GRADLEW]         -DPROJECT_BUILD_DIR=/private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/android/app/build \
[RUN_GRADLEW]         -DPROJECT_ROOT_DIR=/private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/android \
[RUN_GRADLEW]         -DREACT_ANDROID_DIR=/private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/node_modules/react-native/ReactAndroid \
[RUN_GRADLEW]         -DANDROID_STL=c++_shared \
[RUN_GRADLEW]         -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON
[RUN_GRADLEW]     from /private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/android/app
[RUN_GRADLEW]   CMake Error at /private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/android/app/build/generated/autolinking/src/main/jni/Android-autolinking.cmake:22 (add_subdirectory):
[RUN_GRADLEW]     add_subdirectory given source
[RUN_GRADLEW]     "/private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/node_modules/react-native-detect-frida/android/build/generated/source/codegen/jni/"
[RUN_GRADLEW]     which is not an existing directory.
[RUN_GRADLEW]   Call Stack (most recent call first):
[RUN_GRADLEW]     /private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:100 (include)
[RUN_GRADLEW]     CMakeLists.txt:31 (include)
[RUN_GRADLEW]   
[RUN_GRADLEW]   
[RUN_GRADLEW]   CMake Error at /private/var/folders/rk/zv8y3fyn1fsgth3qgfx9z6lh0000gn/T/eas-build-local-nodejs/ac0306bc-d93e-4383-ac61-85551a6f4278/build/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:103 (target_link_libraries):
[RUN_GRADLEW]     Cannot specify link libraries for target "react_codegen_RNDetectFridaSpec"

I think the problem is that the generated code is not actually present in the library files. When I edit the package.json file of the library (remove the line "includesGeneratedCode": true,), the build succeeds. This is the patch package in case it helps anyone:

diff --git a/node_modules/react-native-detect-frida/package.json b/node_modules/react-native-detect-frida/package.json
index 5d9bdd8..9813e4b 100644
--- a/node_modules/react-native-detect-frida/package.json
+++ b/node_modules/react-native-detect-frida/package.json
@@ -170,7 +170,6 @@
       "ios": "ios/generated",
       "android": "android/generated"
     },
-    "includesGeneratedCode": true,
     "android": {
       "javaPackageName": "com.detectfrida"
     }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions