Has anyone solved this issue?
kotlin version that is used for building with gradle (1.1.2-5) differs from the one bundled into the IDE plugin (1.1.2-4)
I am using AS 3.0 Canary 4
Has anyone solved this issue?
kotlin version that is used for building with gradle (1.1.2-5) differs from the one bundled into the IDE plugin (1.1.2-4)
I am using AS 3.0 Canary 4
In my case, I converted Java to Kotlin and I have already Kotlin installed with lower version. So I updated it.
Tools
-> Kotlin
-> Configure Kotlin Plugin Updates
then Check for updates now
then choose Stable
But it didn't update my version in the build.gradle
file automatically. Because it detected a newer version and differs from the old one.
So I manually updated my version to the latest from
ext.kotlin_version = '1.0.0'
to ext.kotlin_version = '1.2.41'
buildscript {
ext.kotlin_version = '1.2.41'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
There's an issue in Android Studio 3.0 Canary 4 that prevents it from loading the updated version of the Kotlin plugin. You can ignore the warning shown by the Kotlin plugin in build.gradle until a newer version of Android Studio 3.0 is released.
I also had the same issue, I am using Android Studio 3.2.1
Change the Kotlin version of your project build.gradle file(not module build.gradle file) to latest(at the moment it is 1.3.11)
ext.kotlin_version = '1.3.11'
then there will be notification call Kotlin migration, click Run migrations link on the notification.
1): Open your project in Android mode.
2): Go to build.gradle file(Project: android) level, which is also located below the gradle folder in Project mode and open it.
3): It will start with something like this
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
4): See that in above example that the
ext.kotlin_version = '1.7.10'
5): Now go to File menu in the Top-Left of Android Studio and open Settings.
6): Click on Plugins and select Installed on the top of the settings window.
7): Now scroll down to Kotlin, select it and see it's version, for example:-
221-1.8.0-release-for-android-studio-AS5591.52.
8): Here 1.8.0 is your Android Studio Kotlin plugin version, which is different from your ext.kotlin_version
in build.gradle
.
9): So, just make your ex.kotlin_version same as Kotlin plugin version and you're good to go!
10): In above example the ex.kotlin_version = is '1.7.10 and Kotlin Plugin version is '1.8.0'. If I type '1.8.0' in my ex.kotlin_version, making my plugin version same as ex.kotlin_version and sync it, the issue gets resolved. Hope this helps!, I,m also new in flutter.
Go to plugins then uninstall kotlin then restart ide then once android studio is back up drop down tools then select kotline then configure updates, it should be checking for new updates.
add this in your build gradle app
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'