当前位置: 首页 > 知识库问答 >
问题:

android studio添加库项目错误

井斌斌
2023-03-14

无法使用分级发行版“http://services.Gradle.org/distributions/gradle-1.6-bin.zip”执行生成。

跟踪:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':librari es:actionbarsherlock:compileRelease'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex ecuteActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex ecute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExec uter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.changedetection.state.CacheLockReleasingTaskE xecuter$1.run(CacheLockReleasingTaskExecuter.java:35)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(Def aultCacheAccess.java:179)
        at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(Def aultCacheAccess.java:232)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunning Operation(DefaultPersistentDirectoryStore.java:142)
        at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStat eCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
        at org.gradle.api.internal.changedetection.state.CacheLockReleasingTaskE xecuter.execute(CacheLockReleasingTaskExecuter.java:33)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.exec ute(SkipUpToDateTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.ContextualisingTaskExecuter.e xecute(ContextualisingTaskExecuter.java:34)
        at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskE xecuter$1.run(CacheLockAcquiringTaskExecuter.java:39)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc ess.java:124)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc ess.java:112)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(De faultPersistentDirectoryStore.java:134)
        at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStat eCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
        at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskE xecuter.execute(CacheLockAcquiringTaskExecuter.java:37)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execut e(ValidatingTaskExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecu ter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter .execute(SkipTaskWithNoActionsExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execut e(SkipOnlyIfTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter .execute(ExecuteAtMostOnceTaskExecuter.java:42)
        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailur e(AbstractTask.java:282)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.executeTask(De faultTaskPlanExecutor.java:48)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.processTask(De faultTaskPlanExecutor.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(Defaul tTaskPlanExecutor.java:27)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(Defau ltTaskGraphExecuter.java:89)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTask ExecutionAction.java:29)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute r.java:61)
        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExec uter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecu ter.java:67)
        at org.gradle.api.internal.changedetection.state.TaskCacheLockHandlingBu ildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc ess.java:124)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc ess.java:112)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(De faultPersistentDirectoryStore.java:134)
        at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStat eCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
        at org.gradle.api.internal.changedetection.state.TaskCacheLockHandlingBu ildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute r.java:61)
        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExec uter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecu ter.java:67)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildEx ecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute r.java:61)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute r.java:54)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default GradleLauncher.java:166)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle Launcher.java:113)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun cher.java:81)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon troller.run(InProcessBuildActionExecuter.java:64)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:33)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:24)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:26)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
        at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions .java:171)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction. execute(CommandLineActionFactory.java:201)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction. execute(CommandLineActionFactory.java:174)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute( CommandLineActionFactory.java:170)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute( CommandLineActionFactory.java:139)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:22)
        at org.gradle.launcher.Main.doAction(Main.java:48)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.Main.main(Main.java:39)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots trap.java:50)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j ava:32)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.ja va:33)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48) Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Com pilation failed; see the compiler error output for details.
        at org.gradle.api.internal.tasks.compile.jdk6.Jdk6JavaCompiler.execute(J dk6JavaCompiler.java:42)
        at org.gradle.api.internal.tasks.compile.jdk6.Jdk6JavaCompiler.execute(J dk6JavaCompiler.java:33)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegat eAndHandleErrors(NormalizingJavaCompiler.java:95)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute (NormalizingJavaCompiler.java:48)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute (NormalizingJavaCompiler.java:34)
        at org.gradle.api.internal.tasks.compile.DelegatingJavaCompiler.execute( DelegatingJavaCompiler.java:29)
        at org.gradle.api.internal.tasks.compile.DelegatingJavaCompiler.execute( DelegatingJavaCompiler.java:20)
        at org.gradle.api.internal.tasks.compile.IncrementalJavaCompilerSupport. execute(IncrementalJavaCompilerSupport.java:33)
        at org.gradle.api.internal.tasks.compile.IncrementalJavaCompilerSupport. execute(IncrementalJavaCompilerSupport.java:24)
        at org.gradle.api.tasks.compile.Compile.compile(Compile.java:68)
        at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMeth od(BeanDynamicObject.java:216)
        at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObj ect.java:122)
        at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(Composite DynamicObject.java:147)
        at org.gradle.api.tasks.compile.JavaCompile_Decorated.invokeMethod(Unkno wn Source)
        at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF actory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:217)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF actory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF actory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:199)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(Abstra ctTask.java:526)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(Abstra ctTask.java:509)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex ecuteAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex ecuteActions(ExecuteActionsTaskExecuter.java:61)
        ... 70 more


BUILD FAILED

Total time: 17.576 secs

共有1个答案

干高歌
2023-03-14

经过几天的努力,我终于把它解决了!在前面参考的第8步的答案中:

现在,在Actionbarsherlock模块中,删除android-support-library(因为这是该库的第二个副本--它将导致构建错误)。

只是我忽略了这一步,它对我来说很好。

 类似资料:
  • 我运行的是Mac OSX,我安装了android Studio-它启动正常。 问题1 我用一个空活动开始一个新项目。在最上面的窗户上我收到一条信息 问题2 我在底部窗口中看到以下错误: 错误:CompilesDKVersion android-L需要使用JDK 7 Open SDK Settings进行编译 打开文件 当我尝试在设备上运行项目时,我得到以下错误: 失败[INSTALL_FAILED

  • 问题内容: 如何将库项目(例如Sherlock ABS)添加到Android Studio? (不是旧的基于ADT Eclipse的捆绑包,而是新的Android Studio。) 问题答案: Android Studio 1.0更新 自从发布Android Studio 1.0(以及许多版本在v1.0到我上次回答之时的第一个版本)以来,某些事情已经发生了变化。 我的描述着重于通过Gradle文件

  • 我使用“OpenWeatherMap”API开发天气应用程序。我可以编写此API以加载图像命令,但无法将天气图标加载到ImageView为“ImageWeat”。

  • 我正在使用flutter来研发App。我在我的项目中添加了fire base,之后当我运行应用程序时,调试控制台中出现了一些错误。我删除了fire base库,但其他库再次出现错误。 注意:我不使用Android X 建筑格拉德尔: bulild.gradle(app) > 运行Gradle: ProcessException: Process"E:\MehrdadyOmidi\Project\f