본문 바로가기
🖥 Programming/📱 Android (Kotlin)

[Android][kotlin] Go to the documentation to learn how to Fix dependency resolution errors.

by MinChan-Youn 2022. 5. 10.

안녕하세요~ 챠니입니다! :)

특별히 관계가 있는것은 아니지만 개발 중 버그내용이 있어서 공유하고자합니다.

 

    버그내용

    버그 내용은 아래와 같습니다.

    Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
    Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
    Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
    Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
    Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
    Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
    Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
    Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
    Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
    Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)

    Go to the documentation to learn how to Fix dependency resolution errors.

     

    무슨 버그지...??? 

    해결을 하기위해 검색해봤지만 내용은 특별히 없었고 다음을 통해서 오류를 해결할 수 있었습니다.

     

     

    해결방법

    해결방법은 아래와 같습니다.

     

     

    gradle.properties 파일을 수정합니다.

    (수정 전)

    # Project-wide Gradle settings.
    # IDE (e.g. Android Studio) users:
    # Gradle settings configured through the IDE *will override*
    # any settings specified in this file.
    # For more details on how to configure your build environment visit
    # http://www.gradle.org/docs/current/userguide/build_environment.html
    # Specifies the JVM arguments used for the daemon process.
    # The setting is particularly useful for tweaking memory settings.
    org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
    # When configured, Gradle will run in incubating parallel mode.
    # This option should only be used with decoupled projects. More details, visit
    # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
    # org.gradle.parallel=true
    # AndroidX package structure to make it clearer which packages are bundled with the
    # Android operating system, and which are packaged with your app"s APK
    # https://developer.android.com/topic/libraries/support-library/androidx-rn
    android.useAndroidX=true
    # Kotlin code style for this project: "official" or "obsolete":
    kotlin.code.style=official
    # Enables namespacing of each library's R class so that its R class includes only the
    # resources declared in the library itself and none from the library's dependencies,
    # thereby reducing the size of the R class for that library
    android.nonTransitiveRClass=true

     

    (수정 후)

    # Project-wide Gradle settings.
    # IDE (e.g. Android Studio) users:
    # Gradle settings configured through the IDE *will override*
    # any settings specified in this file.
    # For more details on how to configure your build environment visit
    # http://www.gradle.org/docs/current/userguide/build_environment.html
    # Specifies the JVM arguments used for the daemon process.
    # The setting is particularly useful for tweaking memory settings.
    org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
    # When configured, Gradle will run in incubating parallel mode.
    # This option should only be used with decoupled projects. More details, visit
    # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
    # org.gradle.parallel=true
    # AndroidX package structure to make it clearer which packages are bundled with the
    # Android operating system, and which are packaged with your app"s APK
    # https://developer.android.com/topic/libraries/support-library/androidx-rn
    android.useAndroidX=true
    # Automatically convert third-party libraries to use AndroidX
    android.enableJetifier=true
    # Kotlin code style for this project: "official" or "obsolete":
    kotlin.code.style=official

     

     

     

    아래 부분을

    android.nonTransitiveRClass=true

    다음으로 변경합니다.

    android.enableJetifier=true

     

    무슨 해결방법인지는 모르겠지만, 프로젝트 설정에서 다음과 같이 만든것이 아닌가 싶습니다.

     

     

     

     

    질문 또는 궁굼한 부분은 댓글을 남겨주세요! 친절하게 답변드리겠습니다!

    응원의 댓글은 저에게 큰 힘이 된답니다! :)

    즐거운 하루되세요!

     

    깃허브 보러 놀러오세요 👇 (맞팔환영)

    https://github.com/younminchan

     

    younminchan - Overview

    안드로이드 2년차 개발자 •⚽️/🎤/🥁/🖥/🏃‍♂️/🚴‍♂️/🤟 TechBlog⬇️ minchanyoun.tistory.com - younminchan

    github.com