facebook / react-native

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

I got one error while upgrading 0.71.7 to 0.72 #38035

Closed NikhilMasurkar closed 1 year ago

NikhilMasurkar commented 1 year ago

New Version

0.72.0

Old Version

0.71.7

Build Target(s)

android

Output of react-native info

BUILD FAILED in 13s
error Failed to install the app. Command failed with exit code 1: gradlew.bat tasks FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':tasks'. > Could not create task ':react-native-cashfree-pg-sdk:compileDebugJavaWithJavac'. > In order to compile Java 9+ source, please set compileSdkVersion to 30 or above * 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 13s
> Task :gradle-plugin:compileKotlin UP-TO-DATE > Task :gradle-plugin:compileJava NO-SOURCE > Task :gradle-plugin:pluginDescriptors UP-TO-DATE > Task :gradle-plugin:processResources UP-TO-DATE > Task :gradle-plugin:classes UP-TO-DATE > Task :gradle-plugin:jar UP-TO-DATE > Task :gradle-plugin:inspectClassesForKotlinIC UP-TO-DATE > Configure project :app Reading env from: ./env/.env.dev > Configure project :react-native-firebase_analytics :react-native-firebase_analytics package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\analytics\package.json :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\app\package.json :react-native-firebase_analytics:firebase.bom using default value: 31.4.0 :react-native-firebase_analytics package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\analytics\package.json :react-native-firebase_analytics:version set from package.json: 17.5.0 (17,5,0 - 17005000) :react-native-firebase_analytics:android.compileSdk using custom value: 33 :react-native-firebase_analytics:android.targetSdk using custom value: 33 :react-native-firebase_analytics:android.minSdk using custom value: 21 :react-native-firebase_analytics:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-firebase_app :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\app\package.json :react-native-firebase_app:firebase.bom using default value: 31.4.0 :react-native-firebase_app:play.play-services-auth using default value: 20.3.0 :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\app\package.json :react-native-firebase_app:version set from package.json: 17.4.3 (17,4,3 - 17004003) :react-native-firebase_app:android.compileSdk using custom value: 33 :react-native-firebase_app:android.targetSdk using custom value: 33 :react-native-firebase_app:android.minSdk using custom value: 21 :react-native-firebase_app:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-firebase_crashlytics :react-native-firebase_crashlytics package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\crashlytics\package.json :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\app\package.json :react-native-firebase_crashlytics:firebase.bom using default value: 31.4.0 :react-native-firebase_crashlytics package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\crashlytics\package.json :react-native-firebase_crashlytics:version set from package.json: 17.4.3 (17,4,3 - 17004003) :react-native-firebase_crashlytics:android.compileSdk using custom value: 33 :react-native-firebase_crashlytics:android.targetSdk using custom value: 33 :react-native-firebase_crashlytics:android.minSdk using custom value: 21 :react-native-firebase_crashlytics:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-firebase_dynamic-links :react-native-firebase_dynamic-links package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\dynamic-links\package.json :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\app\package.json :react-native-firebase_dynamic-links:firebase.bom using default value: 31.4.0 :react-native-firebase_dynamic-links package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\dynamic-links\package.json :react-native-firebase_dynamic-links:version set from package.json: 17.4.3 (17,4,3 - 17004003) :react-native-firebase_dynamic-links:android.compileSdk using custom value: 33 :react-native-firebase_dynamic-links:android.targetSdk using custom value: 33 :react-native-firebase_dynamic-links:android.minSdk using custom value: 21 :react-native-firebase_dynamic-links:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-firebase_messaging :react-native-firebase_messaging package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\messaging\package.json :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\app\package.json :react-native-firebase_messaging:firebase.bom using default value: 31.4.0 :react-native-firebase_messaging package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\messaging\package.json :react-native-firebase_messaging:version set from package.json: 17.4.3 (17,4,3 - 17004003) :react-native-firebase_messaging:android.compileSdk using custom value: 33 :react-native-firebase_messaging:android.targetSdk using custom value: 33 :react-native-firebase_messaging:android.minSdk using custom value: 21 :react-native-firebase_messaging:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-firebase_perf :react-native-firebase_perf package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\perf\package.json :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\app\package.json :react-native-firebase_perf:firebase.bom using default value: 31.4.0 :react-native-firebase_perf package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\@react-native-firebase\perf\package.json :react-native-firebase_perf:version set from package.json: 17.4.3 (17,4,3 - 17004003) :react-native-firebase_perf:android.compileSdk using custom value: 33 :react-native-firebase_perf:android.targetSdk using custom value: 33 :react-native-firebase_perf:android.minSdk using custom value: 21 :react-native-firebase_perf:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-reanimated No AAR for react-native-reanimated found. Attempting to build from source. Android gradle plugin: 7.4.2 Gradle: 8.0.1 WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL. > Task :tasks FAILED ReactNativeFirebase WARNING: NPM package '@react-native-firebase/analytics' depends on '@react-native-firebase/app' v17.5.0 but found v17.4.3, this might cause build issues or runtime crashes. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings 6 actionable tasks: 1 executed, 5 up-to-date.
error Command failed with exit code 1.

`// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { ext { buildToolsVersion = "33.0.0" minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33 ndkVersion = "23.1.7779620" googlePlayServicesAuthVersion = "16.0.1" kotlin_version = '1.7.22' // <- add this line facebookSdkVersion = "13.1.0" } repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") classpath 'com.google.gms:google-services:4.3.15' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2' classpath 'com.google.firebase:perf-plugin:1.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10" // <- add this line

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {

repositories {
    mavenLocal()
    // maven {
    //     // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
    //     url("$rootDir/../node_modules/react-native/android")
    // }
    // maven {
    //     // Android JSC is installed from npm
    //     url("$rootDir/../node_modules/jsc-android/dist")
    // }

    google()
    jcenter()
    maven { url 'https://www.jitpack.io' }
    maven { url 'https://maven.google.com' }
    maven {
          url "https://github.com/VdoCipher/maven-repo/raw/master/repo"
    }
}

} `

Issue and Reproduction Steps

after upgrading not able to build please check the issue not able to find the problem

cortinico commented 1 year ago

':react-native-cashfree-pg-sdk:compileDebugJavaWithJavac'

Please open this issue against react-native-cashfree-pg-sdk as this is not related to React Native itself

pniby commented 1 year ago

Got the same issue after upgrading from 0.68.2 to 0.72.3. Any fixes?

nicolasdevienne commented 1 year ago

https://stackoverflow.com/questions/76644279/in-order-to-compile-java-9-source-please-set-compilesdkversion-to-30-or-above

jsdecena commented 1 year ago

dapak, no solution? :(

oneHamidreza commented 1 year ago

After upgrading 0.71 to 0.72, Android build was failed I got this error : "Can't find build-gradle:7.4.2"

It seems that problem is related to node_modules/react-native/build.gradle.kts. By changing com.android.library , com.androud.application versions to 7.5.1, android app was ran.

plugins {
  id("com.android.library") version "7.5.1" apply false  // Updated
  id("com.android.application") version "7.5.1" apply false // Updated
  id("de.undercouch.download") version "5.0.1" apply false
  kotlin("android") version "1.7.22" apply false
}

We should wait to react-native developers update gradle version.