无法通知项目评估听众

时间:2017-05-27 09:29:38

标签: android android-gradle

现在,我设置了android studio 3.0版本,我更新了gradle android gradle plugin.i重建我的project.the错误发生了。 像这样的代码(在build.gradle中):

 applicationVariants.all { variant ->
    variant.outputs.each { output ->
        def oldFile = output.outputFile
        def newName = "DDD_v_" + defaultConfig.versionName
        if (variant.buildType.name.equals('release')) {
            def releaseApkName = newName + '.apk'
            output.outputFile = new File(oldFile.parent, releaseApkName)
        }
        if (variant.buildType.name.equals('debug')) {
            def releaseApkName = newName + '_debug.apk'
            output.outputFile = new File(oldFile.parent, releaseApkName)
        }

    }
}

错误消息:

  

错误:(170,1)配置根项目' XXX'时出现问题。   无法通知项目评估监听器。   无效。   无法获得未知财产' apkVariantData'对于com.android.build.gradle.internal.api.ApplicationVariantImpl类型的对象。   代码的焦点:def oldFile = output.outputFile   * 什么地方出了错:   配置根项目' ShouYiRen'时出现问题。   无法通知项目评估监听器。   无效。   无法获得未知财产' apkVariantData'对于com.android.build.gradle.internal.api.ApplicationVariantImpl类型的对象。

  • 尝试: 使用--info或--debug选项运行以获得更多日志输出。

  • 例外情况是: org.gradle.api.ProjectConfigurationException:配置根项目' ShouYiRen'时出现问题。 在org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:91) 在org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:86) 在org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:73) 在org.gradle.configuration.project.LifecycleProjectEvaluator.access $ 000(LifecycleProjectEvaluator.java:31) 在org.gradle.configuration.project.LifecycleProjectEvaluator $ 1.execute(LifecycleProjectEvaluator.java:50) 在org.gradle.configuration.project.LifecycleProjectEvaluator $ 1.execute(LifecycleProjectEvaluator.java:47) 在org.gradle.internal.Transformers $ 4.transform(Transformers.java:169) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:114) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68) 在org.gradle.api.internal.project.BuildOperationProjectConfigurator.runBuildOperation(BuildOperationProjectConfigurator.java:139) 在org.gradle.api.internal.project.BuildOperationProjectConfigurator.projectBuildOperationAction(BuildOperationProjectConfigurator.java:64) 在org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:47) 在org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:652) 在org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:130) 在org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35) 在org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:36) 在org.gradle.initialization.DefaultGradleLauncher $ ConfigureBuildAction.execute(DefaultGradleLauncher.java:200) 在org.gradle.initialization.DefaultGradleLauncher $ ConfigureBuildAction.execute(DefaultGradleLauncher.java:197) 在org.gradle.internal.Transformers $ 4.transform(Transformers.java:169) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:114) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63) 在org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:157) 在org.gradle.initialization.DefaultGradleLauncher.access $ 200(DefaultGradleLauncher.java:43) 在org.gradle.initialization.DefaultGradleLauncher $ 1.run(DefaultGradleLauncher.java:121) 在org.gradle.internal.work.DefaultWorkerLeaseService $ 2.execute(DefaultWorkerLeaseService.java:124) 在org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:115) 在org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:98) 在org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:66) 在org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:50) 在org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) 在org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) 在org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32) 在org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner $ 1.execute(RunAsBuildOperationBuildActionRunner.java:43) 在org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner $ 1.execute(RunAsBuildOperationBuildActionRunner.java:40) 在org.gradle.internal.Transformers $ 4.transform(Transformers.java:169) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:114) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63) 在org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40) 在org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:44) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) 在org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75) 在org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49) 在org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:51) 在org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32) 在org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36) 在org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25) 在org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64) 在org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29) 在org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:52) 在org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:40) 在org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:50) 在org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30) 在org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67) 在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) 在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 在org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37) 在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 在org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) 在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 在org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) 在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 在org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java:74) 在org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java:72) 在org.gradle.util.Swapper.swap(Swapper.java:38) 在org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) 在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 在org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) 在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 在org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60) 在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) 在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 在org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72) 在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) 在org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 在org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy $ 1.run(StartBuildOrRespondWithBusy.java:50) 在org.gradle.launcher.daemon.server.DaemonStateCoordinator $ 1.run(DaemonStateCoordinator.java:297) at org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.StoppableExecutorImpl $ 1.run(StoppableExecutorImpl.java:46) at org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) 引起:org.gradle.internal.event.ListenerNotificationException:无法通知项目评估监听器。 在org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:86) 在org.gradle.internal.event.BroadcastDispatch $ CompositeDispatch.dispatch(BroadcastDispatch.java:315) 在org.gradle.internal.event.BroadcastDispatch $ CompositeDispatch.dispatch(BroadcastDispatch.java:225) 在org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:138) 在org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:35) at org.gradle.internal.dispatch.ProxyDispatchAdapter $ DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy。$ Proxy29.afterEvaluate(Unknown Source) 在org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:79) ......还有78个 引起:java.lang.RuntimeException:无效。 在com.android.ide.common.build.ApkData.getMainOutputFile(ApkData.java:136) 在com.android.build.gradle.internal.api.BaseVariantOutputImpl.getOutputFile(BaseVariantOutputImpl.java:60) 在com.android.build.gradle.internal.api.ApkVariantOutputImpl_Decorated.getOutputFile(未知来源) at org.gradle.internal.metaobject.BeanDynamicObject $ MetaClassAdapter.getProperty(BeanDynamicObject.java:228) at org.gradle.internal.metaobject.BeanDynamicObject.tryGetProperty(BeanDynamicObject.java:171) at org.gradle.internal.metaobject.CompositeDynamicObject.tryGetProperty(CompositeDynamicObject.java:55) at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:59) 在com.android.build.gradle.internal.api.ApkVariantOutputImpl_Decorated.getProperty(未知来源) at build_ail0i0d0o06lvahlcoidihlyd $ _run_closure2 $ _closure13 $ _closure21.doCall(/Users/tanglang/Documents/work/projects/company/ShouYiRen/build.gradle:170) at build_ail0i0d0o06lvahlcoidihlyd $ _run_closure2 $ _closure13.doCall(/Users/tanglang/Documents/work/projects/company/ShouYiRen/build.gradle:169) 在org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:71) at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:160) 在org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:106) at org.gradle.util.ConfigureUtil $ 1.execute(ConfigureUtil.java:123) at org.gradle.internal.ImmutableActionSet $ SingletonSet.execute(ImmutableActionSet.java:155) 在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) 在com.android.build.gradle.AppExtension.addVariant(AppExtension.java:63) 在com.android.build.gradle.internal.ApiObjectFactory.create(ApiObjectFactory.java:128) 在com.android.build.gradle.BasePlugin.lambda $ createAndroidTasks $ 6(BasePlugin.java:621) 在com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81) 在com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:610) 在com.android.build.gradle.BasePlugin.lambda $ null $ 4(BasePlugin.java:539) 在com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81) 在com.android.build.gradle.BasePlugin.lambda $ createTasks $ 5(BasePlugin.java:535) 在org.gradle.internal.event.BroadcastDispatch $ ActionInvocationHandler.dispatch(BroadcastDispatch.java:89) 在org.gradle.internal.event.BroadcastDispatch $ ActionInvocationHandler.dispatch(BroadcastDispatch.java:78) 在org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42) 在org.gradle.internal.event.BroadcastDispatch $ SingletonDispatch.dispatch(BroadcastDispatch.java:221) 在org.gradle.internal.event.BroadcastDispatch $ SingletonDispatch.dispatch(BroadcastDispatch.java:145) 在org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58) ... 85更多

在0s内建立失败

这意味着什么?任何建议都很感激

0 个答案:

没有答案