Utilisez le plugin DataBinding Android parallèlement au plugin GoogleServices

Est-ce que quelqu'un était capable d'utiliser le plugin Android DataBinding parallèlement à Google Services pluginplugin?

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' 

Ensuite, tout le projet vient d'exploser. Lorsque je supprime le plugin de services, la liaison de données fonctionne.

  • La téléavertisseur de vue d'Android change automatiquement les pages après quelques secondes
  • TestUI (Jenkins) à l'aide d'un expresso
  • Android: Impossible d'instancier l'application
  • Pull to Refresh for WebView
  • CollapsingToolbarLayout ImageView n'est pas en défilement
  • Comment attachez-vous un effet de réverbération aux données AudioRecord / PCM et enregistrez-vous dans un fichier?
  • C'est la piste d'attelage de 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) 

  • Comment puis-je lire par programme des mots de passe wifi dans Android?
  • Gestion des préférences Android sans cordes magiques
  • Calendrier Android, obtenez l'ID de l'événement
  • Quand appelez initLoader in Fragment?
  • Comment imprimer à l'aide d'une imprimante zébrée dans Android?
  • L'application Android ne sera pas mise à jour par l'activité
  • 2 Solutions collect form web for “Utilisez le plugin DataBinding Android parallèlement au plugin GoogleServices”

    Pas besoin de basculer. Il y a eu un bug dans certaines versions du plugin gradle. Pour améliorer les choses, les documents de liaison de données sont un peu dépassés. Ignorez les parties pour savoir comment la configurer. Essayez ceci à la place:

     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' } } 

    J'ai eu exactement le même problème.

    Sur un nouveau projet, j'ai eu une liaison de données fonctionnant parfaitement, même sans la déclarer activée.

    Mais après avoir ajouté un nouveau support GoogleServices, j'ai eu exactement la même erreur.

    Ajouter:

     android { . . . dataBinding { enabled = true } 

    Fixé.

    Fichier Gradle de mon projet (j'espère aider quelqu'un):

     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' 

    . . .

    coAndroid est un fan Android de Google, tout sur les téléphones Android, Android Wear, Android Dev et Android Games Apps.