facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.13k stars 24.2k forks source link

Minimum supported Gradle version is 8.7. Current version is 8.6. RN 0.74.3 #46047

Closed YuriOlepir closed 3 weeks ago

YuriOlepir commented 3 weeks ago

Description

Hi, I'm using react-native 0.74.3. After updating the mac os to the latest version 14.6.1 (23G93) I cannot run android build. it fails and forces me to move to the gradle 8.7.0.


FAILURE: Build failed with an exception.
* Where:
Build file '/app/android/app/build.gradle' line: 3
* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.version-check'.
   > Minimum supported Gradle version is 8.7. Current version is 8.6. If using the gradle wrapper, try editing the distributionUrl in /app/android/gradle/wrapper/gradle-wrapper.properties to gradle-8.7-all.zip
* 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 9s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installUftDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where:
Build file '/app/android/app/build.gradle' line: 3 * What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.version-check'. > Minimum supported Gradle version is 8.7. Current version is 8.6. If using the gradle wrapper, try editing the distributionUrl in /app/android/gradle/wrapper/gradle-wrapper.properties to gradle-8.7-all.zip *

Steps to reproduce

run yarn android

React Native Version

0.74.3

Affected Platforms

Runtime - Android

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: macOS 14.6.1
  CPU: (8) arm64 Apple M2
  Memory: 865.73 MB / 24.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.9.0
    path: ~/.nvm/versions/node/v20.9.0/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v20.9.0/bin/yarn
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v20.9.0/bin/npm
  Watchman:
    version: 2024.08.12.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.13.0
    path: /Users/yo/.rvm/gems/ruby-2.7.5/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 29.0.0
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 34.0.0
    System Images:
      - android-33 | Intel x86_64 Atom
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google APIs Intel x86_64 Atom
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google Play Intel x86_64 Atom
      - android-TiramisuPrivacySandbox | Google APIs ARM 64 v8a
      - android-TiramisuPrivacySandbox | Google Play Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12169540
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/javac
  Ruby:
    version: 2.7.5
    path: /Users/yo/.rvm/rubies/ruby-2.7.5/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

FAILURE: Build failed with an exception.
* Where:
Build file '/app/android/app/build.gradle' line: 3
* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.version-check'.
   > Minimum supported Gradle version is 8.7. Current version is 8.6. If using the gradle wrapper, try editing the distributionUrl in /app/android/gradle/wrapper/gradle-wrapper.properties to gradle-8.7-all.zip
* 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 9s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installUftDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where:
Build file '/app/android/app/build.gradle' line: 3 * What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.version-check'. > Minimum supported Gradle version is 8.7. Current version is 8.6. If using the gradle wrapper, try editing the distributionUrl in /app/android/gradle/wrapper/gradle-wrapper.properties to gradle-8.7-all.zip *

Reproducer

https://github.com/react-native-community/reproducer-react-native

Screenshots and Videos

No response

react-native-bot commented 3 weeks ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.74.5. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
react-native-bot commented 3 weeks ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 3 weeks ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
react-native-bot commented 3 weeks ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
cortinico commented 3 weeks ago

I cannot reproduce your problem. Please provide a valid repro as I think this is specific to your setup.

Anyway, you can simply update the Gralde version in the file android/gradle/wrapper/gradle-wrapper.properties

Volksfeld commented 3 weeks ago

Going through the same problem as of today. So far, I've tried downgrading AGP (no success) and upgrading gradle. Using gradle 8.7 leads to problems with autolinking, which seems to be fixed in 0.75.1. Unfortunately, the newer RN version breaks some deps (safe-area-context, expo-core, etc..).

Print of the autolinking problem image

YuriOlepir commented 3 weeks ago

I cannot reproduce your problem. Please provide a valid repro as I think this is specific to your setup.

Anyway, you can simply update the Gralde version in the file android/gradle/wrapper/gradle-wrapper.properties

Sorry, but this is not the exit, updating to the next gradle versions brings new problems connected with autolinking.

Arthur-Noh commented 3 weeks ago

I have a same issue. (0.74.5)

cortinico commented 3 weeks ago

Sorry, but this is not the exit, updating to the next gradle versions brings new problems connected with autolinking.

Then please provide a reproducer. If I create a project with React Native 0.74.5 I can safely build without any problems so this is most likely introduced by a dependency of yours.

YuriOlepir commented 3 weeks ago

Sorry, but this is not the exit, updating to the next gradle versions brings new problems connected with autolinking.

Then please provide a reproducer. If I create a project with React Native 0.74.5 I can safely build without any problems so this is most likely introduced by a dependency of yours.

Could you please confirm that you have run the project on the latest mac os 14.6.1 (23G93)?

Arthur-Noh commented 3 weeks ago

I'm using 14.6.1 (23G93).

Looking at the 0.75.1 guide, there is the following code in the app/build.gradle location.

app/build.gradle

react {
    ...
     /* Autolinking */
    autolinkLibrariesWithApp()
}

I put this in and tried (from 0.74.5 version), and I get Duplate class found in the file error, but I don't get an authLinking error. (Of course, I don't think this is the right way.)

YuriOlepir commented 3 weeks ago

I'm using 14.6.1 (23G93).

Looking at the 0.75.1 guide, there is the following code in the app/build.gradle location.

app/build.gradle

react {
    ...
     /* Autolinking */
    autolinkLibrariesWithApp()
}

I put this in and tried (from 0.74.5 version), and I get Duplate class found in the file error, but I don't get an authLinking error. (Of course, I don't think this is the right way.)

Yes, I have been trying the same and i got such results also

Arthur-Noh commented 3 weeks ago

I'm using 14.6.1 (23G93). Looking at the 0.75.1 guide, there is the following code in the app/build.gradle location. app/build.gradle

react {
    ...
     /* Autolinking */
    autolinkLibrariesWithApp()
}

I put this in and tried (from 0.74.5 version), and I get Duplate class found in the file error, but I don't get an authLinking error. (Of course, I don't think this is the right way.)

Yes, I have been trying the same and i got such results also

This way, it looks like it's working normally. Could you give it a try?

app/build.gradle

react {
    ...
     /* Autolinking */
    autolinkLibrariesWithApp() // Add this line.
}

...

// Remove this line
// apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

...
YuriOlepir commented 3 weeks ago

@Arthur-Noh unfortunatly it doesn't help me, could you please share your entire app/build.gradle and settings.gradle?

cortinico commented 3 weeks ago

@YuriOlepir we need a reproducer of your project using this template: https://github.com/react-native-community/reproducer-react-native

without that we can't help further

Arthur-Noh commented 3 weeks ago

@Arthur-Noh unfortunatly it doesn't help me, could you please share your entire app/build.gradle and settings.gradle?

Unfortunately, I can't show you all my codes. I don't know if this is the right way, but I'll tell you how I solved it. (RN 0.74.5)

My Env is

app/android/gradle/wrapper/gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
// I rewrite this line.
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

app/build.gradle

...

react {
    /* Folders */
    //   The root of your project, i.e. where "package.json" lives. Default is '..'
    // root = file("../")
    //   The folder where the react-native NPM package is. Default is ../node_modules/react-native
    // reactNativeDir = file("../node_modules/react-native")

    //   The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
    // codegenDir = file("../node_modules/@react-native/codegen")
    //   The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
    // cliFile = file("../node_modules/react-native/cli.js")

    /* Variants */
    //   The list of variants to that are debuggable. For those we're going to
    //   skip the bundling of the JS bundle and the assets. By default is just 'debug'.
    //   If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
    // debuggableVariants = ["liteDebug", "prodDebug"]

    /* Bundling */
    //   A list containing the node command and its flags. Default is just 'node'.
    // nodeExecutableAndArgs = ["node"]
    //
    //   The command to run when bundling. By default is 'bundle'
    // bundleCommand = "ram-bundle"
    //
    //   The path to the CLI configuration file. Default is empty.
    // bundleConfig = file(../rn-cli.config.js)
    //
    //   The name of the generated asset file containing your JS bundle
    // bundleAssetName = "MyApplication.android.bundle"
    //
    //   The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
    // entryFile = file("../js/MyApplication.android.js")
    //
    //   A list of extra flags to pass to the 'bundle' commands.
    //   See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
    // extraPackagerArgs = []

    /* Hermes Commands */
    //   The hermes compiler command to run. By default it is 'hermesc'
    // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
    //
    //   The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
    // hermesFlags = ["-O", "-output-source-map"]

    // I add this line.
+    /* Autolinking */
+    autolinkLibrariesWithApp() 
}

...

// It will be at the bottom of the file.
// I removed this line.
- apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

and

  1. In Project. remove and reinstall node_modules, yarn.lock
  2. In Android Studio. File > Invalidate Caches, File > Sync Project with Gradle Files
  3. Run Project.
Hao-yiwen commented 3 weeks ago

In react-ntaive@0.75.1, I got same error. I touch react-native.config.js file to fix this error.

Follow is react-native.config.js content.

module.exports = {
};
DW1998 commented 3 weeks ago

In your build.gradle, change

classpath("com.android.tools.build:gradle") to classpath("com.android.tools.build:gradle:8.4.0")

Otherwise you will use the newest android gradle plugin version 8.5 which requires Gradle 8.7

shoaib-arif commented 3 weeks ago

@Arthur-Noh it gives this error please guide me how to fix this

Build file '/Users/shoaib/Documents/ReactNative/TheDigitalHub/TronixPay/android/app/build.gradle' line: 52

A problem occurred evaluating project ':app'.

/Users/shoaib/Documents/ReactNative/TheDigitalHub/TronixPay/android/build/generated/autolinking/autolinking.json (No such file or directory)

Volksfeld commented 3 weeks ago

@Arthur-Noh solution worked for me in 0.74.4. Great work!

serhii-yalla commented 3 weeks ago

@shoaib-arif I resolved this issue by adding

pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }

instead of

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)

in android -> settings.gradle file

Follow guide on https://react-native-community.github.io/upgrade-helper/?from=0.74.5&to=0.75.1

shoaib-arif commented 3 weeks ago

android > build.gradle

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

apply plugin: "com.facebook.react.rootproject"

android > settings.gradle

pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } plugins { id("com.facebook.react.settings") } extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } rootProject.name = 'Tronix' include ':app' includeBuild('../node_modules/@react-native/gradle-plugin')

add this in react body android > app > build.gradle

autolinkLibrariesWithApp()

and remove this from bottom of the file

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

serhii-yalla commented 3 weeks ago

Anyone here had such error?

P.S. Tried to delete .cxx folder but an error persists

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/pprnd/Documents/yalla_cashier/android/app/.cxx/Debug/444r3068/arm64-v8a'
  [0/2] Re-checking globbed directories...
  [1/2] Building CXX object CMakeFiles/appmodules.dir/OnLoad.cpp.o
  FAILED: CMakeFiles/appmodules.dir/OnLoad.cpp.o 
  /Users/pprnd/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --sysroot=/Users/pprnd/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Dappmodules_EXPORTS -I/Users/pprnd/Documents/yalla_cashier/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup -I/Users/pprnd/Documents/yalla_cashier/android/app/build/generated/rncli/src/main/jni -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/fabricjni/include -isystem /Users/pprnd/.gradle/caches/transforms-4/f92d36c3d318940697fded3637e85f31/transformed/jetified-fbjni-0.6.0/prefab/modules/fbjni/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/folly_runtime/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/glog/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/jsi/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_codegen_rncore/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_debug/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_utils/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_nativemodule_core/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_newarchdefaults/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_cxxreactpackage/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_render_componentregistry/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_render_core/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_render_debug/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_render_graphics/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_render_imagemanager/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_render_mapbuffer/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/react_render_textlayoutmanager/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/rrc_image/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/rrc_view/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/rrc_text/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/rrc_textinput/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/rrc_legacyviewmanagerinterop/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/runtimeexecutor/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/turbomodulejsijni/include -isystem /Users/pprnd/.gradle/caches/transforms-4/cea0df74f00106e110b1a1b4de1f7669/transformed/jetified-react-android-0.74.5-debug/prefab/modules/yoga/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fno-limit-debug-info  -fPIC -Wall -Werror -Wno-error=cpp -fexceptions -frtti -std=c++20 -DLOG_TAG=\"ReactNative\" -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DFOLLY_HAVE_XSI_STRERROR_R=1 -MD -MT CMakeFiles/appmodules.dir/OnLoad.cpp.o -MF CMakeFiles/appmodules.dir/OnLoad.cpp.o.d -o CMakeFiles/appmodules.dir/OnLoad.cpp.o -c /Users/pprnd/Documents/yalla_cashier/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
  /Users/pprnd/Documents/yalla_cashier/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:34:10: fatal error: 'rncli.h' file not found
  #include <rncli.h>
           ^~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.

  C++ build system [build] failed while executing:
      /Users/pprnd/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/pprnd/Documents/yalla_cashier/android/app/.cxx/Debug/444r3068/arm64-v8a \
        appmodules
    from /Users/pprnd/Documents/yalla_cashier/android/app

* 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 1m 20s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDevelopmentdebug -PreactNativeDevServerPort=8081
cortinico commented 3 weeks ago

Closing as @YuriOlepir is unresponsive.

We're using this as a bug tracker for React Native only. As we could not identify this as a bug inside React Native, we'll be closing this issue.

kikeztw commented 3 weeks ago

I'm having the same problem. Is there any solution for this? 3 days ago this wasn't happening

react-native 0.74.3

NidhiBhansali1923 commented 3 weeks ago

I'm having the same problem with "react-native 0.74.3"

I have followed the below steps and able to build application successfully.

Step-1 Update package.json file for "react-native": "0.74.3" to "react-native": "0.74.4"

Step-2 Update the distributionUrl inside the gradle-wrapper.properties file distributionUrl=https://services.gradle.org/distributions/gradle-8.7-bin.zip

Step-3 Add autolinkLibrariesWithApp() within the app/build.gradle file. react { autolinkLibrariesWithApp() }

Step-4 Remove below lines from app/build.gradle file. apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle") applyNativeModulesAppBuildGradle(project)

Step-5 Remove below line from settings.gradle file. apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)

Step-6 Add below lines above the rootProject.name property. pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } plugins { id("com.facebook.react.settings") } extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }

rootProject.name = 'ProjectName'

Step-7 Delete the .build, .gradle folder from android

Step-8 Remove node_modules, yarn.lock file and run yarn android command to build the application

Thanks!!

YuriOlepir commented 3 weeks ago

I confirm, the fix above is solved the issue. Thx!

vishalSharmaCfcs commented 2 weeks ago

I'm having the same problem with "react-native 0.74.3"

I have followed the below steps and able to build application successfully.

Step-1 Update package.json file for "react-native": "0.74.3" to "react-native": "0.74.4"

Step-2 Update the distributionUrl inside the gradle-wrapper.properties file distributionUrl=https://services.gradle.org/distributions/gradle-8.7-bin.zip

Step-3 Add autolinkLibrariesWithApp() within the app/build.gradle file. react { autolinkLibrariesWithApp() }

Step-4 Remove below lines from app/build.gradle file. apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle") applyNativeModulesAppBuildGradle(project)

Step-5 Remove below line from settings.gradle file. apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)

Step-6 Add below lines above the rootProject.name property. pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } plugins { id("com.facebook.react.settings") } extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }

rootProject.name = 'ProjectName'

Step-7 Delete the .build, .gradle folder from android

Step-8 Remove node_modules, yarn.lock file and run yarn android command to build the application

Thanks!!

This helps me and save my day