Closed YuriOlepir closed 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. |
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
: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. |
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
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
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.
I have a same issue. (0.74.5)
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.
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)?
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.)
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
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)
...
@Arthur-Noh unfortunatly it doesn't help me, could you please share your entire app/build.gradle
and settings.gradle
?
@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 unfortunatly it doesn't help me, could you please share your entire
app/build.gradle
andsettings.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
node_modules, yarn.lock
File > Invalidate Caches, File > Sync Project with Gradle Files
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 = {
};
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
@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)
@Arthur-Noh solution worked for me in 0.74.4. Great work!
@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
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)
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
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.
I'm having the same problem. Is there any solution for this? 3 days ago this wasn't happening
react-native 0.74.3
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!!
I confirm, the fix above is solved the issue. Thx!
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
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.
Steps to reproduce
run
yarn android
React Native Version
0.74.3
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/react-native-community/reproducer-react-native
Screenshots and Videos
No response