g0dkar / qrcode-kotlin

QRCode Generator implemented in pure Kotlin
https://qrcodekotlin.com/
MIT License
172 stars 16 forks source link

Duplicate class conflicts #16

Closed mikucat0309 closed 2 years ago

mikucat0309 commented 2 years ago

Describe the bug I import QRCode library and build in Android Studio Gradle detect a lot of duplicate classes on library com.android.tools.external.com-intellij:intellij-core:30.1.2 full-output: https://pastebin.mozilla.org/upNGVtqc

After that I checking dependency tree using ./gradlew app:dependencies It seems that com.android.tools.external.com-intellij:intellij-core is imported by com.android.tools.lint:lint-gradle

Am I use this library in the wrong way?

To Reproduce Steps to reproduce the behavior. For example:

  1. import this library using implementation 'io.github.g0dkar:qrcode-kotlin-android:3.1.0'
  2. invoke gradle sync
  3. Make project
  4. error

Expected behavior

build sucessfully

Screenshots or other QRCodes rendered with other tools

Additional context

my app:build.gradle

```groovy plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' id 'org.jetbrains.kotlin.plugin.serialization' id 'kotlin-kapt' id 'dagger.hilt.android.plugin' } android { compileSdk 32 defaultConfig { applicationId "at.mikuc.fcuassistant" minSdk 26 targetSdk 32 versionCode 1 versionName "0.1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { useSupportLibrary true } } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } debug { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } buildFeatures { compose true } composeOptions { kotlinCompilerExtensionVersion compose_version } packagingOptions { resources { excludes += '/META-INF/{AL2.0,LGPL2.1}' } } } dependencies { implementation 'androidx.core:core-ktx:1.8.0' implementation "androidx.compose.ui:ui:$compose_version" implementation "androidx.compose.material:material:$compose_version" implementation "androidx.compose.material:material-icons-extended:$compose_version" implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" implementation 'androidx.activity:activity-compose:1.5.0' implementation "androidx.navigation:navigation-compose:$nav_version" api "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation 'com.google.dagger:hilt-android:2.38.1' kapt 'com.google.dagger:hilt-compiler:2.38.1' implementation 'androidx.hilt:hilt-navigation-compose:1.0.0' implementation 'androidx.datastore:datastore-preferences:1.0.0' implementation 'org.burnoutcrew.composereorderable:reorderable:0.9.2' implementation 'io.github.g0dkar:qrcode-kotlin-android:3.1.0' implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.3") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3") implementation("io.ktor:ktor-client-core:$ktor_version") implementation("io.ktor:ktor-client-cio:$ktor_version") implementation("io.ktor:ktor-client-content-negotiation:$ktor_version") implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version") testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version" debugImplementation "androidx.compose.ui:ui-tooling:$compose_version" debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version" } ```
g0dkar commented 2 years ago

Heya! Thanks for getting in touch! I'll take a look and will get back to you as soon as I have something ^^

nexus421 commented 2 years ago

Possible workaround @mikucat0309 Change your Build.gradle import to the following:

implementation ("io.github.g0dkar:qrcode-kotlin-android:3.1.0") { exclude module: 'lint-gradle' } The exclude removed the error for me. So no dupolicate classes anymore.

g0dkar commented 2 years ago

Hey @nexus421, @mikucat0309 and @roinuj39!

I've just released version 3.2.0, it should fix all of those issues! Can you try it out and let me know? ^^

Thanks for the patience, and thanks @nexus421 for the tip on the dependency thing <3

roinuj39 commented 2 years ago

Hey @g0dkar

I updated the version and now I don't see the duplicate class conflict error anymore. Thank you! 🚀

mikucat0309 commented 2 years ago

I've just released version 3.2.0, it should fix all of those issues! Can you try it out and let me know? ^^

It works, thank you! 🌈