How to delete an external library

Asked

Viewed 92 times

-1

How do I delete external libraries that generate version 28 incompatibility.

  • It already deletes manually in the directory. idea/Ibraries and also clicked on them and had them deleted in both cases when I ask Gradle to synchronize they return and the error persists.

I am using the following dependencies

api 'com.android.support:appcompat-v7:28.0.0'
api 'com.android.support:design:28.0.0'
api 'com.google.android.gms:play-services-base:16.1.0'
api 'com.google.android.gms:play-services-vision:17.0.2'

inserir a descrição da imagem aqui

  • 1

    What dependencies are you using?

  • 1

    I edited and put the dependencies in the question, thank you.

  • I edited my reply and put another option which I think the most correct one, if it works rs. Send feedback if you have solved or not.

  • They were both compatible: com.android.support:support-media-compat:26.1.0 and com.android.support:support-v4:26.1.0. The first resolved by adding the com.android.support:support-media-compat:28.0.0 api to the dependencies. The second one didn’t resolve because I’m using with.android.support:appcompat-v7:28.0.0 and doesn’t have com.android.support:support-v4:28.0.0.

  • I edited my reply again, remove the dependency I passed earlier and add the support-v4:28.0.0 . This is from one of the contributors of gms:play-services. It works well for me

1 answer

0

This happens because some libraries depend on the "X or newer" version of the Android support libraries. A documented solution, to avoid conflicts is the following, put this at the end of the build.Radle of the app module:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            details.useVersion '26.1.0'
        }

    }
}

This will solve your problem. Unfortunately some libraries do not yet have a newer version, which causes these conflicts.

Edit1:

What you can try to see is that there is no conflict, and a better solution than the one above is to add the dependency with the minor version that generates the conflict and check if you have the updated version, in your case you have version 28.0.0

Then on dependencies add:

api 'com.android.support:support-v4:28.0.0'

You can see other libraries that have the 26.1.0 version and do the same for them in dependency.

A dependency on.google.android.gms:.....

includes libraries with version 26.1.0 which causes conflict.

So to sum up, the first option transforms the version of all dependencies 'com.android.support'and changes the version to 26.1.0, while the second option adds to the library the latest version of the library that was generating the conflict.

You can see that they themselves help this method:

Githubgoogleplayservices

Browser other questions tagged

You are not signed in. Login or sign up in order to post.