Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver

后端 未结 6 1764
悲哀的现实
悲哀的现实 2020-12-03 20:39

I\'m refactoring an app to use androidx. I have struggled to get rid of all the libraries that do not support it. I thought I had removed all the libraries that use the sup

相关标签:
6条回答
  • 2020-12-03 21:03

    Try to MIGRATE to ANDROIDX from the following path in Android Studio:

    (Refactor>Migrate to AndroidX...)

    0 讨论(0)
  • 2020-12-03 21:10

    I think the problem is due to conflicting dependencies. In my case, the problem went away when I removed androidx dependency.

    From:

    dependencies { implementation "androidx.work:work-runtime:2.1.0" }

    To: dependencies { implementation "android.arch.work:work-runtime:1.0.1" }

    This may not be possible if you are too dependendent on androidx.

    0 讨论(0)
  • 2020-12-03 21:13

    I have very similar problem and in my case solution is add in gradle.properties this two lines:

    android.useAndroidX=true
    android.enableJetifier=true
    

    I hope it will help.

    0 讨论(0)
  • 2020-12-03 21:16

    You can use ./gradlew tasks --all to find out which tasks you have. Among them there will be something like yourproject:dependencies, which you can run to get dependency tree like this:

    ./gradlew yourproject:dependencies
    
    0 讨论(0)
  • 2020-12-03 21:26

    I got the same issue while adding,

    dataBinding {
        enabled = true
    }
    

    in app.gradle module. My gradle dependency is as:

    implementation 'androidx.appcompat:appcompat:1.0.0-alpha3'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
    implementation 'com.google.android.material:material:1.0.0-alpha3'
    

    When I changed to,

    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    

    I could get rid out of the error while running the project.

    0 讨论(0)
  • 2020-12-03 21:30

    just marge dependency on AndroidX Library.

    Example: app/build.gradle:

    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    

    to:

    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    

    Than rebuild again, shows many errors. just comment out these old libraries. re-import android x library package. Example below:

    Marge AndroidX: https://developer.android.com/jetpack/androidx/migrate

    I hope to solve your problem.

    0 讨论(0)
提交回复
热议问题