Android Plugin for Gradle 3.0.0 : Could not find com.google.http-client:google-http-client-parent:1.24.1

后端 未结 9 700
情歌与酒
情歌与酒 2021-01-17 11:43

I had to migrate my android project to new version of Android Studio and Android pluging for Gradle.

I followed all instructions at https://developer.android.com/stu

相关标签:
9条回答
  • 2021-01-17 12:22

    I had this issue with maven in an app engine project today, one of the third party libraries I am using appengine-gcs-client depends on the library google-http-client and its using version 1.24.1 which obviously had been removed as you can see from other answers.... Here is how I solved it using maven

    I excluded the google-http-client from the library that depends on it i.e appengine-gcs-client using the following xml code in my pom.xml

       <dependency>
            <groupId>com.google.appengine.tools</groupId>
            <artifactId>appengine-gcs-client</artifactId>
            <version>0.7</version>
            <exclusions>             
                <exclusion>
                    <groupId>com.google.http-client</groupId>
                    <artifactId>google-http-client</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    

    then I give maven the version to use when the google-http-client library is required, this version is just a back dated version from version 1.24.1 which is 1.23.0

            <dependency>
                <groupId>com.google.http-client</groupId>
                <artifactId>google-http-client-jackson2</artifactId>
                <version>1.23.0</version>
            </dependency>
    

    then just run mvn clean install

    this solved the problem for me and it should work for you if you have a third party library that depends on the google-http-client-parent:1.24.1 that is missing.

    you could look up how to exclude dependencies using gradle from the following link How to exclude dependencies in gradle

    0 讨论(0)
  • 2021-01-17 12:24

    As the com.google.http-client:google-http-client-parent:1.24.1 has been removed from the maven central repository, it started throwing the error.

    In such case, whatever the jars using this reference, can be downgraded to point the older version of google-http-client-parent. That could solve the problem for now.

    In your case, com.google.appengine.tools:appengine-gcs-client:0.4.4 is using the reference of com.google.http-client:google-http-client-parent:1.24.1

    Try downgrading it to 0.4 that should solve the problem.

    Hope this helps!

    0 讨论(0)
  • 2021-01-17 12:24

    some one forgot to add 1.24.1 in repository so that while building the project gradle can download that, we should wait till google update the same.

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