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

社会主义新天地 提交于 2019-12-19 12:51:41

问题


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/studio/build/gradle-plugin-3-0-0-migration?utm_source=android-studio#new_configurations but when sync and build, i got a build error related to google-http-client-parent:1.24.1 stating it is not present in repositories Maven or Jcenter (indeed this version doesnt exist yet)

In my app gradle i am only using com.google.http-client:google-http-client-android:1.23.0 and i have no libraries with such 1.24.1 version so after hours of research i still dont understand the origin of this error.

The log is as per below :

> org.gradle.api.UncheckedIOException: Failed to capture snapshot of
> input files for task ':backend:compileJava' property 'classpath'
> during up-to-date check.  at
> org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.snapshotTaskFiles(CacheBackedTaskHistoryRepository.java:333)
>   at
> org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.createExecution(CacheBackedTaskHistoryRepository.java:154)
>   at
> org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.access$100(CacheBackedTaskHistoryRepository.java:61)
>   at
> org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository$1.getCurrentExecution(CacheBackedTaskHistoryRepository.java:114)
>   at
> org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:201)
>   at
> org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:86)
>   at
> org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:53)
>   at
> org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
>   at
> org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
>   at
> org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
>   at
> org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
>   at
> org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
>   at
> org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
>   at
> org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
>   at
> org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
>   at
> org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
>   at
> org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
>   at
> org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
>   at
> org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
>   at
> org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
>   at
> org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
>   at
> org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
>   at
> org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
>   at
> org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
>   at
> org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
>   at
> org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
>   at
> org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
>   at
> org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
>   at
> org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
>   at
> org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
>   at
> org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
>   at
> org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
>   at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at
> org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
>   at java.lang.Thread.run(Thread.java:745) Caused by:
> org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException:
> Could not resolve all files for configuration
> ':backend:compileClasspath'.  at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:918)
>   at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1600(DefaultConfiguration.java:116)
>   at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:892)
>   at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:404)
>   at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown
> Source)   at
> org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:68)
>   at
> org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter$FileCollectionVisitorImpl.visitCollection(AbstractFileCollectionSnapshotter.java:70)
>   at
> org.gradle.api.internal.file.AbstractFileCollection.visitRootElements(AbstractFileCollection.java:234)
>   at
> org.gradle.api.internal.file.CompositeFileCollection.visitRootElements(CompositeFileCollection.java:185)
>   at
> org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter.snapshot(AbstractFileCollectionSnapshotter.java:53)
>   at
> org.gradle.api.internal.changedetection.state.DefaultCompileClasspathSnapshotter.snapshot(DefaultCompileClasspathSnapshotter.java:38)
>   at
> org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.snapshotTaskFiles(CacheBackedTaskHistoryRepository.java:331)
>   ... 35 more Caused by:
> org.gradle.internal.resolve.ModuleVersionResolveException: Could not
> resolve com.google.http-client:google-http-client-jackson2:[1.19,2.0).
> Required by:
>     project :backend > com.google.appengine.tools:appengine-gcs-client:0.4.4  at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver.resolve(DynamicVersionResolver.java:99)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyToComponentIdResolver.resolve(RepositoryChainDependencyToComponentIdResolver.java:61)
>   at
> org.gradle.api.internal.artifacts.ivyservice.resolveengine.ComponentResolversChain$DependencyToComponentIdResolverChain.resolve(ComponentResolversChain.java:149)
>   at
> org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DependencySubstitutionResolver.resolve(DependencySubstitutionResolver.java:46)
>   at
> org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.SelectorState.resolveModuleRevisionId(SelectorState.java:99)
>   at
> org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.resolveModuleRevisionId(EdgeState.java:91)
>   at
> org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.performSelectionSerially(DependencyGraphBuilder.java:261)
>   at
> org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolveEdges(DependencyGraphBuilder.java:226)
>   at
> org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:143)
>   at
> org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:109)
>   at
> org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver.resolve(DefaultArtifactDependencyResolver.java:90)
>   at
> org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolveGraph(DefaultConfigurationResolver.java:146)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolveGraph(ShortCircuitEmptyConfigurationResolver.java:73)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveGraph(ErrorHandlingConfigurationResolver.java:66)
>   at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$4.run(DefaultConfiguration.java:483)
>   at
> org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
>   at
> org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
>   at
> org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
>   at
> org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
>   at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:474)
>   at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:459)
>   at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1700(DefaultConfiguration.java:116)
>   at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getSelectedArtifacts(DefaultConfiguration.java:901)
>   at
> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:889)
>   ... 44 more Caused by:
> org.gradle.internal.resolve.ModuleVersionResolveException: Could not
> resolve com.google.http-client:google-http-client-jackson2:1.24.1.    at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.resolveComponentMetaData(ErrorHandlingModuleComponentRepository.java:129)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver$CandidateResult.process(DynamicVersionResolver.java:354)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver$CandidateResult.resolve(DynamicVersionResolver.java:342)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver$CandidateResult.tryResolveMetadata(DynamicVersionResolver.java:365)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver$CandidateResult.access$400(DynamicVersionResolver.java:299)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver$RepositoryResolveState.matches(DynamicVersionResolver.java:255)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DefaultVersionedComponentChooser.selectNewestMatchingComponent(DefaultVersionedComponentChooser.java:87)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver$RepositoryResolveState.selectMatchingVersionAndResolve(DynamicVersionResolver.java:248)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver$RepositoryResolveState.resolve(DynamicVersionResolver.java:237)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver.findLatestModule(DynamicVersionResolver.java:140)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver.findLatestModule(DynamicVersionResolver.java:121)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver.resolve(DynamicVersionResolver.java:88)
>   ... 67 more Caused by:
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.MetaDataParseException:
> Could not parse POM
> https://jcenter.bintray.com/com/google/http-client/google-http-client-jackson2/1.24.1/google-http-client-jackson2-1.24.1.pom
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.AbstractModuleDescriptorParser.parseDescriptor(AbstractModuleDescriptorParser.java:54)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.AbstractModuleDescriptorParser.parseMetaData(AbstractModuleDescriptorParser.java:43)
>   at
> org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver.parseMetaDataFromResource(MavenResolver.java:269)
>   at
> org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver.parseMetaDataFromResource(MavenResolver.java:65)
>   at
> org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.parseMetaDataFromArtifact(ExternalResourceResolver.java:222)
>   at
> org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver.parseMetaDataFromArtifact(MavenResolver.java:170)
>   at
> org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver.parseMetaDataFromArtifact(MavenResolver.java:65)
>   at
> org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.resolveStaticDependency(ExternalResourceResolver.java:193)
>   at
> org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver.doResolveComponentMetaData(MavenResolver.java:145)
>   at
> org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.resolveComponentMetaData(ExternalResourceResolver.java:467)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$ResolveAndCacheRepositoryAccess.resolveComponentMetaData(CachingModuleComponentRepository.java:363)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.BaseModuleComponentRepositoryAccess.resolveComponentMetaData(BaseModuleComponentRepositoryAccess.java:50)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedModuleComponentRepository$CachedAccess.resolveComponentMetaData(InMemoryCachedModuleComponentRepository.java:95)
>   at
> org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.resolveComponentMetaData(ErrorHandlingModuleComponentRepository.java:126)
>   ... 78 more Caused by:
> org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not
> find com.google.http-client:google-http-client-parent:1.24.1. Searched
> in the following locations:
>     https://jcenter.bintray.com/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
>     https://jcenter.bintray.com/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
>     https://dl.google.com/dl/android/maven2/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
>     https://dl.google.com/dl/android/maven2/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
>     https://maven.google.com/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
>     https://maven.google.com/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
>     https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
>     https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
>     https://maven-central.storage.googleapis.com/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.pom
>     https://maven-central.storage.googleapis.com/com/google/http-client/google-http-client-parent/1.24.1/google-http-client-parent-1.24.1.jar
>   at
> org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult.notFound(DefaultBuildableComponentResolveResult.java:38)
>   at

>   ... 101 more

My app gradle :

apply plugin: 'com.android.application'

buildscript {
    repositories {
        mavenCentral()

        jcenter()
        maven { url 'https://maven.fabric.io/public' }
        google()
    }
    dependencies {

        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.github.nrudenko:gradle-android-cq-plugin:0.1+'
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.2'
    }
}

repositories {
    mavenCentral()
    maven { url 'http://wordpress-mobile.github.io/WordPress-Android' }
    maven { url 'https://maven.fabric.io/repo' }
    maven { url 'https://github.com/leonardocardoso/mvn-repo/raw/master/maven-deploy' }
    maven { url "https://jitpack.io" }
    maven { url 'https://oss.sonatype.org/content/groups/public' }
    jcenter()
}

//


apply plugin: 'android-cq'
apply plugin: 'io.fabric'



android {

    packagingOptions {
        exclude "META-INF/LICENSE.txt"
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude "META-INF/NOTICE.txt"
    }

    compileSdkVersion 26

    defaultConfig {
        applicationId "com.example.app"
        minSdkVersion 16
        targetSdkVersion 26
        renderscriptTargetApi 24//added for BlurKit
        renderscriptSupportModeEnabled true //added for BlurKit
        //minifyEnabled true
        multiDexEnabled true
        buildConfigField "String", "APP_PN_KEY", "\"org.wordpress.android.playstore\""
    }

    // Specifies flavor dimensions.
    flavorDimensions "minApi"
    productFlavors {
        // Define separate dev and prod product flavors.

        minApi19 {
            dimension "minApi"
            minSdkVersion 19
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt', 'proguard-google-api-client.txt'

        }

        debug {
            buildConfigField "String", "APP_PN_KEY", "\"org.wordpress.android.debug.build\""
            ext.enableCrashlytics = false
        }

    }

   useLibrary 'org.apache.http.legacy'

    dexOptions {
        javaMaxHeapSize "4g"
        preDexLibraries = false //http://stackoverflow.com/questions/33717886/errorexecution-failed-for-task-apptransformclasseswithdexfordebug
    }

    lintOptions {
        abortOnError false
    }

}


dependencies {

    implementation 'com.android.support:multidex:1.0.3'

    implementation (project(path: ':OCR2016')){
        exclude group: 'supportDependencies'
    }
    implementation (project(':pagerTabSliding')){
        exclude group: 'com.android.support'
    }
    implementation project(':quickScroll')
    implementation project(':pinnedSectionListLibrary')
    implementation (project(':sectionCursorAdapterLibrary')){
        exclude group: 'com.android.support'
    }
    implementation (project(':mainActivityZxing')){
        exclude group: 'com.android.support'
    }
    implementation (project(':libraryObservableScrollView')){
        exclude group: 'com.android.support'
    }
    implementation (project(':libraryFloatingButton')){
        exclude group: 'com.android.support'
    }
    implementation project(':simplequickaction')
    implementation (project(':keyboardemojicon')){
        exclude group: 'com.android.support'
    }
    implementation project(':simplecropimagelib')
    implementation (project(':cardstack')){
        exclude group: 'com.android.support'
    }
    implementation (project(path: ':cardstackview')){
        exclude group: 'com.android.support'
    }

    implementation('org.wordpress:mediapicker:1.2.4') {
        exclude group: 'com.android.support'
    }

    // Provided by project library
    implementation (project(path: ':libs:utils:WordPressUtils')){
        exclude group: 'com.android.support'
        exclude group: 'commons-lang'
    }


    implementation (project(path: ':libs:networking:WordPressNetworking')){
        exclude group: 'com.android.support'
    }

    implementation project(path: ':libs:wpcomrest:WordPressComRest')
    implementation project(path: ':libs:graphview:WordPressGraphView')
    implementation project(path: ':libs:persistentedittext:PersistentEditText')
     implementation (project(path: ':libs:analytics:WordPressAnalytics')){
        exclude group: 'com.android.support'
    }
    implementation (project(path: ':libs:editor:WordPressEditor')){
        exclude group: 'com.android.support'
    }
    implementation 'com.google.code.gson:gson:2.8.0'
    implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'

    implementation supportDependencies.supportcompat
    implementation supportDependencies.cardViewV7
    implementation supportDependencies.recyclerViewV7
    implementation supportDependencies.appcompatV7
    implementation supportDependencies.supportV4
    implementation supportDependencies.paletteV7
    implementation supportDependencies.supportAnnotations
    implementation (supportDependencies.design) {
        exclude(group: 'com.android.support', module:'support-annotations')
    }
    implementation (supportDependencies.supportV13) {
        exclude(group: 'com.android.support', module:'support-annotations')
    }

    implementation 'com.github.chrisbanes.photoview:library:1.2.3'
    implementation 'com.helpshift:android-aar:3.7.2'
    implementation 'commons-lang:commons-lang:2.6'
    implementation 'de.greenrobot:eventbus:2.4.0'
    implementation 'com.mcxiaoke.volley:library:1.0.+'

    implementation 'org.wordpress:gcm:1.0.0'
    implementation 'org.wordpress:drag-sort-listview:0.6.1'
    implementation 'org.wordpress:slidinguppanel:1.0.0'
    implementation 'org.wordpress:android-passcodelock:0.0.6'
    implementation 'org.wordpress:emailchecker:0.3'
    implementation 'com.simperium.android:simperium:0.6.3'


    implementation 'com.squareup.okhttp:okhttp:2.3.0'

    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    implementation 'com.github.paolorotolo:appintro:4.1.0'

    implementation 'org.jsoup:jsoup:1.8.3'
    // required
    implementation 'com.leocardz:link-preview:1.2.1@aar'
    implementation 'com.google.android.gms:play-services-maps:15.0.1' //11.6.0
    implementation 'com.google.android.gms:play-services-places:15.0.1'
    implementation 'com.google.android.gms:play-services-identity:15.0.1'
    implementation 'com.google.android.gms:play-services-gcm:15.0.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'//10/11/2017 added by david, check that there is no clash with other library
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.github.Angtrim:Android-Five-Stars-Library:v3.1'
    implementation 'com.flurgle:blurkit:1.1.1'
    //implementation 'ru.egslava:blurredview:1.0'
    implementation('com.mikepenz:aboutlibraries:6.0.0@aar') {
        transitive = true
    }
    //used to provide different itemAnimators for the RecyclerView
    //https://github.com/mikepenz/ItemAnimators
    implementation 'com.mikepenz:itemanimators:0.5.0@aar'
    //implementation 'me.mvdw.recyclerviewmergeadapter:recyclerviewmergeadapter:2.0.0'
    implementation 'com.github.viethoa:fastscroller:1.2.0'
    implementation 'com.github.danylovolokh:hashtag-helper:1.1.0'

    //Mopub : With the modular SDK, you can choose to include specific formats to decrease overall SDK footprint in your app
    // For banners
    implementation('com.mopub:mopub-sdk-banner:4.11.0@aar') {
        transitive = true
        exclude(group: 'com.android.support', module:'support-annotations')
    }
    // For native static (images).
    implementation('com.mopub:mopub-sdk-native-static:4.11.0@aar') {
        transitive = true
        exclude(group: 'com.android.support', module: 'support-annotations')
    }


    // Endpoints Frameworks V2: Endpoints Framework v2 migration
    endpointsServer project(path: ':appbackend', configuration: 'endpoints')
    implementation ('com.google.http-client:google-http-client-android:1.23.0')  {
        exclude(group: 'com.google.android', module: 'android')
        exclude(group: 'com.google.code.findbugs')
    }

    // Add the Google API client library.
    implementation(group: 'com.google.api-client', name: 'google-api-client', version: '1.23.0') {
        exclude(group: 'com.google.code.findbugs')
        exclude(group: 'xpp3', module: 'xpp3')
        exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
        exclude(group: 'junit', module: 'junit')
        exclude(group: 'com.google.android', module: 'android')
    }

}


apply plugin: 'com.google.gms.google-services'


configurations.all {

    exclude group: "org.apache.httpcomponents", module: "httpclient"
    exclude group: 'org.wordpress', module: 'utils'
    exclude group: 'org.wordpress', module: 'analytics'
    exclude module: 'annotations' 
}

// For app signing
if (["storeFile", "storePassword", "keyAlias", "keyPassword"].count {
    !project.hasProperty(it)
} == 0) {
    android {
        signingConfigs {
            release {
                storeFile = file(project.storeFile)
                storePassword = project.storePassword
                keyAlias = project.keyAlias
                keyPassword = project.keyPassword
            }
        }
    }
    android.buildTypes.release.signingConfig = android.signingConfigs.release

}

回答1:


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!




回答2:


Someone messed up.

I checked here: https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client-parent/

The 1.24.1 version is missing.




回答3:


maintainer for com.google.http-client:google-http-client-parent here. During a release yesterday, a pom.xml was somehow released. All other artifacts seem fine AFAICT minus this one pom. Sincere apologies for the hassle.

We have pushed a fix to this problem (manually release the missing pom.xml). Please try now and let me know if 1.24.1 does not work. We generally track issues at https://github.com/google/google-http-java-client/issues.




回答4:


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.




回答5:


I just had a similar problem, to solve it I googled and found out people suggesting to add 'google()' Gradle could not find dependency com.google.android.gms:play-services, but probably you have already done it since you followed the instructions.

In my case it wasnt enough, I noticed that i was using something that required a higher SdKVersion, so i just had to increase it to the right minSdkVersion.




回答6:


Solved for me!

if you have this line in your gradle

      compile 'com.google.api-client:google-api-client-android:+'

change it to

      compile 'com.google.api-client:google-api-client-android:1.22.0'

or any other valid version in place of 1.22.0




回答7:


In my case the issue was with this line in the backend gradle file

compile 'com.google.appengine.tools:appengine-gcs-client:0.7'

After commenting out this and commenting the code linked with GCS my Build worked fine. It's referring to the com.google.http-client:google-http-client-parent:1.24.1




回答8:


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




回答9:


Try using a different library for eg google-api-client-android:1.22.0 this should work



来源:https://stackoverflow.com/questions/51623523/android-plugin-for-gradle-3-0-0-could-not-find-com-google-http-clientgoogle-h

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!