Проблема сборки в приложении apache cordova для android с firebase и ordova-plugin-firebase

Мне нужна помощь по плагину Firebase и Cordova: Кордова-плагин-firebase. Итак, я использую Visual Studio 2017, и мне нужно создать проект для Android с push-уведомлениями. Итак, я установил этот плагин, и после этого, когда я пытаюсь запустить устройство, я получаю эту ошибку от Visual Studio 2017.

Severity    Code    Description Project File    Line    Suppression State
Error        at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:606) Mivebo      1   
Error       Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence. Mivebo      1   
Error       java.lang.IllegalStateException: buildToolsVersion is not specified.    Mivebo      1   
Error        at com.google.common.base.Preconditions.checkState(Preconditions.java:176) Mivebo      1   
Error        at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:572)  Mivebo      1   
Error        at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:569)  Mivebo      1   
Error        at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55) Mivebo      1   
Error        at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47) Mivebo      1   
Error        at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:568) Mivebo      1   
Error        at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:565) Mivebo      1   
Error        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:93) Mivebo      1   
Error        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:82) Mivebo      1   
Error        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44) Mivebo      1   
Error        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79) Mivebo      1   
Error        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30) Mivebo      1   
Error        at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)    Mivebo      1   
Error        at com.sun.proxy.$Proxy10.afterEvaluate(Unknown Source)    Mivebo      1   
Error        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)   Mivebo      1   
Error        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)  Mivebo      1   
Error        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:529)  Mivebo      1   
Error        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:90)   Mivebo      1   
Error        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)  Mivebo      1   
Error        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)   Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)   Mivebo      1   
Error        at org.gradle.internal.Factories$1.create(Factories.java:22)   Mivebo      1   
Error        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)   Mivebo      1   
Error        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)   Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)   Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)   Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99) Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93) Mivebo      1   
Error        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)   Mivebo      1   
Error        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)   Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)  Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)  Mivebo      1   
Error        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)  Mivebo      1   
Error        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) Mivebo      1   
Error        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)   Mivebo      1   
Error        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43) Mivebo      1   
Error        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) Mivebo      1   
Error        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)   Mivebo      1   
Error        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37) Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)    Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)    Mivebo      1   
Error        at org.gradle.util.Swapper.swap(Swapper.java:38)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60) Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72) Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41) Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246) Mivebo      1   
Error        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)  Mivebo      1   
Error        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)   Mivebo      1   
Error        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) Mivebo      1   
Error        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) Mivebo      1   
Error        at java.lang.Thread.run(Thread.java:748)   Mivebo      1   
Error       FAILURE: Build failed with an exception.    Mivebo      1   
Error       * Where:    Mivebo      1   
Error       Build file 'C:\projects\Mivebo\Mivebo\platforms\android\build.gradle' line: 45  Mivebo      1   
Error       * What went wrong:  Mivebo      1   
Error       A problem occurred evaluating root project 'android'.   Mivebo      1   
Error       > Could not find method google() for arguments [] on repository container.  Mivebo      1   
Error       * Try:  Mivebo      1   
Error       Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.  Mivebo      1   
Error       Error: cmd: Command failed with exit code 1 Error output:   Mivebo      1   
Error       Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence. Mivebo      1   
Error       java.lang.IllegalStateException: buildToolsVersion is not specified.    Mivebo      1   
Error        at com.google.common.base.Preconditions.checkState(Preconditions.java:176) Mivebo      1   
Error        at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:606) Mivebo      1   
Error        at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:572)  Mivebo      1   
Error        at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:569)  Mivebo      1   
Error        at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55) Mivebo      1   
Error        at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47) Mivebo      1   
Error        at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:568) Mivebo      1   
Error        at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:565) Mivebo      1   
Error        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:93) Mivebo      1   
Error        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:82) Mivebo      1   
Error        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44) Mivebo      1   
Error        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79) Mivebo      1   
Error        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30) Mivebo      1   
Error        at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)    Mivebo      1   
Error        at com.sun.proxy.$Proxy10.afterEvaluate(Unknown Source)    Mivebo      1   
Error        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)   Mivebo      1   
Error        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)  Mivebo      1   
Error        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:529)  Mivebo      1   
Error        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:90)   Mivebo      1   
Error        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)  Mivebo      1   
Error        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)   Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)   Mivebo      1   
Error        at org.gradle.internal.Factories$1.create(Factories.java:22)   Mivebo      1   
Error        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)   Mivebo      1   
Error        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)   Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)   Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)   Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99) Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93) Mivebo      1   
Error        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)   Mivebo      1   
Error        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)   Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)  Mivebo      1   
Error        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)  Mivebo      1   
Error        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)  Mivebo      1   
Error        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) Mivebo      1   
Error        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)   Mivebo      1   
Error        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43) Mivebo      1   
Error        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) Mivebo      1   
Error        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)   Mivebo      1   
Error        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37) Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)    Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)    Mivebo      1   
Error        at org.gradle.util.Swapper.swap(Swapper.java:38)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60) Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72) Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41) Mivebo      1   
Error        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)   Mivebo      1   
Error        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246) Mivebo      1   
Error        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)  Mivebo      1   
Error        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)   Mivebo      1   
Error        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) Mivebo      1   
Error        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) Mivebo      1   
Error        at java.lang.Thread.run(Thread.java:748)   Mivebo      1   
Error       FAILURE: Build failed with an exception.    Mivebo      1   
Error       * Where:    Mivebo      1   

Итак, до установки плагина приложение работало на устройстве. Я установил страницу firebase и установил приложение с идентификатором, но не запускается на устройстве. Я также установил плагин службы Google Play для Cordova. Но все равно не работает. может я что то забыл установить? Спасибо за помощь. Моя цель - отправлять push-уведомления от firebase на устройствах Android. Спасибо за помощь.

1
0
259
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Честно говоря, все эти плагины, связанные с Firebase, как правило, плохо разработаны или приводят к различным ошибкам сборки, поэтому вам следует избегать их как чумы.

Если вам нужны только push-уведомления, придерживайтесь плагина phonegap-plugin-push, который может без особых проблем доставлять push-уведомления GCM (устаревшие) или FCM (Firebase). Убедитесь, что вы полностью прочтите его документацию, потому что один элемент, который вы пропустите, приведет к сбою сборки или неполучению уведомлений, я могу подтвердить это после многих лет его использования.

Последнее: если вы действительно используете VS2017 для Кордовы, проверьте эту статью для некоторых проблем, с которыми вы обязательно столкнетесь. Я продолжаю использовать VS2015 без каких-либо проблем, и приложения можно развертывать как на WP8, так и на Windows 10 Mobile.

Wou, отличные решения для меня. Протестировал и работает. Спасибо.

Mr. Developer 05.11.2018 12:35

Другие вопросы по теме