11

GoogleServicesプラグインと並行してAndroid DataBindingプラグインを使用できる人は誰でもいましたか?GoogleServicesプラグインと並行してAndroid DataBindingプラグインを使用

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' 

そして、プロジェクト全体が爆発しました。サービスプラグインを削除すると、データバインディングが機能します。

これはgradleのスタックトレースです。

[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

私はDatabindingとそれに付随する '1.4.0-beta3'を使って同様の問題を抱えています。私は 'classpath 'com.google.gms:google-services:1.3.0-beta1''を代わりに使用しています。 – Thorinside

+1

うん、ちょうどまったく同じ問題に直面した。 1.4.0-beta3にアップデートするとプロジェクトが爆発したので、基本的には再度ダウングレードしなければなりませんでした(私はちょうど1.3.0 - ベータ版ではありません)。 Googleに報告する必要があるバグのようです。 –

答えて

3

ダウングレードする必要はありません。いくつかのバージョンのgradleプラグインにはbugがありました。物事をより良くするために、Data Binding文書は少し古くなっています。それを設定する方法についての部分を無視してください。代わりにこれを試してみてください:

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

私は全く同じ問題がありました。

新しいプロジェクトでは、宣言が有効になっていなくても、データバインディングは完全に機能していました。

新しいGoogleサービスサポートを追加した後、私はまったく同じエラーが発生しました。

追加:

android { 
. . . 

dataBinding { 
    enabled = true 
} 

修正しました。

マイプロジェクトのGradleファイル(希望が誰かを助ける):

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' 

。 。 。

関連する問題