arnesson / cordova-plugin-firebase

Cordova plugin for Google Firebase
http://arnesson.github.io/cordova-plugin-firebase
MIT License
1k stars 1.55k forks source link

New error on android build since 06-05-2019 #1057

Open clanglois421 opened 5 years ago

clanglois421 commented 5 years ago

Describe the bug Were having a new error on cordova build android since about 3 hours ago (06-05-2019 16:00:00). On a same build that passed this noon..

To Reproduce Steps to reproduce the behavior: Using these depency :

"dependencies": { "@vimeo/player": "^2.8.2", "android-versions": "^1.4.0", "autoprefixer": "^9.5.1", "aws-sdk": "^2.446.0", "browser-sync": "^2.26.4", "cordova-browser": "^6.0.0", "cordova-ios": "^5.0.1", "cordova-plugin-app-version": "^0.1.9", "cordova-plugin-customconfigparameters": "^3.0.0", "cordova-plugin-device": "^2.0.2", "cordova-plugin-file": "^6.0.1", "cordova-plugin-file-downloader": "^0.4.0", "cordova-plugin-file-md5": "^0.3.3", "cordova-plugin-file-transfer": "^1.7.1", "cordova-plugin-firebase": "git+https://github.com/arnesson/cordova-plugin-firebase.git", "cordova-plugin-inappbrowser": "^3.0.0", "cordova-plugin-network-information": "^2.0.1", "cordova-plugin-splashscreen": "git+https://github.com/apache/cordova-plugin-splashscreen.git", "cordova-plugin-statusbar": "git+https://github.com/apache/cordova-plugin-statusbar.git", "cordova-plugin-streaming-media": "^2.2.0", "cordova-plugin-whitelist": "^1.3.3", "cordova-plugin-zip": "^3.1.0", "cordova-support-google-services": "^1.1.0", "del": "^4.1.0", "express": "^4.16.4", "gameanalytics": "^3.1.2", "graceful-fs": "^4.1.15", "gulp-concat": "^2.6.1", "gulp-copy": "^4.0.1", "gulp-eslint": "^5.0.0", "gulp-install": "^1.1.0", "gulp-kit": "^0.3.0", "gulp-postcss": "^8.0.0", "gulp-rename": "^1.4.0", "gulp-sass": "^4.0.2", "gulp-sourcemaps": "^2.6.5", "gulp-uglify": "^3.0.2", "nativescript-gameanalytics": "^2.1.2", "node-properties-parser": "0.0.2", "phonegap-plugin-multidex": "^1.0.0", "properties-parser": "^0.3.1", "sqli-cordova-disk-space-plugin": "~1.0.2", "vimeo": "^2.1.1" },

Run Cordova build android and we get an error.

**Console Logs**
Task :app:compileReleaseJavaWithJavac
/builds/MGAEntertainment/lol-video-star/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java:6: error: cannot find symbol
import com.google.firebase.iid.FirebaseInstanceIdService;
                              ^
  symbol:   class FirebaseInstanceIdService
  location: package com.google.firebase.iid
/builds/MGAEntertainment/lol-video-star/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java:8: error: cannot find symbol
public class FirebasePluginInstanceIDService extends FirebaseInstanceIdService {
                                                     ^
  symbol: class FirebaseInstanceIdService
/builds/MGAEntertainment/lol-video-star/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:610: error: method getByteArray in class FirebaseRemoteConfig cannot be applied to given types;
                        : FirebaseRemoteConfig.getInstance().getByteArray(key, namespace);
                                                            ^
  required: String
  found: String,String
  reason: actual and formal argument lists differ in length
/builds/MGAEntertainment/lol-video-star/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:629: error: method getValue in class FirebaseRemoteConfig cannot be applied to given types;
                        : FirebaseRemoteConfig.getInstance().getValue(key, namespace);
                                                            ^
  required: String
  found: String,String
  reason: actual and formal argument lists differ in length
/builds/MGAEntertainment/lol-video-star/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:686: error: no suitable method found for setDefaults(Map<String,Object>,String)
                        FirebaseRemoteConfig.getInstance().setDefaults(defaultsToMap(defaults), namespace);
                                                          ^
    method FirebaseRemoteConfig.setDefaults(Map<String,Object>) is not applicable
      (actual and formal argument lists differ in length)
    method FirebaseRemoteConfig.setDefaults(int) is not applicable
      (actual and formal argument lists differ in length)
/builds/MGAEntertainment/lol-video-star/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:885: error: cannot find symbol
                        myTrace.incrementCounter(counterNamed);
                               ^
  symbol:   method incrementCounter(String)
  location: variable myTrace of type Trace
/builds/MGAEntertainment/lol-video-star/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java:17: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors

FAILURE: Build failed with an exception.

Desktop (please complete the following information):

DavidStrausz commented 5 years ago

@jetwitaussi Yes, I also use cordova-android@6.4.0 and it was not working too.

The issue is that the fixed version of @dpa99c is based on the master branch of this plugin which upgraded the google-services plugin to version 4.2.0 to support cordova-android@8.0.0 (see pull request #1011) but apparently does not work with older cordova-android versions.

The only way I found to fix this for now is to manually change the play-services version in your root build.gradle from version 4.2.0 back to 4.1.0:

-classpath 'com.google.gms:google-services:4.2.0' // google-services dependency from cordova-plugin-firebase
+classpath 'com.google.gms:google-services:4.1.0' // google-services dependency from cordova-plugin-firebase
jetwitaussi commented 5 years ago

i already have google-services v4.1.0 :/

edit: oops i'm back to old version, will try again and see

amitairos commented 5 years ago

I tried the fix and got this error:

BUILD FAILED in 27s Dependency resolved to an incompatible version: Dependency(fromArtifactVersion=ArtifactVersion(groupId=com.nimbusds, artifactId=nimbus-jose-jwt, version=5.1), toArtifact=Artifact(groupId=net.minidev, artifactId=json-smart), toArtifactVersionString=[1.3.1,2.3]) :app:preDebugBuild FAILED 14 actionable tasks: 4 executed, 10 up-to-date cmd: Command failed with exit code 1 Error output: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

Dependency failing: com.nimbusds:nimbus-jose-jwt:5.1 -> net.minidev:json-smart@[1.3.1,2.3], but json-smart version was 2 .3.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. -- Project 'app' depends onto com.nimbusds:nimbus-jose-jwt@5.1

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b uild.gradle file.

dpa99c commented 5 years ago

build.gradle is dynamically re-created during the Cordova build process: if you make manual changes then run cordova prepare android or cordova build android your changes will be overwritten.

If you need to make this work with cordova-android@6.4.0, I would suggest forking this repo and editing the relevant file to set google-services back to 4.1.0, then install the plugin into your project from your forked repo.

amitairos commented 5 years ago

@dpa99c Do you know what is causing my issue?

dpa99c commented 5 years ago

@dpa99c Do you know what is causing my issue?

See https://github.com/Microsoft/react-native-code-push/issues/1448

marcus13371337 commented 5 years ago

After installing the pull request, I get the following error when building for iOS: Undefined symbols for architecture arm64: "_GULLoggerInitializeASL", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o) "_GULLoggerEnableSTDERR", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o) "_OBJC_CLASS_$_GULSwizzler", referenced from: objc-class-ref in GoogleAppMeasurement(UIViewController+APMScreenClassName_bb34840e14481f32c5ecb9ffcac15bff.o) objc-class-ref in FirebasePerformance(FPRSelectorInstrumentor_43661c322536eae9342dbd4edb53bf7b.o) objc-class-ref in FirebasePerformance(FPRProxyObjectHelper_cae8c79ce5179c4587d285c87421f26f.o) "_GULLogInfo", referenced from: ___44+[UIViewController(APMScreenClassName) load]_block_invoke in GoogleAppMeasurement(UIViewController+APMScreenClassName_bb34840e14481f32c5ecb9ffcac15bff.o) "_GULLoggerForceDebug", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)

clanglois421 commented 5 years ago

@dpa99c Thank you for your fork it fixed or build this morning!!

dpa99c commented 5 years ago

After installing the pull request, I get the following error when building for iOS: Undefined symbols for architecture arm64: "_GULLoggerInitializeASL", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o) "_GULLoggerEnableSTDERR", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o) "_OBJC_CLASS_$_GULSwizzler", referenced from: objc-class-ref in GoogleAppMeasurement(UIViewController+APMScreenClassName_bb34840e14481f32c5ecb9ffcac15bff.o) objc-class-ref in FirebasePerformance(FPRSelectorInstrumentor_43661c322536eae9342dbd4edb53bf7b.o) objc-class-ref in FirebasePerformance(FPRProxyObjectHelper_cae8c79ce5179c4587d285c87421f26f.o) "_GULLogInfo", referenced from: ___44+[UIViewController(APMScreenClassName) load]_block_invoke in GoogleAppMeasurement(UIViewController+APMScreenClassName_bb34840e14481f32c5ecb9ffcac15bff.o) "_GULLoggerForceDebug", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)

I haven't tried an iOS build with it but the only code I've changed in the PR is for the Android platform: https://github.com/arnesson/cordova-plugin-firebase/pull/1058/files

So iOS code should be identical to the master branch of this repo.

marcus13371337 commented 5 years ago

After installing the pull request, I get the following error when building for iOS: Undefined symbols for architecture arm64: "_GULLoggerInitializeASL", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o) "_GULLoggerEnableSTDERR", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o) "_OBJC_CLASS_$_GULSwizzler", referenced from: objc-class-ref in GoogleAppMeasurement(UIViewController+APMScreenClassName_bb34840e14481f32c5ecb9ffcac15bff.o) objc-class-ref in FirebasePerformance(FPRSelectorInstrumentor_43661c322536eae9342dbd4edb53bf7b.o) objc-class-ref in FirebasePerformance(FPRProxyObjectHelper_cae8c79ce5179c4587d285c87421f26f.o) "_GULLogInfo", referenced from: ___44+[UIViewController(APMScreenClassName) load]_block_invoke in GoogleAppMeasurement(UIViewController+APMScreenClassName_bb34840e14481f32c5ecb9ffcac15bff.o) "_GULLoggerForceDebug", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)

I haven't tried an iOS build with it but the only code I've changed in the PR is for the Android platform: https://github.com/arnesson/cordova-plugin-firebase/pull/1058/files

So iOS code should be identical to the master branch of this repo.

Yeah, weird error. But a classic: cordova platform rm ios and then cordova platform add ios seems to have fixed the issue.

Thanks for your quick fix! :)

jetwitaussi commented 5 years ago

Modifying helper.js file and setting back version 4.1.0 to google-services this error is coming back:

* What went wrong:
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
dpa99c commented 5 years ago

Modifying helper.js file and setting back version 4.1.0 to google-services this error is coming back:

* What went wrong:
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Have you tried removing and re-adding the android platform?

jetwitaussi commented 5 years ago

yes, tried twice to be sure :)

dpa99c commented 5 years ago

yes, tried twice to be sure :)

🤷‍♂

aswinaryal commented 5 years ago

Modifying helper.js file and setting back version 4.1.0 to google-services this error is coming back:

* What went wrong:
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Have you tried removing and re-adding the android platform?

yes, i have almost removed android platform 4 or 5 times and add again, but no luck, receiving everytime this error

amitairos commented 5 years ago

@dpa99c Do you know what is causing my issue?

See microsoft/react-native-code-push#1448

Thanks! Solved it.

ARMistice commented 5 years ago

Working with cordova@9.0.0 the version of @dpa99c works wonderful.

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

I removed and added the android platform: cordova platform rm android cordova platform add android

and everything works like charm

Many thanks from my side

pakaKoni commented 5 years ago

Using cordova@8.1.1 I get a white screen with the version of @dpa99c. Chrome Web-Inspector gives me the error: Uncaught TypeError: Object(...) is not a function at index.js:569 at Module../node_modules/@ionic-native/firebase/index.js (index.js:795) at webpack_require (bootstrap:83) at Module../src/app/app.component.ts (main.js:1050) at webpack_require (bootstrap:83) at Module../src/app/app.module.ts (app.component.ts:17) at webpack_require (bootstrap:83) at Module../src/main.ts (main.ts:1) at webpack_require (bootstrap:83) at Object.0 (main.ts:15)

While index.js is the index.js of /node_modules/@ionic-native/firebase/index.js

I removed the platform and the plugin Added them again, Fixed the path to firebase by removing '/ngx' from the imports

charlie-rushton commented 5 years ago

@fjckls I tried your fix, and my android app does build, but when I try to deploy to device I get a stopped working error, any ideas?

newuser44 commented 5 years ago

Still not sure what I need to do to fix this. I'm on Ionic 3 with Android 6.4.0.
Was trying to mess with the project.properties and change the version back. Not sure which versions to try?

wilsolutions commented 5 years ago

As I mentioned here, if you're installing into an existing project you may need to remove/re-add the Android platform in order to rebuild the Gradle config after installing the plugin from my fork:

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

Thank you @dpa99c your PR did fix the issue to me, all up and running on Android and iOS.

newuser44 commented 5 years ago

Something down?

$ cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue Error: Failed to fetch plugin https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Failed to get absolute path to installed module

ovninosa commented 5 years ago

+1 please fix it.

thanks

emilwang commented 5 years ago

@dpa99c Thanks! Solved it.

goffity commented 5 years ago

This is due to the firebase updates on April 05. Here https://firebase.google.com/support/release-notes/android#update_-_april_02_2019, I found the last working versions and adjusted my project.properties accordingly like so 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 Here all dependencies are locked to the specific version (Update - April 02, 2019) instead of +, which would get you the latest version thus breaking the build process. Now I can build successfully! Hope it helps!

I succeeded in rewrite platforms/android/app/build.gradle and platforms/android/project.properties by @fjckls's method.

It's work for me. Thanks, @fjckls @syagawa

sotano42 commented 5 years ago

This is due to the firebase updates on April 05. Here https://firebase.google.com/support/release-notes/android#update_-_april_02_2019, I found the last working versions and adjusted my project.properties accordingly like so

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

Here all dependencies are locked to the specific version (Update - April 02, 2019) instead of +, which would get you the latest version thus breaking the build process.

Now I can build successfully! Hope it helps!

Noob question here: How did you find that those versions should be the ones locked?

Ty for the info...

kapilSoni101 commented 5 years ago

@fjckls sir i got this error :

paamrutk commented 5 years ago

i did all these steps but still getting errors while running the app in the simulator. Please help me with this.

error that I am getting is :

Task :CordovaLib:compileDebugJavaWithJavac Note: /Users/samarthagarwal/Desktop/FIREBASE/firebase analytics/MMAUIRepo/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

Task :CordovaLib:processDebugJavaRes NO-SOURCE Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug Task :app:javaPreCompileDebug

Task :app:compileDebugJavaWithJavac FAILED /Users/samarthagarwal/Desktop/FIREBASE/firebase analytics/MMAUIRepo/platforms/android/app/src/main/java/com/google/cordova/plugin/BrowserTab.java:21: error: package android.support.customtabs does not exist import android.support.customtabs.CustomTabsIntent; ^ /Users/samarthagarwal/Desktop/FIREBASE/firebase analytics/MMAUIRepo/platforms/android/app/src/main/java/com/adobe/phonegap/push/PushInstanceIDListenerService.java:9: error: cannot find symbol import com.google.firebase.iid.FirebaseInstanceIdService; ^ symbol: class FirebaseInstanceIdService location: package com.google.firebase.iid /Users/samarthagarwal/Desktop/FIREBASE/firebase analytics/MMAUIRepo/platforms/android/app/src/main/java/com/adobe/phonegap/push/PushInstanceIDListenerService.java:15: error: cannot find symbol public class PushInstanceIDListenerService extends FirebaseInstanceIdService implements PushConstants { ^ symbol: class FirebaseInstanceIdService /Users/samarthagarwal/Desktop/FIREBASE/firebase analytics/MMAUIRepo/platforms/android/app/src/main/java/com/google/cordova/plugin/BrowserTab.java:104: error: package CustomTabsIntent does not exist Intent customTabsIntent = new CustomTabsIntent.Builder().build().intent; ^ /Users/samarthagarwal/Desktop/FIREBASE/firebase analytics/MMAUIRepo/platforms/android/app/src/main/java/com/adobe/phonegap/push/PushInstanceIDListenerService.java:18: error: method does not override or implement a method from a supertype @Override ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 5 errors

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 12s 35 actionable tasks: 9 executed, 26 up-to-date

zeeshananjumjunaidi commented 5 years ago

This is due to the firebase updates on April 05. Here https://firebase.google.com/support/release-notes/android#update_-_april_02_2019, I found the last working versions and adjusted my project.properties accordingly like so

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

Here all dependencies are locked to the specific version (Update - April 02, 2019) instead of +, which would get you the latest version thus breaking the build process.

Now I can build successfully! Hope it helps!

working fine (Y)

srmohapatra422 commented 5 years ago

@dpa99c I just remove my platform and add the same. But i am getting below issue Error: Failed to crunch file C:\Resolve\Resolve Android Hybrid\EMIA app\emia2\Resolve_Hybrid_Android-master\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\16.0.1\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png into C:\Resolve\Resolve Android Hybrid\EMIA app\emia2\Resolve_Hybrid_Android-master\platforms\android\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png :mergeDebugResources FAILED

aswinaryal commented 5 years ago

here is the complete step what i did for fixing this issue:

Note: If you are using resource file tag inside config.xml for custom notification icons like:

    <!-- Copy the color definition -->
    <resource-file src="res/native/android/res/values/colors.xml" target="app/src/main/res/values/colors.xml"/>
    <!-- Copy the icons -->
    <resource-file src="res/native/android/res/drawable-hdpi/ic_silhouette.png" target="app/src/main/res/drawable-hdpi/ic_silhouette.png"/>
    <resource-file src="res/native/android/res/drawable-xhdpi/ic_silhouette.png" target="app/src/main/res/drawable-xhdpi/ic_silhouette.png"/>
    <resource-file src="res/native/android/res/drawable-xxhdpi/ic_silhouette.png" target="app/src/main/res/drawable-xxhdpi/ic_silhouette.png"/>
    <resource-file src="res/native/android/res/drawable-xxxhdpi/ic_silhouette.png" target="app/src/main/res/drawable-xxxhdpi/ic_silhouette.png"/>

    <!-- Configure Firebase -->
    <config-file parent="/manifest/application" target="AndroidManifest.xml">
        <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_silhouette" />
        <meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/primary" />
    </config-file>

then you should first remove these lines of code(ctrl+x) from your config.xml and then only add android platform (do not forget to remove android platform before adding)

kapilSoni101 commented 5 years ago

@fjckls sir i have add above file in the project.pro but after changes anything changes are not save in the file why?

yoojene commented 5 years ago

This is due to the firebase updates on April 05. Here https://firebase.google.com/support/release-notes/android#update_-_april_02_2019, I found the last working versions and adjusted my project.properties accordingly like so

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

Here all dependencies are locked to the specific version (Update - April 02, 2019) instead of +, which would get you the latest version thus breaking the build process.

Now I can build successfully! Hope it helps!

This is a workaround - you can use the original plugin (not the forked one from @dpa99c) and it will build

RobinGiel commented 5 years ago

@yoojene Is this solution also working with Ionic 3 ?

bitf12m512 commented 5 years ago

+1 Please Fix it.

MianAzhar commented 5 years ago

This is due to the firebase updates on April 05. Here https://firebase.google.com/support/release-notes/android#update_-_april_02_2019, I found the last working versions and adjusted my project.properties accordingly like so

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

Here all dependencies are locked to the specific version (Update - April 02, 2019) instead of +, which would get you the latest version thus breaking the build process.

Now I can build successfully! Hope it helps!

Not working on Ionic 3 :/

yoojene commented 5 years ago

@yoojene Is this solution also working with Ionic 3 ?

Yes @RobinGiel working for me on an v3 app using "ionic-angular": "3.9.2". I have upgraded to the v4 CLI however

% ionic info                                                      
Ionic:

   ionic (Ionic CLI)  : 4.12.0 (/Users/Eugene/.nvm/versions/node/v10.15.0/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.3

Cordova:

   cordova (Cordova CLI) : 7.0.0
   Cordova Platforms     : android 6.4.0, ios 4.5.4
   Cordova Plugins       : cordova-plugin-ionic-webview 1.1.1, (and 24 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/Eugene/Development/SDK/Android)
   ios-deploy        : 1.9.4
   NodeJS            : v10.15.0 (/Users/Eugene/.nvm/versions/node/v10.15.0/bin/node)
   npm               : 6.4.1
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001
hellkith commented 5 years ago

I've created PR #1058 to fix this by updating the plugin code to remove/replace references to deprecated API features that were removed in the April 05 Firebase SDK release.

Until such time as it has been merged, you can install the fixed plugin directly off my fork:

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

@MianAzhar this solution will work for ionic v3 as I am using that aswell and this one works for me

kapilSoni101 commented 5 years ago

@hellkith but sir i got this error after install above command :

`:Failed to fetch plugin https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue via registry. Probably this is either a connection problem, or plugin spec is incorrect.

sir please tell me how to fix this error ?

hellkith commented 5 years ago

@hellkith but sir i got this error after install above command :

`:Failed to fetch plugin https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue via registry. Probably this is either a connection problem, or plugin spec is incorrect.

sir please tell me how to fix this error ?

@kapilSoni101 did you remove the old plugin before attempting to install it? You can always try to use the --nofetch flag

kapilSoni101 commented 5 years ago

@hellkith: I got another error after remove plugin

> Uninstalling cordova-plugin-firebase from android
> Error during processing of action! Attempting to revert...
> Uh oh!
> AndroidStudio.js:inAndroidStudioProject root does not exist: /Users/kapil/Desktop/project/AMS/platforms/android
> [ERROR] An error occurred while running subprocess cordova.

I am not understand why got above error this plugin is present in our plugin list,...

com.googlemaps.ios 2.7.0 "Google Maps SDK for iOS"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-advanced-http 2.0.2 "Advanced HTTP plugin"
cordova-plugin-android-permissions 1.0.0 "Permissions"
cordova-plugin-background-mode 0.7.2 "BackgroundMode"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-document-viewer 0.9.10 "SitewaertsDocumentViewer"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-filepath 1.5.1 "cordova-plugin-filepath"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.4.4 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-mauron85-background-geolocation 3.0.1 "CDVBackgroundGeolocation"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-request-location-accuracy 2.2.3 "Request Location Accuracy"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-telerik-imagepicker 2.2.2 "ImagePicker"
cordova-plugin-uniquedeviceid 1.3.2 "UniqueDeviceID"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 2.6.0 "Cordova sqlite storage plugin"
cordova.plugins.diagnostic 4.0.11 "Diagnostic"
org.apache.cordova.geolocation 0.3.6 "Geolocation"

i tried with with --nofetch not working.

MianAzhar commented 5 years ago

I've created PR #1058 to fix this by updating the plugin code to remove/replace references to deprecated API features that were removed in the April 05 Firebase SDK release. Until such time as it has been merged, you can install the fixed plugin directly off my fork:

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

@MianAzhar this solution will work for ionic v3 as I am using that aswell and this one works for me

@hellkith it is working for me. Thanks 👍

hellkith commented 5 years ago

@hellkith: I got another error after remove plugin

> Uninstalling cordova-plugin-firebase from android
> Error during processing of action! Attempting to revert...
> Uh oh!
> AndroidStudio.js:inAndroidStudioProject root does not exist: /Users/kapil/Desktop/project/AMS/platforms/android
> [ERROR] An error occurred while running subprocess cordova.

I am not understand why got above error this plugin is present in our plugin list,...

com.googlemaps.ios 2.7.0 "Google Maps SDK for iOS"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-advanced-http 2.0.2 "Advanced HTTP plugin"
cordova-plugin-android-permissions 1.0.0 "Permissions"
cordova-plugin-background-mode 0.7.2 "BackgroundMode"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-document-viewer 0.9.10 "SitewaertsDocumentViewer"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-filepath 1.5.1 "cordova-plugin-filepath"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.4.4 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-mauron85-background-geolocation 3.0.1 "CDVBackgroundGeolocation"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-request-location-accuracy 2.2.3 "Request Location Accuracy"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-telerik-imagepicker 2.2.2 "ImagePicker"
cordova-plugin-uniquedeviceid 1.3.2 "UniqueDeviceID"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 2.6.0 "Cordova sqlite storage plugin"
cordova.plugins.diagnostic 4.0.11 "Diagnostic"
org.apache.cordova.geolocation 0.3.6 "Geolocation"

i tried with with --nofetch not working.

Best thing to do is to first remove the platform

kapilSoni101 commented 5 years ago

@hellkith : tell me the procedure sir step by step please : what i do after remove platform?

rhanesoghlyan commented 5 years ago

Hey guys. If you are using version of cordova-android less then 8.0.0 you can use my forked repository ionic cordova plugin add https://github.com/rhanesoghlyan/cordova-plugin-firebase.git#master --save

No need to change anything in platforms/ directory. It's generated directory after adding the platform.

ferhaspert commented 5 years ago

Using ionic v1 you can update:

plugins/cordova-plugin-firebase/plugin.xml

<framework src="com.google.android.gms:play-services-tagmanager:15.+" />
<framework src="com.google.firebase:firebase-core:15.+" />
<framework src="com.google.firebase:firebase-messaging:15.+" />
<framework src="com.google.firebase:firebase-config:15.+" />
<framework src="com.google.firebase:firebase-perf:15.+" />

(add "15." before "+")

and file plugins/cordova-plugin-firebase/src/android/build.gradle

compile 'com.google.firebase:firebase-auth:15.+'

(same add "15." before "+")

then remove android platform and readd it

i'm not convinced it's the best fix so i won't do a PR, but at least it fixes the problem for now, hope it helps!

worked for me! Thanks!

newuser44 commented 5 years ago

This is due to the firebase updates on April 05. Here https://firebase.google.com/support/release-notes/android#update_-_april_02_2019, I found the last working versions and adjusted my project.properties accordingly like so 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 Here all dependencies are locked to the specific version (Update - April 02, 2019) instead of +, which would get you the latest version thus breaking the build process. Now I can build successfully! Hope it helps!

Not working on Ionic 3 :/

This is worked for me on Ionic 3. I didn't change anything with the plugins. (I had tried but installed everything back the way it was). Changed the project.properties files to the ones above. Making sure each one had the correct version.

I don't know if it made a different but I deleted the hidden ".gradle" folder. I then build android and it re downloads files.

kapilSoni101 commented 5 years ago

@rhanesoghlyan:- sir i got below error after install above plugin and i m using android 6.4.0 version

`:Failed to fetch plugin https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue via registry. Probably this is either a connection problem, or plugin spec is incorrect

kapilSoni101 commented 5 years ago

@newuser44 : sir tell me on thing if put above code inside the project.properties file and save file and again open project.properties updated changes are not refecting in our file why can you explain me please?

newuser44 commented 5 years ago

@newuser44 : sir tell me on thing if put above code inside the project.properties file and save file and again open project.properties updated changes are not refecting in our file why can you explain me please? @kapilSoni101 Is that all you are doing? If you remove and add android it creates a new project.properties. If you add the plugin then it also creates those values.