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:
  • 454 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Duplicate class in Kotlin Android

#11
Upgrade kotlin android plugin and kotlin compiler
```groovy
plugins {
id 'org.jetbrains.kotlin.android' version '1.8.10'
}
android {
composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
}
}
```
Reply

#12
I was getting same error after upgrading android annotation libray from ver 1.4.0 to 1.6.0,

implementation 'androidx.annotation:annotation:1.6.0'

So I downgraded to 1.5.0 and error gone

implementation 'androidx.annotation:annotation:1.5.0'

Hope this helps you too
Reply

#13
The accepted answer worked for me, but the Kotlin DSL syntax is:
```kt
kotlin("android").version("1.8.10").apply(false)
```
Reply

#14
I first tried David Fraser's solution (constraints {...}) and it worked fine, but I found it strange and discarded it.
Instead I changed the plugins as follows:

id 'org.jetbrains.kotlin.multiplatform' version '1.8.0' apply false // before 1.7.10

This also fixed the error.
Reply

#15
Replace this

implementation("androidx.navigation:navigation-compose:2.6.0-alpha06")

With

implementation("androidx.navigation:navigation-compose:2.6.0-alpha04")
Reply

#16
I was using `org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10` before in our SDK and then I updated kotlin to v1.8.0 and that's when I started getting the above error in our Android Java front end application.
Using `org.jetbrains.kotlin:kotlin-bom` resolved the issue with transitive dependencies and might be a cleaner approach since it doesn't leak Kotlin details into the Java application.

so I just replaced
```
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10"
```

with below which solved the problem for me.

```
// Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.0"
```
Reply

#17
It is maybe some updated version dependency. In my new compose app, when i updated

> implementation 'androidx.compose.material3:material3:*'(new version)
> from 1.0.0-alpha11

I will got this error. Try revert updated dependency.

Also I was getting this error when `android studio` add in my gradle modules `ktx:+` dependency
Reply

#18
I had the same errors in my project. What finally helped me was the following steps

1-I have updated the buildScript: as below

buildscript {
ext {
compose_ui_version = '1.3.3'
}
}
then change pluggin
From

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

}

To

plugins {
....
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
}

lastly updated in build.grade(app)

Change in android scope {}
```
android {
......
composeOptions {
kotlinCompilerExtensionVersion '1.2.0'
}
.......
}
```
To the following and the errors were gone

composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
}

Hope it helps someone else
Reply

#19
I have tried all the previous solutions but after adding the below code it was working.

dependencies {
... ... ...
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
... ... ...
}

Reply

#20
Replace

`classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20"`

With

`classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10"`

And then If you used `kotlin-android-extensions` plugin, then remove this line. And use `View binding` to whole project.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

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