11

war jemand in der Lage, Android DataBinding Plugin parallel zu GoogleServices pluginplugin zu verwenden?Verwenden Sie Android DataBinding Plugin parallel zum GoogleServices Plugin

dependencies { 
    classpath 'com.android.tools.build:gradle:1.3.1' 
    classpath 'com.google.gms:google-services:1.4.0-beta3' 
    classpath 'com.android.databinding:dataBinder:1.0-rc1' 
} 

apply plugin: 'com.google.gms.google-services' 
apply plugin: 'com.android.databinding' 

Und dann explodierte das ganze Projekt. Wenn ich das Dienst-Plugin entferne, funktioniert die Datenbindung.

Dies ist Gradle StackTrace.

[data binding plugin]: failed to setup data binding 
java.lang.NoSuchMethodError: com.android.build.gradle.AppExtension.getApplicationVariants()Lorg/gradle/api/internal/DefaultDomainObjectSet; 
    at android.databinding.tool.DataBinderPlugin.createXmlProcessorForApp(DataBinderPlugin.java:233) 
    at android.databinding.tool.DataBinderPlugin.createXmlProcessor(DataBinderPlugin.java:200) 
    at android.databinding.tool.DataBinderPlugin.access$200(DataBinderPlugin.java:65) 
    at android.databinding.tool.DataBinderPlugin$1.execute(DataBinderPlugin.java:156) 
    at android.databinding.tool.DataBinderPlugin$1.execute(DataBinderPlugin.java:152) 
    at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:113) 
    at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:102) 
    at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:87) 
    at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:31) 
    at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) 
    at com.sun.proxy.$Proxy10.afterEvaluate(Unknown Source) 
    at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67) 
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61) 
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:488) 
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:86) 
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35) 
    at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:82) 
    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.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$5.run(DefaultGradleLauncher.java:162) 
    at org.gradle.internal.Factories$1.create(Factories.java:22) 
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62) 
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:47) 
    at org.gradle.initialization.DefaultGradleLauncher.runBuildOperation(DefaultGradleLauncher.java:189) 
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:159) 
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:35) 
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:104) 
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:97) 
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62) 
    at org.gradle.initialization.DefaultGradleLauncher.runRootBuildOperation(DefaultGradleLauncher.java:184) 
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:97) 
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86) 
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:93) 
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:50) 
    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:27) 
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:72) 
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:44) 
    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) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
+3

Ich habe ähnliche Probleme mit Databinding und alles mit einem '1.4.0-Beta3' angehängt. Ich habe gerade 'classpath 'com.google.gms: google-services: 1.3.0-beta1'' verwendet. – Thorinside

+1

Ja, gerade lief genau das gleiche Problem auf mich. Das Update auf 1.4.0-beta3 hat das Projekt zum Explodieren gebracht, also musste ich im Grunde wieder downgraden (obwohl ich nur zu 1.3.0 ging - nicht zur Beta). Scheint wie ein Fehler, der an Google gemeldet werden muss. –

Antwort

3

Kein Downgrade erforderlich. Es gibt/war ein bug in einigen Versionen des Gradle-Plugins. Um die Dinge besser zu machen, sind die Data Binding Dokumente etwas veraltet. Ignoriere die Teile darüber, wie es eingerichtet wird. Versuchen Sie dies stattdessen:

buildscript { 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.5.0-beta1' 
    } 
} 

apply plugin: 'com.android.application' 

android { 
    dataBinding { 
     enabled = true 
    } 
    dependencies { 
     compile 'com.android.support:recyclerview-v7:23.1.1' 
     compile 'com.android.support:support-v4:23.1.1' 
     compile 'com.google.android.gms:play-services:8.3.0' 
    } 
} 
0

Ich hatte genau das gleiche Problem.

Bei einem neuen Projekt hatte ich Databinding funktioniert perfekt, auch ohne die Deklaration aktiviert.

Aber nach dem Hinzufügen neuer GoogleServices-Unterstützung hatte ich genau den gleichen Fehler.

Anzahl:

android { 
. . . 

dataBinding { 
    enabled = true 
} 

behoben.

Mein Projekt gradle Datei (Hoffnung jemand helfen):

buildscript { 
repositories { 
    jcenter() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:2.0.0-alpha7' 
    classpath "com.android.databinding:dataBinder:1.0-rc1" 
    classpath 'org.apache.commons:commons-lang3:3.4' 
    classpath 'com.google.gms:google-services:2.0.0-alpha5' 

. . .