cordova-plugin-firebase icon indicating copy to clipboard operation
cordova-plugin-firebase copied to clipboard

New error on android build since 06-05-2019

Open clanglois421 opened this issue 6 years ago • 209 comments

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):

  • OS: Android
  • Version API 28 Revision 6

clanglois421 avatar May 06 '19 23:05 clanglois421

+1

rodriguezmanu avatar May 07 '19 00:05 rodriguezmanu

Same here. Tried to use cordova-play-services-gradle-release plugin (with + and 15.+) without success.

gartorware avatar May 07 '19 01:05 gartorware

+1 Same problem here.. any suggestion?

jordanorc avatar May 07 '19 01:05 jordanorc

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.

i think this error is related to this.

ejlodero avatar May 07 '19 02:05 ejlodero

@ejlodero I get the same error. I wonder why this is happening as this plugin is not updated since last year

sahyun1 avatar May 07 '19 04:05 sahyun1

@ejlodero I get the same error, I am looking in my graddle but I dont see that dependencies, some body found something?

pbejarano avatar May 07 '19 04:05 pbejarano

Same here, when trying to build android.

After a search at google I found following answer: https://medium.com/android-school/firebaseinstanceidservice-is-deprecated-50651f17a148

as the FirebaseInstanceIdService deprecated.

urjunior87 avatar May 07 '19 04:05 urjunior87

Hi, i have the same problem

jcruzrg avatar May 07 '19 04:05 jcruzrg

+1

nystsam avatar May 07 '19 04:05 nystsam

+1

munkyukim avatar May 07 '19 05:05 munkyukim

+1

emilwang avatar May 07 '19 05:05 emilwang

+1

hcassar93 avatar May 07 '19 05:05 hcassar93

i have the same problem....

syagawa avatar May 07 '19 05:05 syagawa

Same issue here, any hint?

BrunoTMartins avatar May 07 '19 06:05 BrunoTMartins

Same problem.

corrrso avatar May 07 '19 06:05 corrrso

Same problem

raiyanihiren avatar May 07 '19 06:05 raiyanihiren

same problem

JLopezZn avatar May 07 '19 07:05 JLopezZn

same problem

syedmaqbool avatar May 07 '19 07:05 syedmaqbool

same problem

sujungeo avatar May 07 '19 07:05 sujungeo

have the same problem

pluckannfeel avatar May 07 '19 08:05 pluckannfeel

Here is a quick fix if you guys can't wait for new plugin update release. https://forum.ionicframework.com/t/ionic-4-cordova-run-android-firebase-error-all-of-a-sudden/163204/23

cd11103 avatar May 07 '19 08:05 cd11103

Same problem here

pvillaverde avatar May 07 '19 08:05 pvillaverde

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!

fjckls avatar May 07 '19 09:05 fjckls

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!

where will you find project.properties

pluckannfeel avatar May 07 '19 09:05 pluckannfeel

Thanks @fjckls , it worked!! @pluckannfeel you can find it on platforms/android/project.properties

pvillaverde avatar May 07 '19 09:05 pvillaverde

@fjckls I've tried your fix, and the Gradle sync will work but building the app still throws the errors for as given by topic starter where it cannot find the methods from Firebase.

hellkith avatar May 07 '19 09:05 hellkith

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.

syagawa avatar May 07 '19 09:05 syagawa

i got two errors,

Failed to resolve: com.google.firebase:firebase-messaging:17.5 Failed to resolve: com.google.firebase:firebase-config:16.4

i got two errors, Failed to resolve: com.google.firebase:firebase-messaging:17.5 Failed to resolve: com.google.firebase:firebase-config:16.4

you forgot to add the final bit of it. messaging = 17.5.0 config = 16.4.1

exactly, my reply was wrong but yeah thats what i put, still error

pluckannfeel avatar May 07 '19 09:05 pluckannfeel

i got two errors,

Failed to resolve: com.google.firebase:firebase-messaging:17.5 Failed to resolve: com.google.firebase:firebase-config:16.4

you forgot to add the final bit of it. messaging = 17.5.0 config = 16.4.1

hellkith avatar May 07 '19 09:05 hellkith

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!

jetwitaussi avatar May 07 '19 09:05 jetwitaussi