添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.7.22'] was not found in new CLI generated project #38853 Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.7.22'] was not found in new CLI generated project #38853 daileytj opened this issue Aug 8, 2023 · 11 comments

Description

I am getting the following output when building the out-of-the-box CLI project on Android.

Build file '.../AwesomeProject/node_modules/@react-native/gradle-plugin/build.gradle.kts' line: 13
Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.7.22'] was not found in any of the following sources:
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.7.22'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.22')
  Searched in the following repositories:
    MavenRepo
    Google
    Gradle Central Plugin Repository
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:237)

React Native Version

0.72.3

Output of npx react-native info

System:
  OS: macOS 13.4
  CPU: (12) arm64 Apple M2 Pro
  Memory: 95.66 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 16.20.1
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
    version: 8.19.4
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2023.07.10.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /Users/<redacted>/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10406996
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.20
    path: /usr/bin/javac
  Ruby:
    version: 3.2.0
    path: /Users/<redacted>/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.3
    wanted: 0.72.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

npx react-native@latest init AwesomeProject
yarn android

Snack, screenshot, or link to a repository

I'm not even getting the out-of-the-box CLI project to run on android so there isn't a snack or screenshot that is relevant to the issue.

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

Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. and removed Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Aug 8, 2023

The CI for the project you shared is green:
https://github.com/daileytj/reproducer-react-native/actions/runs/5799873078/job/15720809672

Is this happening for any project you create?

The CI for the project you shared is green: https://github.com/daileytj/reproducer-react-native/actions/runs/5799873078/job/15720809672

Is this happening for any project you create?

Yes, turns out this was a proxy issue with android studio.

The CI for the project you shared is green: https://github.com/daileytj/reproducer-react-native/actions/runs/5799873078/job/15720809672
Is this happening for any project you create?

Yes, turns out this was a proxy issue with android studio.

Hello. I'm facing the exact issue. How did you fix yours?

I'm having a similar problem, but with a different version.

    OS: macOS 13.2
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 40.59 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
    Watchman: 2023.09.04.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK:
      Android NDK: 22.1.7171670
  IDEs:
    Android Studio: 2022.3 AI-223.8836.35.2231.10671973
    Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.20.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.7 => 0.68.7 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/[email protected]/Projects/Airliquide/DeltaMobile/node_modules/react-native-gradle-plugin/build.gradle.kts' line: 11
* What went wrong:
Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.6.10'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (None of the included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10')
  Searched in the following repositories:
    MavenRepo
    Google
    Gradle Central Plugin Repository
* 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 7s```
          

React Native says:
If you already have a JDK on your system, we recommend JDK17. You may encounter problems using higher JDK versions.

If you're using the latest version of Java Development Kit, you'll need to change the Gradle version of your project so it can recognize the JDK. You can do that by going to{project root folder}\android\gradle\wrapper\gradle-wrapper.properties and changing the distributionUrl value to upgrade the Gradle version. You can check out here the latest releases of Gradle.

Things that worked for me was to run the following command :
choco install -y microsoft-openjdk17
to install the correct version of JDK and install the required Android SDK's and ensure that they are corrctly present in the environment Variables.

Copy and paste Get-ChildItem -Path Env:\ into powershell to verify that JAVA_HOME and ANDROID_HOME path is present in environment variables

Result should look like this:

Hope it solves your Problem

Thanks,
Keep Coding