Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
clanglois421 opened this issue May 6, 2019 · 209 comments
Open

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

clanglois421 opened this issue May 6, 2019 · 209 comments

Comments

@clanglois421
Copy link

clanglois421 commented May 6, 2019

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
@rodriguezmanu
Copy link

+1

@gartorware
Copy link

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

@jordanorc
Copy link

+1 Same problem here.. any suggestion?

@ejlodero
Copy link

ejlodero commented May 7, 2019

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.

@sahyun1
Copy link

sahyun1 commented May 7, 2019

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

@pbejarano
Copy link

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

@urjunior87
Copy link

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.

@jcruzrg
Copy link

jcruzrg commented May 7, 2019

Hi, i have the same problem

@nystsam
Copy link

nystsam commented May 7, 2019

+1

3 similar comments
@munkyukim
Copy link

+1

@github-emilwang
Copy link

+1

@hcassar93
Copy link

hcassar93 commented May 7, 2019

+1

@syagawa
Copy link

syagawa commented May 7, 2019

i have the same problem....

@BrunoTMartins
Copy link

Same issue here, any hint?

@corrrso
Copy link

corrrso commented May 7, 2019

Same problem.

@raiyanihiren
Copy link

Same problem

@JLopezZn
Copy link

JLopezZn commented May 7, 2019

same problem

2 similar comments
@syedmaqbool
Copy link

same problem

@sujungeo
Copy link

sujungeo commented May 7, 2019

same problem

@pluckannfeel
Copy link

have the same problem

@cd11103
Copy link

cd11103 commented May 7, 2019

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

@pvillaverde
Copy link

Same problem here

@fjckls
Copy link

fjckls commented May 7, 2019

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!

@pluckannfeel
Copy link

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

@pvillaverde
Copy link

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

@hellkith
Copy link

hellkith commented May 7, 2019

@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.

@syagawa
Copy link

syagawa commented May 7, 2019

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.

@pluckannfeel
Copy link

pluckannfeel commented May 7, 2019

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

@hellkith
Copy link

hellkith commented May 7, 2019

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

@jetwitaussi
Copy link

jetwitaussi commented May 7, 2019

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!

@ansarikhurshid786
Copy link

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

this work for me , thanks

I am getting error :
D8: Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver

@ansarikhurshid786
Copy link

can someone help i am tried fixed but not working?

@ansarikhurshid786
Copy link

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

can you please write complete solution? so it will help everyone.

@sagrawal31
Copy link

sagrawal31 commented Jul 2, 2019

@ansarikhurshid786
Copy link

@sagrawal31 thanks let me try

@ansarikhurshid786
Copy link

@sagrawal31 thanks a lot. finally it is working.

simply i am using your old version plugin with latest platform :

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

@enesgrahovac
Copy link

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 made these changes and got another error stemming from this change:

`FAILURE: Build failed with an exception.

What went wrong:
Could not resolve all files for configuration ":app:debugCompileClasspath"
Could not find com.google.firebase:firebase-core:16.0.8 .
Required by:
project :app
Could not find com.google.firebase:firebase-messaging:17.5.0 .
Required by:
project :app
Could not find com.google.firebase:firebase-core:16.0.8 .
Required by:
project :app
Could not find com.google.firebase:firebase-messaging:17.5.0 .
Required by:
project :app
Could not find com.google.firebase:firebase-config:16.4.1 .
Required by:
project :app
Could not find com.google.firebase:firebase-config:16.4.1 .
Required by:
project :app > com.google.firebase:firebase-perf:16.2.4
`

@ackanir
Copy link

ackanir commented Jul 17, 2019

Using @punksta's solution I had still this message when building my Ionic app:
no resource identifier found for attribute 'appcomponentfactory' in package 'android'
Or this one:
The library com.google.firebase:firebase-iid is being requested by various other libraries at [[17.1.1,17.1.1]], but resolves to 19.0.0.

I identified new dependencies to set by running ./gradlew ::dependencies in platforms/android/
(or ./gradlew :app:dependencies for non Ionic projects)

Here is the updated build-extras.gradle I came up with:

def dependencyMap = [
        "com.google.firebase:firebase-core" : "16.0.8",
        "com.google.firebase:firebase-perf": "16.2.4",
        "com.google.firebase:firebase-messaging": "17.5.0",
        "com.google.firebase:firebase-config": "16.4.1",
        "com.google.firebase:firebase-iid": "17.1.1",
        "com.google.firebase:firebase-auth": "16.2.0",
        "com.google.android.gms:play-services-tagmanager": "16.0.8"
]

ext.postBuildExtras = {
    configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def group = details.requested.group
            def name = details.requested.name
            def fullName =  group + ":" + name
            if (dependencyMap.containsKey(fullName)) {
                println 'Forcing version ' + dependencyMap[fullName] + ' for ' + fullName
                details.useVersion dependencyMap[fullName]
            }
        }
    }
}

To have more details about how to use this file, please refer to the original solution here

@punksta
Copy link

punksta commented Jul 17, 2019

@remifleurance
cool. I've updated my answer with your package list

@mavericardo
Copy link

#1058

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.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git checkout GH-1057-April-05-android-build-issue
npm ERR! error: pathspec 'GH-1057-April-05-android-build-issue' did not match any file(s) known to git
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/marcosricardo/.npm/_logs/2019-07-24T13_08_19_728Z-debug.log

@AlejandroSilva
Copy link

AlejandroSilva commented Jul 26, 2019

the solution is to don't use this plugin anymore (as is not maintened), and replace it with cordova-plugin-firebase-lib (a fork with several fixes):

ionic cordova plugin remove cordova-plugin-firebase
ionic cordova plugin add cordova-plugin-firebase-lib@3.3.0 --save

@pbrisson
Copy link

pbrisson commented Aug 2, 2019

@remifleurance You fix worked well. However now I'm getting:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

Any idea?

@ackanir
Copy link

ackanir commented Aug 5, 2019

@pbrisson
Try with this build-extras.gradle :

def dependencyMap = [
        "com.google.firebase:firebase-core" : "16.0.8",
        "com.google.firebase:firebase-perf": "16.2.4",
        "com.google.firebase:firebase-messaging": "17.5.0",
        "com.google.firebase:firebase-config": "16.4.1",
        "com.google.firebase:firebase-iid": "17.1.1",
        "com.google.firebase:firebase-auth": "16.2.0",
        "com.google.android.gms:play-services-tagmanager": "16.0.8"
]

ext.postBuildExtras = {
    configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            /* Note this new section */
            def requested = details.requested
            if (requested.group == 'com.android.support') {
                if (!requested.name.startsWith("multidex")) {
                    details.useVersion '26.1.0'
                }
            }

            def group = details.requested.group
            def name = details.requested.name
            def fullName =  group + ":" + name
            if (dependencyMap.containsKey(fullName)) {
                println 'Forcing version ' + dependencyMap[fullName] + ' for ' + fullName
                details.useVersion dependencyMap[fullName]
            }
        }
    }
}

Also clean and rebuild your project.

@pbrisson
Copy link

pbrisson commented Aug 5, 2019

Thanks @remifleurance

Turns out it was another plugin causing the issue (old version of pushwoosh-cordova-plugin).

Thanks for all your help! Your initial solution is working.

@mariocalin
Copy link

the solution is to don't use this plugin anymore (as is not maintened), and replace it with cordova-plugin-firebase-lib (a fork with several fixes):

ionic cordova plugin remove cordova-plugin-firebase
ionic cordova plugin add cordova-plugin-firebase-lib@3.3.0 --save

This was the solution in my case

@akaushik79
Copy link

Hi All,

Ionic:

   Ionic CLI          : 5.2.6 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 7.1.0
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : no whitelisted plugins (12 plugins total)

Utility:

   cordova-res : 0.6.0
   native-run  : 0.2.8

System:

   ios-deploy : 1.9.4
   NodeJS     : v8.16.1 (/usr/local/bin/node)
   npm        : 6.4.1
   OS         : macOS High Sierra
   Xcode      : Xcode 10.1 Build version 10B61

I am able to build debug APK but as soon as i add --prod and --release tag it gives following error:

ionic cordova build android --prod --release
[WARN] Detected locally installed Ionic CLI, but it's too old--using global CLI.
[WARN] The pro_id field in ./ionic.config.json has been deprecated.

       Ionic Pro has been renamed to Ionic Appflow! We've copied the value in pro_id to id, but you may want to unset
       the deprecated property: ionic config unset pro_id

> ionic-app-scripts build --prod --target cordova --platform android
[13:59:03]  ionic-app-scripts 3.2.4
[13:59:03]  build prod started ...
[13:59:03]  clean started ...
[13:59:03]  clean finished in 2 ms
[13:59:03]  copy started ...
[13:59:03]  deeplinks started ...
[13:59:04]  deeplinks finished in 550 ms
[13:59:04]  ngc started ...
[13:59:07]  ionic-app-script task: "build"
[13:59:07]  TypeError: Object prototype may only be an Object or null: undefined
TypeError: Object prototype may only be an Object or null: undefined
    at setPrototypeOf (<anonymous>)
    at Object.__extends (/Users/ankitkau/WorkDocs/Ankit Kaushik/ionic/mapskool-ionic3/node_modules/tslib/tslib.js:64:9)
    at /Users/ankitkau/WorkDocs/Ankit Kaushik/ionic/mapskool-ionic3/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:115:17
    at /Users/ankitkau/WorkDocs/Ankit Kaushik/ionic/mapskool-ionic3/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:314:6
    at Object.defineProperty.value (/Users/ankitkau/WorkDocs/Ankit Kaushik/ionic/mapskool-ionic3/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:3:17)
    at Object.<anonymous> (/Users/ankitkau/WorkDocs/Ankit Kaushik/ionic/mapskool-ionic3/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:9:3)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
[ERROR] An error occurred while running subprocess ionic-app-scripts.

        ionic-app-scripts build --prod --target cordova --platform android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

Please help in getting this resolved. I am not able to push my app updates since last 2 months because of this.

rideo-eduardmorales added a commit to team-rideosoftware/cordova-plugin-firebase that referenced this issue Sep 27, 2019
@neogucky
Copy link

neogucky commented Oct 8, 2019

the solution is to don't use this plugin anymore (as is not maintened), and replace it with cordova-plugin-firebase-lib (a fork with several fixes):

ionic cordova plugin remove cordova-plugin-firebase
ionic cordova plugin add cordova-plugin-firebase-lib@3.3.0 --save

After doing that I get the following error for which I can't find any solutions. Do you have any advice?

Installing "cordova-plugin-firebasex" for android
Plugin dependency "cordova-plugin-androidx@1.0.2" already fetched, using that version.
Dependent plugin "cordova-plugin-androidx" already installed on android.
Plugin dependency "cordova-plugin-androidx-adapter@1.1.0" already fetched, using that version.
Dependent plugin "cordova-plugin-androidx-adapter" already installed on android.
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-firebasex': CordovaError: Uh oh!
"....../platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java" already exists!

I use the following plugins:

    <plugin name="cordova-plugin-firebasex" spec="^6.0.4" />
    <plugin name="cordova-plugin-app-version" spec="~0.1.9" />
    <plugin name="cordova-sqlite-storage" spec="^3.2.1" />
    <plugin name="cordova-plugin-network-information" spec="^2.0.2" />
    <plugin name="cordova-plugin-whitelist" spec="~1.3.3" />
    <plugin name="cordova-plugin-statusbar" spec="~2.4.2" />
    <plugin name="cordova-plugin-splashscreen" spec="~5.0.2" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
    <plugin name="cordova-plugin-telerik-imagepicker" spec="^2.3.3">
        <variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="Select profile picture" />
    </plugin>
    <plugin name="cordova-plugin-crop" spec="^0.4.0" />
    <plugin name="cordova-android-support-gradle-release" spec="^3.0.1">
        <variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-local-notification" spec="^0.9.0-beta.2" />
    <plugin name="cordova-plugin-file" spec="^6.0.2" />
    <plugin name="info.protonet.imageresizer" spec="^0.1.1" />
    <plugin name="com-badrit-base64" spec="^0.2.0" />
    <plugin name="cordova-plugin-ionic-webview" spec="^4.1.1" />
    <plugin name="cordova-plugin-camera" spec="4.1.0">
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-firebase-messaging" spec="https://github.com/chemerisuk/cordova-plugin-firebase-messaging.git" />
    <engine name="browser" spec="^5.0.4" />
    <engine name="ios" spec="^4.5.5" />

@jayzzz00
Copy link

Ionic 4 with Angular
I am installing firebase plugin in ionic 4 with Angular but it throws error of version conflict for gsm service. its working fine in ionic 3 with ionic 3 framework plugin firebase but not in ionic 4.

cordova plugin Firebase not work in ionic 4 with Angular project

BUILD FAILED
Error output:
FAILURE: Build failed with an exception.

  • What went wrong:
    Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
    The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.0.0,17.0.0], [17.2.0,17.2.0]], but resolves to 17.2.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

@yasdev8
Copy link

yasdev8 commented Oct 19, 2019

the solution is to don't use this plugin anymore (as is not maintened), and replace it with cordova-plugin-firebase-lib (a fork with several fixes):

ionic cordova plugin remove cordova-plugin-firebase
ionic cordova plugin add cordova-plugin-firebase-lib@3.3.0 --save

I tried to use this solution but it doesn't work. I create a blank angular app. I just try to add this plugin :
ionic cordova plugin add cordova-plugin-firebase-lib@3.3.0 --save

--> Build failed

@himanshu-itmca
Copy link

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

cordova plugin add cordova-plugin-firebase-lib@3.3.0 --save
Installing "cordova-plugin-firebase-lib" for android
Android Studio project detected
Failed to install 'cordova-plugin-firebase-lib': Error: ENOENT: no such file or directory, open '/home/himanshu/development/ionic/testfcm2/platforms/android/app/src/main/AndroidManifest.xml'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Object.parseElementtreeSync (/home/himanshu/development/ionic/testfcm2/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js:180:27)
at new AndroidManifest (/home/himanshu/development/ionic/testfcm2/platforms/android/cordova/lib/AndroidManifest.js:29:20)
at AndroidProject.getPackageName (/home/himanshu/development/ionic/testfcm2/platforms/android/cordova/lib/AndroidProject.js:99:12)
at Api.addPlugin (/home/himanshu/development/ionic/testfcm2/platforms/android/cordova/Api.js:223:57)
at handleInstall (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:594:10)
at /usr/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:357:28
at _fulfilled (/usr/lib/node_modules/cordova/node_modules/q/q.js:854:54)
at /usr/lib/node_modules/cordova/node_modules/q/q.js:883:30

@kaushikparmar
Copy link

kaushikparmar commented Jan 17, 2020

Following worked for me.

target=android-28
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.android.support:support-annotations:27.+
cordova.gradle.include.1=cordova-support-google-services/app-build.gradle
cordova.gradle.include.2=phonegap-plugin-multidex/app-multidex.gradle
cordova.system.library.2=com.android.support:support-v13:27.+
cordova.system.library.3=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.4=com.google.firebase:firebase-messaging:17.3.0
cordova.system.library.5=com.google.android.gms:play-services-analytics:16.0.3
cordova.system.library.6=com.android.support:support-v4:24.1.1+
cordova.system.library.7=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.8=com.android.support:support-v4:27+
cordova.system.library.9=com.google.firebase:firebase-analytics:16.0.3
cordova.system.library.11=com.android.support:appcompat-v7:23+

@kapilSoni101
Copy link

@AlejandroSilva :i tried ur solution but in got another error in the console : T

Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet