Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 305 Vote(s) - 3.37 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15

#11
Using Flutter, it was fixed by:

- Updating Android Studio packages, specially the Kotlin plugin.
- Get the last Kotlin plugin version Nbr from [Gradle - Plugin and versions][1]. For now it's 1.6.10.
- Update *<Your_project_name_folder>\android\build.gradle* file by replacing the old Kotlin version by the new one you got from the web site above.

`ext.kotlin_version = '<The_new_version_Nbr>'` _in my case `ext.kotlin_version = '1.6.10'`_
- Restart Visual Studio Code.

You're done.

[1]:

[To see links please register here]



Reply

#12
I had this problem in a Flutter project.

In my case, a line for *kotlin-gradle-plugin* was missing in the Android *build.gradle* file, so adding `ext.kotlin_version = '1.6.10'` didn’t fix it.

After adding

`classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"`

the error was gone.

Full code section:

buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}



Reply

#13
Just go to file *build.gradle* (Project: yourProjectName).

**Change**

```lang-none
plugins {
...

id 'org.jetbrains.kotlin.android' version '1.5.x' apply false

...
}
```

(1.5.x means x version number at your case, such as 1.5.1.)

**To**

```lang-none
plugins {
...

id 'org.jetbrains.kotlin.android' version '1.7.10' apply false

...
}
```

It works in my case...
Reply

#14
I have faced this error in [IntelliJ IDEA][1] with a Maven project.
The solution is about to turn off Kotlin plugin in IntelliJ IDEA if you are not using Kotlin in your project.

Go to:

Menu *File* → *Settings* → *Plugins*

And turn off the Kotlin plugin by click on the checkbox. See here:

[![Enter image description here][2]][2]


[1]:

[To see links please register here]

[2]:


Reply

#15
I have the set minsdk 24 and restart the Android Studio, its working fine.
Reply

#16
in my case for

> The binary version of its metadata is 1.7.1, expected version is 1.5.1


got to (dependencies) inside build.gradle(project) convert from `1.5.x` (x) in my case is (20)


classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"

to `1.7.10`

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"

Reply

#17
project build.gradle:

ext.kotlin_version = '1.6.10'

app/build.gradle:

dependencies {
// classpath 'com.android.tools.build:gradle:7.1.2'
// classpath "org.jetbrains.kotlin:kotlin-gradle- plugin:$kotlin_version"
}




But after changes ext.kotlin_version to lower this warning stay but the red warning is gone


[![enter image description here][1]][1]


[1]:
Reply

#18
Changed the Project build gradle to

buildscript {
ext.kotlin_version = '1.7.20'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Reply

#19
This works for me

buildscript {
ext.kotlin_version = '1.7.20'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Reply

#20
Although this question has been answered, I think it's worth explaining what is happening
---------
For the example:

The binary version of its metadata is 1.7.1, expected version is 1.5.1.

The `expected` version is the Kotlin for `kotlin-gradle-plugin`

The `binary` version is the what is downloaded (or previously compiled)
for `com.android.tools.build:gradle`

**<project_dir>/android/build.gradle**

buildscript {
ext.kotlin_version = '1.5.20' // <= expected version is 1.5.1
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1' // downloads 1.7.1 Metadata
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // <= 1.5.20 used here

Why is this Happening So Much?
-------
1. The user updates the Kotlin version of the plugin to match the IDE version per the warning.

[![Warning from Android Studio to match Kotlin Versions][1]][1]


2. The user updates the android build tools gradle plugin per the warning

[![Warning about android build tools][2]][2]

***This is the WRONG version!***

Now you don't have any warnings, but the version suggested is `7.1.3` which is not the latest. (I don't know why it suggests this older version) `7.3.1` is currently the latest and is meta data `1.7.1`, so it will match the Kotlin version of `1.7.20` (which is also metadata `1.7.1`)

What else could be wrong?
-----
Due to caching, gradle may be using an older dependency before you updated. To start clean:
1. delete the ~/.gradle/cache directory
2. delete the android/.gradle directory
3. delete the project_dir/build dir
4. ensure the `android/gradle/gradle-wrapper.properies` has the correct `distributionUrl` (currently `distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip`)
5. from project_dir do `flutter build apk`

NOTE: your dependencies may need to be updated if their `com.android.tools.build:gradle` version is too old. Alternatively, both the kotlin and `tools:gradle` versions can be downgraded to compatible version that match metadata (although Android Studio will warn for that not matching the IDE Kotlin version)

How to Prevent this from happening Again?
-----

* Use the same Kotlin version as the IDE normally for `ext.kotlin_version`. see

[To see links please register here]


* Double check the `com.android.tools.build:gradle` version. See

[To see links please register here]

and

[To see links please register here]



[1]:

[2]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through