当我将Android项目中的Gradle升级到版本4时,我们遇到此错误并无法修复它.
错误详情:
More than one variant of project :volley matches the consumer attributes: - Configuration ':volley:deBUGAPIElements' variant androID-aIDl: - Found artifactType 'androID-aIDl' but wasn't required. - required com.androID.build.API.attributes.BuildTypeAttr 'deBUG' and found compatible value 'deBUG'. - Found com.androID.build.API.attributes.VariantAttr 'deBUG' but wasn't required. - required com.androID.build.gradle.internal.dependency.AndroIDTypeAttr 'Aar' and found compatible value 'Aar'. - required org.gradle.usage 'java-API' and found compatible value 'java-API'. - Configuration ':volley:deBUGAPIElements' variant androID-classes: - Found artifactType 'androID-classes' but wasn't required. - required com.androID.build.API.attributes.BuildTypeAttr 'deBUG' and found compatible value 'deBUG'. - Found com.androID.build.API.attributes.VariantAttr 'deBUG' but wasn't required. - required com.androID.build.gradle.internal.dependency.AndroIDTypeAttr 'Aar' and found compatible value 'Aar'. - required org.gradle.usage 'java-API' and found compatible value 'java-API'. - Configuration ':volley:deBUGAPIElements' variant androID-manifest: - Found artifactType 'androID-manifest' but wasn't required. - required com.androID.build.API.attributes.BuildTypeAttr 'deBUG' and found compatible value 'deBUG'. - Found com.androID.build.API.attributes.VariantAttr 'deBUG' but wasn't required. - required com.androID.build.gradle.internal.dependency.AndroIDTypeAttr 'Aar' and found compatible value 'Aar'. - required org.gradle.usage 'java-API' and found compatible value 'java-API'. - Configuration ':volley:deBUGAPIElements' variant androID-renderscript: - Found artifactType 'androID-renderscript' but wasn't required. - required com.androID.build.API.attributes.BuildTypeAttr 'deBUG' and found compatible value 'deBUG'. - Found com.androID.build.API.attributes.VariantAttr 'deBUG' but wasn't required. - required com.androID.build.gradle.internal.dependency.AndroIDTypeAttr 'Aar' and found compatible value 'Aar'. - required org.gradle.usage 'java-API' and found compatible value 'java-API'. - Configuration ':volley:deBUGAPIElements' variant jar: - Found artifactType 'jar' but wasn't required. - required com.androID.build.API.attributes.BuildTypeAttr 'deBUG' and found compatible value 'deBUG'. - Found com.androID.build.API.attributes.VariantAttr 'deBUG' but wasn't required. - required com.androID.build.gradle.internal.dependency.AndroIDTypeAttr 'Aar' and found compatible value 'Aar'. - required org.gradle.usage 'java-API' and found compatible value 'java-API'.———————————org.gradle.API.ProjectConfigurationException: A problem occurred configuring project ':app'. at org.gradle.configuration.project.lifecycleProjectEvaluator.addConfigurationFailure(lifecycleProjectEvaluator.java:94) at org.gradle.configuration.project.lifecycleProjectEvaluator.notifyAfterEvaluate(lifecycleProjectEvaluator.java:89) at org.gradle.configuration.project.lifecycleProjectEvaluator.doConfigure(lifecycleProjectEvaluator.java:70) at org.gradle.configuration.project.lifecycleProjectEvaluator.access0(lifecycleProjectEvaluator.java:34) at org.gradle.configuration.project.lifecycleProjectEvaluator$ConfigureProject.run(lifecycleProjectEvaluator.java:110) 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.configuration.project.lifecycleProjectEvaluator.evaluate(lifecycleProjectEvaluator.java:50) at org.gradle.API.internal.project.DefaultProject.evaluate(DefaultProject.java:666) at org.gradle.API.internal.project.DefaultProject.evaluate(DefaultProject.java:135) at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35) at org.gradle.execution.TaskPathProjectEvaluator.configureHIErarchy(TaskPathProjectEvaluator.java:62) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38) at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:249) 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.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:167) at org.gradle.initialization.DefaultGradleLauncher.dobuildStages(DefaultGradleLauncher.java:126) at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.java:104) at org.gradle.internal.invocation.GradleBuildController.call(GradleBuildController.java:87) at org.gradle.internal.invocation.GradleBuildController.call(GradleBuildController.java:84) at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152) at org.gradle.internal.invocation.GradleBuildController.dobuild(GradleBuildController.java:100) at org.gradle.internal.invocation.GradleBuildController.configure(GradleBuildController.java:84) at org.gradle.tooling.internal.provIDer.runner.ClIEntProvIDedBuildActionRunner.run(ClIEntProvIDedBuildActionRunner.java:64) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.tooling.internal.provIDer.ValIDatingBuildActionRunner.run(ValIDatingBuildActionRunner.java:32) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:43) 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.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40) at org.gradle.tooling.internal.provIDer.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30) at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39) at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25) at org.gradle.tooling.internal.provIDer.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80) at org.gradle.tooling.internal.provIDer.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53) at org.gradle.tooling.internal.provIDer.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57) at org.gradle.tooling.internal.provIDer.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32) at org.gradle.tooling.internal.provIDer.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36) at org.gradle.tooling.internal.provIDer.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25) at org.gradle.tooling.internal.provIDer.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43) at org.gradle.tooling.internal.provIDer.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29) at org.gradle.tooling.internal.provIDer.StartParamsValIDatingActionExecuter.execute(StartParamsValIDatingActionExecuter.java:69) at org.gradle.tooling.internal.provIDer.StartParamsValIDatingActionExecuter.execute(StartParamsValIDatingActionExecuter.java:30) at org.gradle.tooling.internal.provIDer.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59) at org.gradle.tooling.internal.provIDer.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44) at org.gradle.tooling.internal.provIDer.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45) at org.gradle.tooling.internal.provIDer.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.dobuild(ExecuteBuild.java:67) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.WatchFordisconnection.execute(WatchFordisconnection.java:37) at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.resetDeprecationLogger.execute(resetDeprecationLogger.java:26) at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.ForwardClIEntinput.call(ForwardClIEntinput.java:74) at org.gradle.launcher.daemon.server.exec.ForwardClIEntinput.call(ForwardClIEntinput.java:72) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClIEntinput.execute(ForwardClIEntinput.java:72) at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.LogToClIEnt.dobuild(LogToClIEnt.java:62) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.dobuild(EstablishBuildEnvironment.java:82) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.StartBuildOrResponDWithBusy.run(StartBuildOrResponDWithBusy.java:50) at org.gradle.launcher.daemon.server.DaemonStateCoordinator.run(DaemonStateCoordinator.java:295) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl.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.artifacts.ResolveException: Could not resolve all dependencIEs for configuration ':app:deBUGCompileClasspath'. at org.gradle.API.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.wrapException(ErrorHandlingConfigurationResolver.java:96) at org.gradle.API.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.access0(ErrorHandlingConfigurationResolver.java:45) at org.gradle.API.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver$ErrorHandlingResolvedConfiguration.getResolvedArtifacts(ErrorHandlingConfigurationResolver.java:298) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at org.codehaus.groovy.runtime.Metaclass.MethodMetaProperty$GetBeanMethodMetaProperty.getProperty(MethodMetaProperty.java:76) at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:64) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296) at com.Google.gms.Googleservices.GoogleServicesPlugin$_failOnVersionConflictForGroup_closure13.doCall(GoogleServicesPlugin.groovy:399) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at org.codehaus.groovy.runtime.Metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022) at groovy.lang.Closure.call(Closure.java:414) at groovy.lang.Closure.call(Closure.java:430) at org.gradle.API.internal.ClosureBackedAction.execute(ClosureBackedAction.java:71) at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:160) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:106) at org.gradle.util.ConfigureUtil.execute(ConfigureUtil.java:123) at org.gradle.internal.ImmutableActionSet$CompositeSet.execute(ImmutableActionSet.java:196) at org.gradle.internal.MutableActionSet.execute(MutableActionSet.java:35) at org.gradle.API.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:204) at org.gradle.API.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:198) at com.androID.build.gradle.AppExtension.addVariant(AppExtension.java:79) at com.androID.build.gradle.internal.APIObjectFactory.create(APIObjectFactory.java:132) at com.androID.build.gradle.BasePlugin.lambda$createAndroIDTasks(BasePlugin.java:760) at com.androID.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81) at com.androID.build.gradle.BasePlugin.createAndroIDTasks(BasePlugin.java:746) at com.androID.build.gradle.BasePlugin.lambda$null(BasePlugin.java:652) at com.androID.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81) at com.androID.build.gradle.BasePlugin.lambda$createTasks(BasePlugin.java:648) at org.gradle.internal.event.broadcastdispatch$ActionInvocationHandler.dispatch(broadcastdispatch.java:91) at org.gradle.internal.event.broadcastdispatch$ActionInvocationHandler.dispatch(broadcastdispatch.java:80) at org.gradle.internal.event.Abstractbroadcastdispatch.dispatch(Abstractbroadcastdispatch.java:42) at org.gradle.internal.event.broadcastdispatch$Singletondispatch.dispatch(broadcastdispatch.java:230) at org.gradle.internal.event.broadcastdispatch$Singletondispatch.dispatch(broadcastdispatch.java:149) at org.gradle.internal.event.Abstractbroadcastdispatch.dispatch(Abstractbroadcastdispatch.java:58) at org.gradle.internal.event.broadcastdispatch$Compositedispatch.dispatch(broadcastdispatch.java:324) at org.gradle.internal.event.broadcastdispatch$Compositedispatch.dispatch(broadcastdispatch.java:234) at org.gradle.internal.event.Listenerbroadcast.dispatch(Listenerbroadcast.java:140) at org.gradle.internal.event.Listenerbroadcast.dispatch(Listenerbroadcast.java:37) at org.gradle.internal.dispatch.ProxydispatchAdapter$dispatchingInvocationHandler.invoke(ProxydispatchAdapter.java:93) at com.sun.proxy.$Proxy30.afterEvaluate(UnkNown Source) at org.gradle.configuration.project.lifecycleProjectEvaluator.notifyAfterEvaluate(lifecycleProjectEvaluator.java:76) ... 85 moreCaused by: org.gradle.internal.component.AmbiguousVariantSelectionException: More than one variant of project :volley matches the consumer attributes: - Configuration ':volley:deBUGAPIElements' variant androID-aIDl: - Found artifactType 'androID-aIDl' but wasn't required. - required com.androID.build.API.attributes.BuildTypeAttr 'deBUG' and found compatible value 'deBUG'. - Found com.androID.build.API.attributes.VariantAttr 'deBUG' but wasn't required. - required com.androID.build.gradle.internal.dependency.AndroIDTypeAttr 'Aar' and found compatible value 'Aar'. - required org.gradle.usage 'java-API' and found compatible value 'java-API'. - Configuration ':volley:deBUGAPIElements' variant androID-classes: - Found artifactType 'androID-classes' but wasn't required. - required com.androID.build.API.attributes.BuildTypeAttr 'deBUG' and found compatible value 'deBUG'. - Found com.androID.build.API.attributes.VariantAttr 'deBUG' but wasn't required. - required com.androID.build.gradle.internal.dependency.AndroIDTypeAttr 'Aar' and found compatible value 'Aar'. - required org.gradle.usage 'java-API' and found compatible value 'java-API'. - Configuration ':volley:deBUGAPIElements' variant androID-manifest: - Found artifactType 'androID-manifest' but wasn't required. - required com.androID.build.API.attributes.BuildTypeAttr 'deBUG' and found compatible value 'deBUG'. - Found com.androID.build.API.attributes.VariantAttr 'deBUG' but wasn't required. - required com.androID.build.gradle.internal.dependency.AndroIDTypeAttr 'Aar' and found compatible value 'Aar'. - required org.gradle.usage 'java-API' and found compatible value 'java-API'. - Configuration ':volley:deBUGAPIElements' variant androID-renderscript: - Found artifactType 'androID-renderscript' but wasn't required. - required com.androID.build.API.attributes.BuildTypeAttr 'deBUG' and found compatible value 'deBUG'. - Found com.androID.build.API.attributes.VariantAttr 'deBUG' but wasn't required. - required com.androID.build.gradle.internal.dependency.AndroIDTypeAttr 'Aar' and found compatible value 'Aar'. - required org.gradle.usage 'java-API' and found compatible value 'java-API'. - Configuration ':volley:deBUGAPIElements' variant jar: - Found artifactType 'jar' but wasn't required. - required com.androID.build.API.attributes.BuildTypeAttr 'deBUG' and found compatible value 'deBUG'. - Found com.androID.build.API.attributes.VariantAttr 'deBUG' but wasn't required. - required com.androID.build.gradle.internal.dependency.AndroIDTypeAttr 'Aar' and found compatible value 'Aar'. - required org.gradle.usage 'java-API' and found compatible value 'java-API'. at org.gradle.API.internal.artifacts.transform.DefaultArtifacttransforms$AttributeMatchingVariantSelector.doSelect(DefaultArtifacttransforms.java:104) at org.gradle.API.internal.artifacts.transform.DefaultArtifacttransforms$AttributeMatchingVariantSelector.select(DefaultArtifacttransforms.java:89) at org.gradle.API.internal.artifacts.ivyservice.resolveengine.artifact.DefaultArtifactSet.select(DefaultArtifactSet.java:126) at org.gradle.API.internal.artifacts.ivyservice.resolveengine.artifact.DefaultVisitedArtifactResults.select(DefaultVisitedArtifactResults.java:48) at org.gradle.API.internal.artifacts.ivyservice.DefaultLenIEntConfiguration.select(DefaultLenIEntConfiguration.java:112) at org.gradle.API.internal.artifacts.ivyservice.DefaultLenIEntConfiguration.select(DefaultLenIEntConfiguration.java:101) at org.gradle.API.internal.artifacts.ivyservice.DefaultResolvedConfiguration.getResolvedArtifacts(DefaultResolvedConfiguration.java:78) at org.gradle.API.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver$ErrorHandlingResolvedConfiguration.getResolvedArtifacts(ErrorHandlingConfigurationResolver.java:296) ... 134 more
解决方法:
使用稳定的Google服务.尽管AndroID Studio警告更新到3.3.0.使用此稳定版本“com.Google.gms:Google-services:3.2.1”.
总结以上是内存溢出为你收集整理的android – 将Gradle升级到版本4后生成错误全部内容,希望文章能够帮你解决android – 将Gradle升级到版本4后生成错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)