Problem with play-services-measurement-base on ionic

怎甘沉沦 提交于 2019-11-27 11:53:25

No solutions posted here worked for me. A wonderful person opened a pull request in the cordova-firebase-plugin official repo and it works.

Steps I did:

1 - Remove cordova-firebase-plugin with ionic cordova plugin remove cordova-plugin-firebase

2 - Install: ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue

3 - rm -rf node_modules/ plugins/ platforms/android package-lock.json

4 - ionic cordova platform add android && npm install

5 - In my case I also use firebase js library in an old version becasue the newest ones are not working for me. With that library I always need to reinstall it manually after all the previous steps, so also I did: npm install firebase@4.12.1.

And now it's working.

I found a solution for me in the forum mentioned in Yannic Hamann answer (Ionic Forum).

The comment from systems_qualigy here is about locking the versions in project.properties.

cordova.system.library.4=com.google.firebase:firebase-core:16.0.8 
cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0 
cordova.system.library.6=com.google.firebase:firebase-config:16.4.1 
cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4

I need also to lock the version of

com.google.android.gms:play-services-tagmanager:16.0.8

I took the version from Martins answer and could succesfully rebuild my project.

We are now maintaining a forked version which includes all the changes & fixes done by different authors (who have saved everyone from this Google's move).

https://github.com/wizpanda/cordova-plugin-firebase-lib#difference-from-the-fork-repository

So, now just remove the existing plugin with:

ionic cordova plugin remove cordova-plugin-firebase

And now, install new version with

ionic cordova plugin add cordova-plugin-firebase-lib --save

Cheers!

Kiblawi_Rabee

The Problem was due to the recent updates in firebase where some methods are now deprecated, check out Android Firebase releases. To fix the problem use the following patch of cordova plugin :

cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue

do as it says and run ./gradlew :app:dependencies in the Andoird project directory.

support-v4 is even added three times:

compile "com.android.support:support-v4:24.1.1+"
compile "com.android.support:support-v4:26.+"
compile "com.android.support:support-v4:27.+"

alike this the Gradle project synchronizes:

implementation project(":CordovaLib")

implementation "com.google.android.gms:play-services-tagmanager:16.0.8"

implementation "com.google.firebase:firebase-messaging:18.0.0"
implementation "com.google.firebase:firebase-config:17.0.0"
implementation "com.google.firebase:firebase-perf:17.0.0"
implementation "com.google.firebase:firebase-core:16.0.9"

implementation "com.android.support:design:28.0.0"
implementation "com.android.support:support-v4:28.0.0"
implementation "com.android.support:customtabs:28.0.0"
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:recyclerview-v7:28.0.0"
implementation "com.android.support:animated-vector-drawable:28.0.0"
implementation "com.android.support.constraint:constraint-layout:1.1.3"

implementation "com.facebook.android:facebook-android-sdk:4.42.0"
implementation "com.squareup.okhttp3:okhttp-urlconnection:3.10.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.60"
implementation "com.github.bumptech.glide:glide:4.9.0"
implementation "com.appsee:appsee-android:2.6.0"

implementation "com.pushwoosh:pushwoosh:5.13.0"
implementation "com.pushwoosh:pushwoosh-amazon:5.13.0"
implementation "com.pushwoosh:pushwoosh-badge:5.13.0"
implementation "com.pushwoosh:pushwoosh-inbox:5.13.0"
implementation "com.pushwoosh:pushwoosh-inbox-ui:5.13.0"

I am having exactly the same issue. The problem is caused by cordova-plugin-firebase. I am currently investigating. Will update this answer when I found the exact course.

For now you can try to ionic cordova plugin rm <plugin> to see whether this resolves your current error too.

Update: Have a look here for possible fixes. This open PR seems to work. Hopefully it will be merged very soon.

Sunilkumar Godi

I just added below in project.properties which is under android platform dir and it got worked

cordova.system.library.4=com.google.firebase:firebase-core:16.0.8 
cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0 
cordova.system.library.6=com.google.firebase:firebase-config:16.4.1 
cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4

Ionic 4 : 20-05-2019

This works for me:

platforms/android/project.properties

target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.gradle.include.1=cordova-plugin-firebase/com1-build.gradle
cordova.system.library.2=com.google.android.gms:play-services-tagmanager:16.0.8
cordova.system.library.3=com.google.firebase:firebase-core:16.0.8
cordova.system.library.4=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.5=com.google.firebase:firebase-config:16.4.1
cordova.system.library.6=com.google.firebase:firebase-perf:16.2.4
cordova.system.library.7=com.android.support:support-annotations:27.+
Mustafa Shakaroun

I was facing the same error, I just deleted platforms/android and installed again (ionic cordova prepare android) then everything went back as it was.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!