react-native
react-native copied to clipboard
Android build is failing after upgrading the react native version to 0.75.2
Description
I'm working on the hybrid app which is built using the React Native Package.
It was working fine on the v0.70.14 version but when I upgraded it to version 0.75.2, the Android project stopped building but the iOS project is building fine.
I'm using Hermes as a JS engine
"react": "18.3.1" "react-native": "0.75.2",
I have upgraded the gradle version as well
dependencies { classpath 'com.android.tools.build:gradle:8.5.0' classpath 'com.google.gms:google-services:4.4.1' classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
This is my gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists
Steps to reproduce
- node node_modules/react-native/cli.js start
- The app doesn't get built from Android Studio when I click on Run App button, the screenshot of the issue is attahced.
React Native Version
0.75.2
Affected Platforms
Runtime - Android
Output of npx react-native info
System:
OS: macOS 14.6
CPU: (8) arm64 Apple M3
Memory: 148.36 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.16.0
path: ~/.nvm/versions/node/v20.16.0/bin/node
Yarn:
version: 1.22.22
path: /opt/homebrew/bin/yarn
npm:
version: 10.8.1
path: ~/.nvm/versions/node/v20.16.0/bin/npm
Watchman:
version: 2024.08.19.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/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: Not Found
IDEs:
Android Studio: 2024.1 AI-241.18034.62.2411.12071903
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 22.0.2
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.75.2
wanted: 0.75.2
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Stacktrace or Logs
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not find com.facebook.react:react-native:0.75.2.
Required by:
project :app
project :app > project :notifee_react-native
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Reproducer
It is a private repository
Screenshots and Videos
| :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:
|
@aashish-tanwar I believe AGP 8.5.0 requires Gradle 8.0 or later , try changing that combination . Check Compatiblity list Alternative way is to create a sample app with combination of different AGP and Gradle versions, that will scope down your issue . or Provide a Reproducer Template , I will try it :)
I'm having the same issue, switched the react native version to 0.75.2 and added the following:
on android/build.gradle
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 33
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
}
...
allprojects {
repositories {
exclusiveContent {
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
}
}
on android/app/build.gradle
react {
autolinkLibrariesWithApp()
}
on 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() }
running npx react-native run-android gives the error above(and bellow)
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not find com.facebook.react:react-android:0.75.2.
Required by:
project :app
> Could not find com.facebook.react:hermes-android:0.75.2.
Required by:
project :app
2. The app doesn't get built from Android Studio when I click on Run App button, the screenshot of the issue is attahced.
@aashish-tanwar are you able to build locally with the CLI before trying Android Studio?
@aashish-tanwar
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
TRY GRADLE 8.8 at gradle-wrapper.properties
any update for this same issue as well with me
Closing as @aashish-tanwar is unresponsive.
Please don't hijack the issue and open a new one if you still have a similar issue.