Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
369 views
in Technique[技术] by (71.8m points)

android - org.gradle.internal.resolve.ArtifactNotFoundException: Could not find play-services-basement.aar

I am using 15.0.1 version of Firebase and Google Play Services. The build has started breaking today. How do I fix this? Following is the Gradle logs for reference.

[org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
[org.gradle.internal.buildevents.BuildExceptionReporter]
[org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
[org.gradle.internal.buildevents.BuildExceptionReporter] A problem occurred configuring project ':demo'.
[org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to notify project evaluation listener.
[org.gradle.internal.buildevents.BuildExceptionReporter]    > java.lang.reflect.InvocationTargetException (no error message)
[org.gradle.internal.buildevents.BuildExceptionReporter]
[org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
[org.gradle.internal.buildevents.BuildExceptionReporter]  Run with --scan to get full insights.
[org.gradle.internal.buildevents.BuildExceptionReporter]
[org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
[org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':demo'.
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:89)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:70)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:34)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:110)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:667)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:136)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:261)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:173)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:132)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:115)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:62)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:49)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
[org.gradle.internal.buildevents.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecuti

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I've had the same issue. For whatever reason the play-services-basement library is no longer available in jcenter: https://jcenter.bintray.com/com/google/android/gms/play-services-basement/15.0.1/play-services-basement-15.0.1.aar

In the google repository the version 15.0.1 is still available though. You can search the lib here: https://dl.google.com/dl/android/maven2/index.html

You probably receive the error because you've declared the jcenter() repository before the google() repository. In case a library cannot be resolved in the repository specified first, the build fails with something like this:

> Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
  Searched in the following locations:
      https://jcenter.bintray.com/com/google/android/gms/play-services-basement/15.0.1/play-services-basement-15.0.1.aar

Make sure that you declare the google() repository before jcenter() in your build.gradle file and it should work again:

allprojects {
    repositories {
        google()
        jcenter()
    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...