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.

  • Comment puis-je accéder à mon hôte local via un téléphone Android?
  • Android: modifiez l'étiquette de l'application de manière programmée
  • Comment contrôler la largeur et la hauteur de la boîte de dialogue d'alerte par défaut dans Android?
  • Comment puis-je obtenir le vecteur du champ magnétique, indépendamment de la rotation de l'appareil?
  • Démarrage de system.img sur un périphérique
  • Erreur "Impossible d'obtenir BatchedBridge, assurez-vous que votre paquet est correctement emballé" au démarrage de l'application
  • 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 écrire un InputStream potentiel pour le fichier?
  • Comment lancer une activité sans UI?
  • Peut-on avoir plusieurs applications dans un projet Android Studio?
  • Comment ouvrir des fichiers privés enregistrés dans le stockage interne en utilisant Intent.ACTION_VIEW?
  • Comment vérifier si Handler a une tâche active?
  • Comment puis-je choisir dynamiquement l'activité à lancer lors de l'ouverture d'une application?
  • 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.