当我关注FCM firebase plugin docs时,我使用Ionic 3.4.0
来构建Android应用
我在构建Android应用程序时遇到错误。我做了以下事情:
1安装插件:
ionic cordova plugin add cordova-plugin-fcm
npm install --save @ionic-native/fcm
2运行build android app:
ionic cordova build android
3我收到了以下错误:
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
ANDROID_HOME=/home/tong/eproject/android
JAVA_HOME=/usr/lib/jvm/java-8-oracle/
Subproject Path: CordovaLib
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default
version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
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_6dhr8ioykw4yco44wd3y0fmi8.run(/home/tong/eproject/ionic/MyInoicProject/platforms/android/build.gradle:138)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please
use TaskInputs.file(Object).skipWhenEmpty() instead.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not find com.google.firebase:firebase-core:9.0.0.
Required by:
project :
> Could not find any matches for com.google.firebase:firebase-core:+ as no versions of
com.google.firebase:firebase-core are available.
Required by:
project :
> Could not find any matches for com.google.firebase:firebase-messaging:+ as no versions of
com.google.firebase:firebase-messaging are available.
Required by:
project :
* 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: 24.847 secs
Error: /home/tong/eproject/ionic/MyInoicProject/platforms/android/gradlew: Command failed with exit code 1 Error
output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not find com.google.firebase:firebase-core:9.0.0.
Required by:
project :
> Could not find any matches for com.google.firebase:firebase-core:+ as no versions of
com.google.firebase:firebase-core are available.
Required by:
project :
> Could not find any matches for com.google.firebase:firebase-messaging:+ as no versions of
com.google.firebase:firebase-messaging are available.
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
我似乎缺少com.google.firebase:firebase-core:9.0.0
我从this post读取内容但是当我尝试更新Google服务时它无效。请帮助我。