msayan / tutorial-view

Android Tutorial View
MIT License
251 stars 58 forks source link

Compatibility with AndroidX and Kotlin #18

Closed saumya1singh closed 1 year ago

saumya1singh commented 1 year ago

Hey !

I have been trying to use this sweet dependency to beautify my app but seems it ain't working. In the past I have used this in my projects and it worked smooth, seems compatibility issues to me.

Error :

> Task :app:checkDebugDuplicateClasses FAILED

Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.2-runtime (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.2-runtime (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.2-runtime (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.2-runtime (com.android.support:support-compat:27.0.2)

settings.gradle :

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}
rootProject.name = "onboarding"
include ':app'

build.gradle (app) :

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.example.onboarding'
    compileSdk 34

    defaultConfig {
        applicationId "com.example.onboarding"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            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'
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.10.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    implementation 'com.github.msayan:tutorial-view:v1.0.10'
}

cc @smhdk @msayan @ayanmehmet

saumya1singh commented 1 year ago

android.enableJetifier=true

saved me! Closing this :)