Firebase plugin

we are using firebase analytics plugin . Everything works fine, but when we try to make an iOS build for distribution we get build error. Whereas, just removing the plugin we get build successful. What should be the recommended way for ionic 3.19.0 app wrapped on cordova 7 or 8 ?

thanks

write your error here plz

Configuration ‘compile’ in project ‘:app’ is deprecated. Use ‘implementation’ instead.
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_drpicextdm6z8hklacqmzhji5.run(/Users/itcinfotech/Documents/Ionic Project/onzv_release/project_name/platforms/android/app/build.gradle:146)

FAILURE: Build failed with an exception.

  • Where:
    Script ‘/Users/itcinfotech/Documents/Ionic Project/onzv_release/project_name/platforms/android/cordova-support-google-services/project_name-build.gradle’ line: 16

  • What went wrong:
    A problem occurred evaluating project ‘:app’.

Failed to apply plugin [class ‘com.google.gms.googleservices.GoogleServicesPlugin’]
Cannot add extension with name ‘googleServices’, as there is an extension already registered with that name.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 22s
(node:6051) UnhandledPromiseRejectionWarning: Error: /Users/itcinfotech/Documents/Ionic Project/onzv_release/project_name/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • Where:
    Script ‘/Users/itcinfotech/Documents/Ionic Project/onzv_release/project_name/platforms/android/cordova-support-google-services/project_name-build.gradle’ line: 16

  • What went wrong:
    A problem occurred evaluating project ‘:app’.

Failed to apply plugin [class ‘com.google.gms.googleservices.GoogleServicesPlugin’]
Cannot add extension with name ‘googleServices’, as there is an extension already registered with that name.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 22s
at ChildProcess.whenDone (/Users/itcinfotech/Documents/Ionic Project/onzv_release/project_name/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:606:12)
(node:6051) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either bythrowing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6051) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I am really stuck on this. please help. if there are other separate plugins which work for iOS and android separately, i am willing to experiment. But I can not remove firebase analytics plugin, as it is too much of work now

thanks in advance

did you add google-services.json file ?
if
you add it you will find soluation here

else add it .

thanks , lemme try, but

will this single plugin work for firebase push notification as well as firebase analytics ? I know if i remove the firebase analytics plugin this thing works, now i am thinking if this solves my problem of firebase analytics problem, i dont need to add 2 plugins to achieve these functionalities , right ?
any instructions how to use this, for firebase analytics, if at all it is there !

thanks

yes, we have added google-services.json file. without that our firebase analytics would not have worked ! the firebase analytics plugin works perfect, only when we add push notification plugin we start getting these weird errors.

now i get this

FAILURE: Build failed with an exception.

  • What went wrong:
    The library com.google.android.gms:play-services-analytics-impl is being requested by various other libraries at [[16.0.1,16.0.1]], but resolves to 16.0.4. Disable the plugin and check yourdependencies tree using ./gradlew :app:dependencies.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 4s
at ChildProcess.whenDone (/Users/itcinfotech/Documents/Ionic Project/onzv_release/project_name/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
(node:5077) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5077) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

CORDOVA.SUPPORT.GOOGLESERVICES.GRADLE

buildscript {
repositories {
jcenter()
mavenCentral()
}

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.1'
    classpath 'com.google.gms:google-services:3.1.1'
}

}

// apply plugin: ‘com.google.gms.google-services’
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
ext.postBuildExtras = {
//com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
}

PROJECT.PROPERTIES

This file was originally created by the Android Tools, but is now

used by cordova-android to manage the state of the various third party

libraries used in your application

This is the Library Module that contains the Cordova Library, this is not

required when using an AAR

This is the application project. This is only required for Android Studio Gradle projects

Project target.

target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-plugin-firebase/project_name-build.gradle
cordova.system.library.1=com.google.android.gms:play-services-tagmanager:11.8.0
cordova.system.library.2=com.google.firebase:firebase-core:11.8.0
cordova.system.library.3=com.google.firebase:firebase-messaging:11.8.0
cordova.system.library.4=com.google.firebase:firebase-config:11.8.0
cordova.system.library.5=com.google.firebase:firebase-perf:11.8.0
cordova.gradle.include.2=cordova-support-google-services/project_name-build.gradle
cordova.system.library.6=com.google.firebase:firebase-core:16.0.11.8.0
cordova.system.library.7=com.google.android.gms:play-services-analytics:16.0.1
cordova.system.library.8=com.android.support:support-annotations:27.+
cordova.gradle.include.3=cordova-plugin-iroot/project_name-build-extras.gradle

BUILD.GRADLE

dependencies {
implementation fileTree(dir: ‘libs’, include: ‘*.jar’)
// SUB-PROJECT DEPENDENCIES START
implementation(project(path: “:CordovaLib”))
compile “com.google.android.gms:play-services-tagmanager:+”
compile “com.google.firebase:firebase-core:+”
compile “com.google.firebase:firebase-messaging:+”
compile “com.google.firebase:firebase-config:+”
compile “com.google.firebase:firebase-perf:+”
compile “com.google.firebase:firebase-core:16.0.+”
compile “com.google.android.gms:play-services-analytics:16.0.1”
compile “com.android.support:support-annotations:27.+”
// SUB-PROJECT DEPENDENCIES END
}

We managed to resolve android issue. We still get into duplicate symbol problems in Xcode. How to resolve this ?
With the amount of time it taking for resolving this issue, I am thinking of writing my own plugin, but how to disable this plugin for iOS ?

tx

How did you fix this on Android? Having the same issue.

We are using “@ionic-native/firebase” for push and “@ionic-native/google-plus” for auth and it works fine. But build fails with the following error on adding “@ionic-native/firebase-analytics”:

  • What went wrong:
    [cordova] A problem occurred evaluating project ‘:app’.
    [cordova] > Failed to apply plugin [class ‘com.google.gms.googleservices.GoogleServicesPlugin’]
    [cordova] > Cannot add extension with name ‘googleServices’, as there is an extension already registered with that name.

please use the generic plugin @ionic-native/firebase for both push and analytics.

@ionic-native/firebase-analytics is not required, we ended up removing this plugin. The firebase analytics logging calls syntax are a bit different for @ionic-native/firebase, once changed, both push and analytics worked using only one single plugin @ionic-native/firebase

hope this helps

That’s awesome. Trying that out.

Firebase Use
Firebase is Google’s mobile application development platform that helps you build, improve, and grow your app. Firebase is Google’s mobile application development platform that helps you build, improve, and grow your app.

Firebase and it works
Firebase Cloud Messaging (FCM) provides a reliable and battery-efficient connection between your server and devices that allows you to deliver and receive messages and notifications on iOS, Android, and the web at no cost. You can send notification messages (2KB limit) and data messages (4KB limit).

Firebase RealTime Database
Firebase RealTime Database with Operations in Android with Examples. Firebase Realtime Database is a Cloud-hosted database, i.e. it runs on a cloud and access to the user is provided as a service. It stores data in JSON (Javascript Object Notation) format, a format to store or transport data.

I hope You like and understood this information.

Functional testing issues and solutions | React js companies in Noida | AngularJs Companies in India

If you are in any business and you need some software or product that can help you in work remotely, test management, project management, progress reports of your projects and solving many other problems. So kindly check our tool and click on the following link:- Bug Tracking Software