nodejs-mobile / nodejs-mobile-react-native

Node.js for Mobile Apps React Native plugin
https://nodejs-mobile.github.io
MIT License
174 stars 42 forks source link

Can't build Android with new architecture enabled, but without can #78

Open serhii-yalla opened 2 months ago

serhii-yalla commented 2 months ago

iOS can be build with and without new architecture. Here are my files:

android>build.gradle

buildscript {
    ext {
        buildToolsVersion = "34.0.0"
        minSdkVersion = 23
        compileSdkVersion = 34
        targetSdkVersion = 34
        ndkVersion = "26.1.10909125"
        kotlinVersion = "1.9.22"
        buildToolsVersion = "34.0.0"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.google.gms:google-services:4.4.2")
        classpath("com.android.tools.build:gradle:4.2.1")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
    }
}

apply plugin: "com.facebook.react.rootproject"
apply plugin: "com.google.gms.google-services"

gradle.properties

# 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=1024m
# 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

# 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
org.gradle.warning.mode=all

Error:

> Task :nodejs-mobile-react-native:buildCMakeRelWithDebInfo[x86] FAILED
C/C++: ninja: error: '../../../../libnode/bin/x86/libnode.so', needed by '../../../../build/intermediates/cxx/RelWithDebInfo/215j1n6u/obj/x86/libnodejs-mobile-react-native-native-lib.so', missing and no known rule to make it

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':nodejs-mobile-react-native:buildCMakeRelWithDebInfo[x86]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/pprnd/Documents/yalla_cashier/node_modules/nodejs-mobile-react-native/android/.cxx/RelWithDebInfo/215j1n6u/x86'

  C++ build system [build] failed while executing:
      /Users/pprnd/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/pprnd/Documents/yalla_cashier/node_modules/nodejs-mobile-react-native/android/.cxx/RelWithDebInfo/215j1n6u/x86 \
        nodejs-mobile-react-native-native-lib
    from /Users/pprnd/Documents/yalla_cashier/node_modules/nodejs-mobile-react-native/android
  ninja: error: '../../../../libnode/bin/x86/libnode.so', needed by '../../../../build/intermediates/cxx/RelWithDebInfo/215j1n6u/obj/x86/libnodejs-mobile-react-native-native-lib.so', missing and no known rule to make it

* 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 43s
314 actionable tasks: 308 executed, 6 up-to-date

Process finished with exit code 1
serhii-yalla commented 2 months ago

@staltz @jmatsushita @jaimecbernardo Any help?