react-native-community / upgrade-support

A central community-backed place to request and give help when upgrading your app.
MIT License
260 stars 2 forks source link

UPGRADING TO REACT NATIVE 0.74.1 - Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:. #278

Closed SMKH-PRO closed 6 months ago

SMKH-PRO commented 6 months ago

Environment

info Fetching system and libraries information...
System:
  OS: macOS 14.4
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 586.20 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.0
    path: ~/.nvm/versions/node/v18.20.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v18.20.0/bin/yarn
  npm:
    version: 10.5.0
    path: ~/.nvm/versions/node/v18.20.0/bin/npm
  Watchman:
    version: 2024.04.01.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK:
    API Levels:
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-30 | Google APIs Intel x86 Atom
      - android-30 | Google Play Intel x86 Atom
      - android-34 | Google APIs Intel x86_64 Atom
      - android-34 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11567975
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/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: true
  newArchEnabled: false

Things I’ve done to figure out my issue

Upgrading version

From 0.72.3 to 0.74.1

Description

Getting this error and build is failing:

FAILURE: Build failed with an exception.

MacBook-Pro android % ./gradlew clean  --info               
Initialized native services in: /Users/smkh/.gradle/native
Initialized jansi services in: /Users/smkh/.gradle/native
Received JVM installation metadata from '/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home': {JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home, JAVA_VERSION=17.0.10, JAVA_VENDOR=Azul Systems, Inc., RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=17.0.10+7-LTS, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=17.0.10+7-LTS, VM_VENDOR=Azul Systems, Inc., OS_ARCH=x86_64}
The client will now receive all logging from the daemon (pid: 23328). The daemon log file: /Users/smkh/.gradle/daemon/8.6/daemon-23328.out.log
Starting 39th build in daemon [uptime: 3 hrs 13 mins 31.491 secs, performance: 100%, GC rate: 0.00/s, heap usage: 3% of 2 GiB, non-heap usage: 30% of 512 MiB]
Using 12 worker leases.
Now considering [/Users/smkh/Documents/GitHub/ReactNative_CodePush_Template/template/android, /Users/smkh/Documents/GitHub/ReactNative_CodePush_Template/template/node_modules/@react-native/gradle-plugin] as hierarchies to watch
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
:ReactNative:Automatically adding native module '@react-native-async-storage/async-storage'
:ReactNative:Automatically adding native module '@sentry/react-native'
:ReactNative:Automatically adding native module 'appcenter'
:ReactNative:Automatically adding native module 'appcenter-analytics'
:ReactNative:Automatically adding native module 'appcenter-crashes'
:ReactNative:Skipping native module 'lottie-ios'
:ReactNative:Automatically adding native module 'lottie-react-native'
:ReactNative:Automatically adding native module 'react-native-bootsplash'
:ReactNative:Automatically adding native module 'react-native-code-push'
:ReactNative:Automatically adding native module 'react-native-config'
:ReactNative:Automatically adding native module 'react-native-exception-handler'
:ReactNative:Automatically adding native module 'react-native-fast-image'
:ReactNative:Automatically adding native module 'react-native-safe-area-context'
:ReactNative:Automatically adding native module 'react-native-screens'
:ReactNative:Skipping native module 'react-native-simple-toast'
:ReactNative:Automatically adding native module 'react-native-svg'
:ReactNative:Automatically adding native module 'react-native-vector-icons'
:ReactNative:Automatically adding native module 'rn-secure-storage'
Settings evaluated using settings file '/Users/smkh/Documents/GitHub/ReactNative_CodePush_Template/template/android/settings.gradle'.
Now considering [/Users/smkh/Documents/GitHub/ReactNative_CodePush_Template/template/node_modules/@react-native/gradle-plugin, /Users/smkh/Documents/GitHub/ReactNative_CodePush_Template/template/android] as hierarchies to watch
Projects loaded. Root project using build file '/Users/smkh/Documents/GitHub/ReactNative_CodePush_Template/template/android/build.gradle'.
Included projects: [root project 'MyApp', project ':app', project ':appcenter', project ':appcenter-analytics', project ':appcenter-crashes', project ':lottie-react-native', project ':react-native-async-storage_async-storage', project ':react-native-bootsplash', project ':react-native-code-push', project ':react-native-config', project ':react-native-exception-handler', project ':react-native-fast-image', project ':react-native-safe-area-context', project ':react-native-screens', project ':react-native-svg', project ':react-native-vector-icons', project ':rn-secure-storage', project ':sentry_react-native']

> Configure project :gradle-plugin
Evaluating project ':gradle-plugin' using build file '/Users/smkh/Documents/GitHub/ReactNative_CodePush_Template/template/node_modules/@react-native/gradle-plugin/build.gradle.kts'.
Invalidating in-memory cache of /Users/smkh/Documents/GitHub/ReactNative_CodePush_Template/template/node_modules/@react-native/gradle-plugin/.gradle/buildOutputCleanup/outputFiles.bin
Transforming kotlin-gradle-plugin-1.7.22-gradle71.jar (org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-gradle-plugin-api-1.7.22-gradle71.jar (org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-gradle-plugin-model-1.7.22.jar (org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-klib-commonizer-api-1.7.22.jar (org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-project-model-1.7.22.jar (org.jetbrains.kotlin:kotlin-project-model:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-android-extensions-1.7.22.jar (org.jetbrains.kotlin:kotlin-android-extensions:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-annotation-processing-gradle-1.7.22.jar (org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-gradle-plugin-idea-proto-1.7.22.jar (org.jetbrains.kotlin:kotlin-gradle-plugin-idea-proto:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-scripting-compiler-embeddable-1.7.22.jar (org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-gradle-plugin-idea-1.7.22.jar (org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-scripting-compiler-impl-embeddable-1.7.22.jar (org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-compiler-runner-1.7.22.jar (org.jetbrains.kotlin:kotlin-compiler-runner:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-tooling-core-1.7.22.jar (org.jetbrains.kotlin:kotlin-tooling-core:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-native-utils-1.7.22.jar (org.jetbrains.kotlin:kotlin-native-utils:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-util-klib-1.7.22.jar (org.jetbrains.kotlin:kotlin-util-klib:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-gradle-plugin-api-1.7.22.jar (org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming jna-5.6.0.jar (net.java.dev.jna:jna:5.6.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-build-common-1.7.22.jar (org.jetbrains.kotlin:kotlin-build-common:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-scripting-jvm-1.7.22.jar (org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-daemon-embeddable-1.7.22.jar (org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-util-io-1.7.22.jar (org.jetbrains.kotlin:kotlin-util-io:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming trove4j-1.0.20200330.jar (org.jetbrains.intellij.deps:trove4j:1.0.20200330) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlinx-coroutines-core-jvm-1.5.0.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-scripting-common-1.7.22.jar (org.jetbrains.kotlin:kotlin-scripting-common:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-compiler-embeddable-1.7.22.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Transforming kotlin-daemon-client-1.7.22.jar (org.jetbrains.kotlin:kotlin-daemon-client:1.7.22) with ExternalDependencyInstrumentingArtifactTransform
Using Kotlin Gradle Plugin gradle71 variant
kotlin scripting plugin: created the scripting discovery configuration: kotlinScriptDef
kotlin scripting plugin: created the scripting discovery configuration: testKotlinScriptDef
Registering project ':gradle-plugin' in composite build. Will substitute for module 'com.facebook.react:react-native-gradle-plugin'.

> Configure project :
Evaluating root project 'MyApp' using build file '/Users/smkh/Documents/GitHub/ReactNative_CodePush_Template/template/android/build.gradle'.
Found project 'project :gradle-plugin' as substitute for module 'com.facebook.react:react-native-gradle-plugin'.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'MyApp'.
> Could not determine the dependencies of null.
   > Could not resolve all task dependencies for configuration ':classpath'.
      > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:.
        Required by:
            project :

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --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 2s
Watched directory hierarchies: [/Users/smkh/Documents/GitHub/ReactNative_CodePush_Template/template/node_modules/@react-native/gradle-plugin]

Reproducible demo

Main branch of this repo: https://github.com/SMKH-PRO/ReactNative_CodePush_Template

SMKH-PRO commented 6 months ago

clean installing the libraries resolved the issue for me.

nmateo commented 5 months ago

Hello, i'm having the exact same error, update done with Rn Diff Helper, too, how did you fix it by "clean installing the libraries" would help me, thanks.

skanderhk commented 4 months ago

Make sure you use the correct path in android/settings.gradle

from :

includeBuild('../node_modules/react-native-gradle-plugin')

to :

includeBuild('../node_modules/@react-native/gradle-plugin')