Firebase Cloud Messaging в Ionic не строится из-за Google-сервисов
Попытка использовать FCM на Ionic v3.19.1
а также Cordova 7.1.0
, Изо всех сил, чтобы получить решение. Испытал тысячи из них и не может найти проблему.
Когда я понижаю до 9.0.0, это показывает мне ошибку как это: (короче для краткости, но это имеет больше чем 76 ошибок:
platforms\android\src\plugin\google\maps\PluginMap.java:54: error: cannot find symbol
import com.google.android.gms.maps.model.MapStyleOptions;
^
symbol: class MapStyleOptions
location: package com.google.android.gms.maps.model
platforms\android\src\plugin\google\maps\PluginMap.java:84: error: cannot find symbol
GoogleMap.OnCameraIdleListener, GoogleMap.OnCameraMoveCanceledListener,
^
symbol: class OnCameraIdleListener
location: class GoogleMap
platforms\android\src\plugin\google\maps\PluginMap.java:84: error: cannot find symbol
GoogleMap.OnCameraIdleListener, GoogleMap.OnCameraMoveCanceledListener,
^
symbol: class OnCameraMoveCanceledListener
location: class GoogleMap
platforms\android\src\plugin\google\maps\PluginMap.java:85: error: cannot find symbol
GoogleMap.OnCameraMoveListener, GoogleMap.OnCameraMoveStartedListener,
^
symbol: class OnCameraMoveListener
location: class GoogleMap
platforms\android\src\plugin\google\maps\PluginMap.java:85: error: cannot find symbol
GoogleMap.OnCameraMoveListener, GoogleMap.OnCameraMoveStartedListener,
^
symbol: class OnCameraMoveStartedListener
location: class GoogleMap
Когда я добавляю плагин google-services внизу файла и версии на 9.8.0, он возвращает это:
BUILD FAILED
Total time: 1.414 secs
FAILURE: Build failed with an exception.
* Where:
Build file 'platforms\android\build.gradle' line: 335
* What went wrong:
A problem occurred evaluating root project 'android'.
> 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.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Build file 'platforms\android\build.gradle' line: 335
* What went wrong:
A problem occurred evaluating root project 'android'.
> Plugin with id 'com.google.gms.google-services' not found.
Это мой проект. Свойства
target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.gradle.include.1=cordova-plugin-background-fetch/app-build.gradle
cordova.gradle.include.2=cordova-plugin-badge/app-badge.gradle
cordova.system.library.2=com.google.firebase:firebase-core:9.8.0
cordova.system.library.3=com.google.firebase:firebase-messaging:9.8.0
cordova.gradle.include.3=cordova-plugin-fcm/app-FCMPlugin.gradle
cordova.system.library.4=com.google.android.gms:play-services-location:9.8.0
cordova.system.library.5=com.google.android.gms:play-services-analytics:9.8.0
cordova.gradle.include.4=cordova-plugin-googlemaps/app-build-extras.gradle
cordova.gradle.include.5=cordova-plugin-googlemaps/app-tbxml-android.gradle
cordova.system.library.6=com.google.android.gms:play-services-maps:9.8.0
cordova.system.library.7=com.google.android.gms:play-services-location:9.8.0
cordova.system.library.8=com.android.support:support-core-utils:24.1.0
cordova.system.library.9=com.android.support:support-v4:26.+
cordova.gradle.include.6=cordova-plugin-local-notification/app-localnotification.gradle
cordova.gradle.include.7=cordova-plugin-mauron85-background-geolocation/app-logtofile.gradle
cordova.system.library.10=com.google.android.gms:play-services-location:9.8.0
cordova.system.library.11=com.android.support:support-v4:+
cordova.system.library.12=com.google.android.gms:play-services-location:9.8.0
cordova.system.library.13=com.android.support:support-v4:26.+
cordova.system.library.14=com.android.support:appcompat-v7:26.+
build.gradle
...
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
// Switch the Android Gradle plugin version requirement depending on the
// installed version of Gradle. This dependency is documented at
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
...
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
debugCompile(project(path: "CordovaLib", configuration: "debug"))
releaseCompile(project(path: "CordovaLib", configuration: "release"))
compile "com.android.support:support-v4:24.1.1+"
compile "com.google.firebase:firebase-core:9.8.0"
compile "com.google.firebase:firebase-messaging:9.8.0"
compile "com.google.android.gms:play-services-location:9.8.0"
compile "com.google.android.gms:play-services-analytics:9.8.0"
compile "com.google.android.gms:play-services-maps:9.8.0"
compile "com.android.support:support-core-utils:24.1.0"
compile "com.android.support:support-v4:26.+"
compile "com.android.support:support-v4:+"
compile "com.android.support:appcompat-v7:26.+"
// SUB-PROJECT DEPENDENCIES END
}
...
apply plugin: 'com.google.gms.google-services'
Я не знаю, что делать дальше. Пробовал тысячи решений и ничего не произошло.