Kotlin Error : Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7:1.0.7
replace
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
^
|
JRE = Java Runtime Environment
with
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
^
|
JDK = Java Development Kit
Since the version with jre is absolute , just replace and sync the project
Official Documentation here Thanks for the link @ ROMANARMY
How to resolve error Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-jre7... when building in Android Studio
kotlin-stdlib-jre[7/8]
was deprecated a while ago, and has since been removed. The deprecation note was kept until 1.2.71, which was the last version to release those artifacts. The official deprecation notice can be found here. Using any of the deprecated versions (before it was removed) should also produce a warning in (at least) Android Studio and IntelliJ.
Use kotlin-stdlib-jdk7
instead. It's the same dependency as kotlin-stdlib-jre7
(except newer), but it was re-named to kotlin-stdlib-jdk
. kotlin-stdlib-jre
is now no longer maintained as a separate dependency.
Both IntelliJ and Android Studio currently generate new projects using kotlin-stdlib-jre7
; this likely is a bug. They have probably not updated the project generators. Therefore, you have to manually replace the dependencies with working ones until they fix this. This is dependent on the Kotlin plugin. Update it if you haven't. I haven't checked whether it's been patched or not - if it has, that only fixes the creation of new projects. For updating from older versions, the rest of the answer still applies
You naturally have to do this if you're on 1.2.71 or lower, and you're upgrading to 1.3.0 or higher.
These are the new valid dependencies as of Kotlin 1.3.0:
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
Where $kotlinVersion
is either a variable containing the version, or a hard-coded version (i.e. 1.3.0
)
Alternatively, you can use the "plain" stdlib (kotlin-stdlib
) instead of the JDK-specific versions. But you have to change your dependency either way, so I recommend you go with kotlin-stdlib-jdk7
, or if you plan on using Java 8, kotlin-stdlib-jdk8
The newest versions of the dependencies can also be found here. jdk7, jdk8, and the version-unspecific stdlib all follow the same versions (as per this edit - this could change in the future, but there'll likely be notices before that change happens), so whether you check jdk8, jdk7 or the regular one, all the versions should be universally available across the stdlib artifacts.
Note for other build systems
The same actual solution applies to other build systems as well, but the code is different. As there are a lot of build systems, I'm not going to include all of them, but the point is changing the artifact from kotlin-stdlib-jre[num]
to kotlin-stdlib-jdk[num]
(without brackets of course). Or, as mentioned earlier, kotlin-stdlib
.
Independently of the build system, this bases itself on access to Maven Central and similar repositories. If your build system doesn't support this, and/or breaks with Maven-style conventions and repositories, you'll have to find what works for your build system.
TL;DR:
Use org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version
or org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version
(depending on which version you originally used) instead.
ERROR: Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31
You are missing some repositories(jcenter) and some dependencies(kotlin-gradle-plugin). That's why Kotlin cannot be found.
Your build.gradle(Project:android)
file should look something like this:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:3.4.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Android Studio - Could not find org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2
Remove the buildscript
block from your app module build.gradle
. It overrides whatever the top-level build.gradle
provided and it's missing jcenter
repo where Kotlin is.
ERROR: Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8
I think there is no need to use that as you can use kotlin-stdlib directly.
Try this:
In your app level build.gradle
file, under dependencies section:
dependencies{
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.41"
}
Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10-release-894. Help me out someone?
on top level
build.gradle
replace it with a static version number
dependencies
{
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10"
}
Related Topics
How to Control the Scrolling Speed of Recyclerview.Smoothscrolltoposition(Position)
Voice Detection in Android Application
Set Width to Match Constraints in Constraintlayout
Android, How to Create Option Menu
Play Sound Using Soundpool Example
Android Room - Select Query with Like
Remove Vertical Padding from Horizontal Progressbar
Android Show Notification with a Popup on Top of Any Application
Android:Windowsoftinputmode="Adjustresize" Doesn't Make Any Difference
Android Manifest Restrict to Tablets
Android Alarmmanager Not Waking Phone Up
How to Run an Async Task for Every X Mins in Android
How to Import Eclipse Project to Android Studio
How to Get Current Sim Card Number in Android
I Want My Recyclerview to Not Recycle Some Items