我正在使用Phonegap制作混合应用程序。到现在为止一切都很好。 但是,我只能使用一个插件[cordova-plugin-firebase] [1]。
我已使用以下代码完成了应用程序: 在我的config.xml中添加了这个
<plugin name="cordova-plugin-firebase" spec="2.0.2" />
<platform name="android">
<resource-file src="google-services.json" target="app/google-services.json" />
</platform>
并且还已经在根目录中添加了google-services.json
并在phonegap版本中上传了。但是出现以下错误:
Subproject Path: CordovaLib
Subproject Path: cordova-google-play-services/kyg-google-play-services_lib
Running command: /project/gradlew cdvBuildDebug -b /project/build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_9hhlfo8un5w66frpzrj124qfu.run(/project/build.gradle:157)
FAILURE: Build failed with an exception.
* Where:
Script '/project/cordova-plugin-firebase/kyg-build.gradle' line: 27
* What went wrong:
A problem occurred evaluating root project 'project'.
> Plugin with id 'com.google.gms.google-services' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.997 secs
Command finished with error code 1: /project/gradlew cdvBuildDebug,-b,/project/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
Error: /project/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Script '/project/cordova-plugin-firebase/kyg-build.gradle' line: 27
* What went wrong:
A problem occurred evaluating root project 'project'.
> Plugin with id 'com.google.gms.google-services' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
at ChildProcess.whenDone (/project/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
[1]: https://github.com/arnesson/cordova-plugin-firebase