Android Instant Run Gradle实验插件

时间:2015-11-26 21:55:16

标签: android gradle android-gradle

我遇到以下问题:

file or directory'/Users/rpurohit/Documents/StudioProjects/myapp/app/src/androidTest/manifest', not found
file or directory '/Users/rpurohit/Documents/StudioProjects/myapp/app/src/debug/manifest', not found
file or directory '/Users/rpurohit/Documents/StudioProjects/myapp/app/src/main/manifest', not found
file or directory '/Users/rpurohit/Documents/StudioProjects/myapp/app/src/release/manifest', not found
file or directory '/Users/rpurohit/Documents/StudioProjects/myapp/app/src/test/manifest', not found
FAILURE: Build failed with an exception.

What went wrong:
A problem occurred configuring project ':app'.
Exception thrown while executing model rule: BaseComponentModelPlugin.Rules#createBinaryTasks
Exception thrown while executing model rule: BaseComponentModelPlugin.Rules#createBinaryTasks > create(generateDebugInstantRunAppInfo)
      java.lang.NullPointerException (no error message)

Try:
Run with --debug option to get more log output.

Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
    at org.gradle.execution.TaskNameResolver.selfClosedTasksNode(TaskNameResolver.java:116)
    at org.gradle.execution.TaskNameResolver.hasTask(TaskNameResolver.java:128)
    at org.gradle.execution.TaskNameResolver.selectWithName(TaskNameResolver.java:66)
    at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:87)
    at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:75)
    at org.gradle.execution.commandline.CommandLineTaskParser.parseTasks(CommandLineTaskParser.java:42)
    at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:44)
    at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
    at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:25)
    at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:54)
    at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:44)
    at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
    at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:25)
    at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:54)
    at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:47)
    at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
    at org.gradle.execution.DefaultBuildConfigurationActionExecuter.select(DefaultBuildConfigurationActionExecuter.java:36)
    at org.gradle.initialization.DefaultGradleLauncher$3.run(DefaultGradleLauncher.java:143)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:77)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:47)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
    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:72)
    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.model.internal.core.ModelRuleExecutionException: Exception thrown while executing model rule: BaseComponentModelPlugin.Rules#createBinaryTasks
    at org.gradle.model.internal.registry.DefaultModelRegistry.fireAction(DefaultModelRegistry.java:473)
    at org.gradle.model.internal.registry.DefaultModelRegistry.access$1500(DefaultModelRegistry.java:44)
    at org.gradle.model.internal.registry.DefaultModelRegistry$RunModelAction.apply(DefaultModelRegistry.java:1490)
    at org.gradle.model.internal.registry.DefaultModelRegistry.transitionTo(DefaultModelRegistry.java:361)
    at org.gradle.model.internal.registry.DefaultModelRegistry.transition(DefaultModelRegistry.java:439)
    at org.gradle.model.internal.registry.DefaultModelRegistry.atStateOrMaybeLater(DefaultModelRegistry.java:182)
    at org.gradle.model.internal.registry.DefaultModelRegistry.atStateOrLater(DefaultModelRegistry.java:174)
    at org.gradle.execution.TaskNameResolver.selfClose(TaskNameResolver.java:101)
    at org.gradle.execution.TaskNameResolver.selfClosedTasksNode(TaskNameResolver.java:114)
    ... 65 more
Caused by: org.gradle.model.internal.core.ModelRuleExecutionException: Exception thrown while executing model rule: BaseComponentModelPlugin.Rules#createBinaryTasks > create(generateDebugInstantRunAppInfo)
    at org.gradle.model.internal.registry.DefaultModelRegistry.fireAction(DefaultModelRegistry.java:473)
    at org.gradle.model.internal.registry.DefaultModelRegistry.access$1500(DefaultModelRegistry.java:44)
    at org.gradle.model.internal.registry.DefaultModelRegistry$RunModelAction.apply(DefaultModelRegistry.java:1490)
    at org.gradle.model.internal.registry.DefaultModelRegistry.transitionTo(DefaultModelRegistry.java:361)
    at org.gradle.model.internal.registry.DefaultModelRegistry.transition(DefaultModelRegistry.java:439)
    at org.gradle.model.internal.registry.DefaultModelRegistry.access$900(DefaultModelRegistry.java:44)
    at org.gradle.model.internal.registry.DefaultModelRegistry$ModelElementNode.ensureAtLeast(DefaultModelRegistry.java:899)
    at org.gradle.model.internal.registry.DefaultModelRegistry$ModelElementNode.ensureUsable(DefaultModelRegistry.java:894)
    at org.gradle.model.internal.core.NodeBackedModelMap.get(NodeBackedModelMap.java:257)
    at org.gradle.model.internal.core.ModelMapGroovyDecorator.get(ModelMapGroovyDecorator.java:100)
    at com.android.build.gradle.model.TaskModelMapAdaptor.named(TaskModelMapAdaptor.java:71)
    at com.android.build.gradle.internal.scope.AndroidTask.get(AndroidTask.java:170)
    at com.android.build.gradle.internal.ApplicationTaskManager.createIncrementalSupportTasks(ApplicationTaskManager.java:296)
    at com.android.build.gradle.internal.TaskManager.createPostCompilationTasks(TaskManager.java:1905)
    at com.android.build.gradle.internal.ApplicationTaskManager$9.call(ApplicationTaskManager.java:180)
    at com.android.build.gradle.internal.ApplicationTaskManager$9.call(ApplicationTaskManager.java:169)
    at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
    at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)
    at com.android.build.gradle.internal.ApplicationTaskManager.createTasksForVariantData(ApplicationTaskManager.java:168)
    at com.android.build.gradle.internal.VariantManager.createTasksForVariantData(VariantManager.java:450)
    at com.android.build.gradle.model.BaseComponentModelPlugin$Rules$8.execute(BaseComponentModelPlugin.java:606)
    at com.android.build.gradle.model.BaseComponentModelPlugin$Rules$8.execute(BaseComponentModelPlugin.java:602)
    at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:202)
    at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:110)
    at org.gradle.api.internal.DefaultDomainObjectCollection.withType(DefaultDomainObjectCollection.java:120)
    at com.android.build.gradle.model.BaseComponentModelPlugin$Rules.createBinaryTasks(BaseComponentModelPlugin.java:602)
    at org.gradle.model.internal.method.WeaklyTypeReferencingMethod.invoke(WeaklyTypeReferencingMethod.java:105)
    at org.gradle.model.internal.inspect.DefaultModelRuleInvoker.invoke(DefaultModelRuleInvoker.java:37)
    at org.gradle.model.internal.inspect.MethodBackedModelAction.execute(MethodBackedModelAction.java:43)
    at org.gradle.model.internal.core.AbstractModelActionWithView.execute(AbstractModelActionWithView.java:46)
    at org.gradle.model.internal.registry.DefaultModelRegistry$2.run(DefaultModelRegistry.java:468)
    at org.gradle.model.internal.registry.RuleContext.run(RuleContext.java:59)
    at org.gradle.model.internal.registry.DefaultModelRegistry.fireAction(DefaultModelRegistry.java:465)
    ... 73 more
Caused by: java.lang.NullPointerException
    at com.android.build.gradle.tasks.fd.GenerateInstantRunAppInfoTask$ConfigAction.execute(GenerateInstantRunAppInfoTask.java:234)
    at com.android.build.gradle.tasks.fd.GenerateInstantRunAppInfoTask$ConfigAction.execute(GenerateInstantRunAppInfoTask.java:204)
    at org.gradle.model.internal.core.NoInputsModelAction.execute(NoInputsModelAction.java:39)
    at org.gradle.model.internal.core.AbstractModelActionWithView.execute(AbstractModelActionWithView.java:46)
    at org.gradle.model.internal.registry.DefaultModelRegistry$2.run(DefaultModelRegistry.java:468)
    at org.gradle.model.internal.registry.RuleContext.run(RuleContext.java:59)
    at org.gradle.model.internal.registry.DefaultModelRegistry.fireAction(DefaultModelRegistry.java:465)
    ... 105 more

我正在尝试使用带有gradle 2.9的gradle实验0.6.0-alpha1插件的Instant Run。每当我尝试构建项目时,都会出现上面的堆栈跟踪。我正在使用Android Studio 2.0 Preview。另请注意,如果我取消选中Android Studio>下的“使用即时运行”复选框偏好>构建,执行和部署>即时运行,构建成功。我想使用Instant Run。

如何解决此问题?

提前致谢。

2 个答案:

答案 0 :(得分:2)

Instant Run目前无法与Experimental插件配合使用,这是一个众所周知的问题。您可以关注此问题here

答案 1 :(得分:2)

禁用即时运行:

偏好设置>构建,执行,部署>即时运行

Preferences > Build, Execution, Deployment > Instant Run