无法运行项目 – Android Studio 2.0 Crashlytics的问题

我将Android Studio更新到2.0,并试图立即运行。 Gradle同步工作。 重build项目的作品。 试图运行,失败:(。

我究竟做错了什么?

variables:

  • io.fabric.tools:gradle:1.14.4

  • com.android.tools.build:gradle:2.0.0-alpha1

  • buildToolsVersion 23.0.2

错误:

FAILURE: Build failed with an exception. What went wrong: Could not determine the dependencies of task ':Application:crashlyticsStoreDeobsDebug'. Task with path 'dexDebug' not found in project ':Application'. Try:Run with --info or --debug option to get more log output. 

堆栈跟踪:

 org.gradle.api.GradleException: Could not determine the dependencies of task ':Application:crashlyticsStoreDeobsDebug'. at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDependencyResolveContext.java:65) at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:53) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.realizedDependencies(DefaultTaskExecutionPlan.java:181) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.addToTaskGraph(DefaultTaskExecutionPlan.java:138) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.addTasks(DefaultTaskGraphExecuter.java:76) at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:47) at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42) at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48) at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:47) at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42) at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48) at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:44) at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42) at org.gradle.execution.DefaultBuildExecuter.select(DefaultBuildExecuter.java:35) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:90) at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:54) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:49) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.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:120) at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:71) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) Caused by: org.gradle.api.UnknownTaskException: Task with path 'dexDebug' not found in project ':Application'. at org.gradle.api.internal.tasks.DefaultTaskContainer.getByPath(DefaultTaskContainer.java:167) at org.gradle.api.internal.tasks.DefaultTaskContainer.resolveTask(DefaultTaskContainer.java:161) at org.gradle.api.internal.tasks.DefaultTaskDependency.resolve(DefaultTaskDependency.java:80) at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:86) at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmpyEdges.getNodeValues(CachingDirectedGraphWalker.java:200) at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:112) at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:64) at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.doResolve(CachingTaskDependencyResolveContext.java:74) at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDependencyResolveContext.java:63) ... 51 more 

Solutions Collecting From Web of "无法运行项目 – Android Studio 2.0 Crashlytics的问题"

我有同样的问题,并尝试许多事情没有成功。 我发现唯一的解决scheme是从任何gradle文件(基本上来自存储库和编译部分)中删除对结构或crashlytics的所有引用,然后通过结构插件重新添加它们。

我猜想有一些重复和不兼容的内含物。

前面的例子我已经有了(下面的一些行,在项目gradle中,其他的在gradle中)

 repositories { jcenter() maven { url 'http://download.crashlytics.com/maven' } maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'com.android.tools.build:gradle:2.0.0-alpha1' classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.16.0' classpath 'io.fabric.tools:gradle:1.20.0' } 

现在我只有

 repositories { jcenter() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'com.android.tools.build:gradle:2.0.0-alpha1' classpath 'io.fabric.tools:gradle:1.20.0' } 

刚更新到Android Studio 2.0,我遇到了同样的问题。 我的解决scheme是将插件版本更改为最新的1.21.5 。 插件的存储库URL是https://maven.fabric.io/public ,但是我从这里得到了最新版本。

 dependencies { // ... classpath 'io.fabric.tools:gradle:1.21.5' // ... } 

我可以确认,如果你改变io.fabric.tools:gradle到这个:

 dependencies { classpath 'io.fabric.tools:gradle:1.20.1' } 

它会再次工作。

我正在使用Android Studio Beta 2。

在我的情况下,我错过了“应用面料”

 if (!devBuild) { apply plugin: 'io.fabric' } 

所以尽量避免不应用Fabric插件。