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

Endless google play services & firebase VERSION problems #988

Closed
mesqueeb opened this issue Jan 17, 2019 · 1 comment
Closed

Endless google play services & firebase VERSION problems #988

mesqueeb opened this issue Jan 17, 2019 · 1 comment

Comments

@mesqueeb
Copy link

mesqueeb commented Jan 17, 2019

Describe the bug
This plugin gives me problems building for android.

I have installed:

  • cordova-android-play-services-gradle-release
  • cordova-android-firebase-gradle-release

And have tried a couple of settings.

First of all, it won't build at all because of this error:

Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin'] > For input string: "+"

Which can be fixed by:

  1. go to cordova/platforms/android/cordova-support-google-services/ and open the gradle file
  2. to comment out the line: // apply plugin: com.google.gms.googleservices.GoogleServicesPlugin

(This solution is from this thread)
Ok, so now it can build, but we have a lot of version errors.

Option 1

put all versions of the helper plugins on 16.0.6
Then we get errors like:

> Could not find com.google.firebase:firebase-auth:16.0.6.
> Could not find com.google.firebase:firebase-config:16.0.6.
> Could not find com.google.firebase:firebase-common:16.0.6.
> Could not find com.google.firebase:firebase-analytics-impl:16.0.6.
> Could not find com.google.android.gms:play-services-auth:16.0.6.
> Could not find com.google.android.gms:play-services-identity:16.0.6.
> Could not find com.google.android.gms:play-services-ads-identifier:16.0.6.
> Could not find com.google.firebase:firebase-measurement-connector-impl:16.0.6.
> Could not find com.google.android.gms:play-services-basement:16.0.6.
> Could not find com.google.android.gms:play-services-measurement-api:16.0.6.
> Could not find com.google.firebase:firebase-common:16.0.6.

And many more, and for each those lines a bunch of files it "searched" through.

Option 2

put all versions of the helper plugins on 16.+
Then we get errors like:

Failed to notify dependency resolution listener.
> The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.0.5,16.0.5], [16.0.0,16.0.0]], but resolves to 16.0.5. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
> The library com.google.firebase:firebase-analytics is being requested by various other libraries at [[16.0.6,16.0.6], [16.0.1,16.0.1]], but resolves to 16.0.6. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Does anyone know what the correct versions are I need to use for firebase and google play ?

Best regards!

@mesqueeb
Copy link
Author

Fixed it by using '+' for all versions

My config.xml

     <plugin name="cordova-plugin-googleplus" spec="7.0.0">
        <variable name="PLAY_SERVICES_VERSION" value="+" />
    </plugin>
    <plugin name="cordova-plugin-firebase" spec="^2.0.5" />
    <plugin name="cordova-android-play-services-gradle-release" spec="^2.0.0">
        <variable name="PLAY_SERVICES_VERSION" value="+" />
    </plugin>
    <plugin name="cordova-android-firebase-gradle-release" spec="^2.0.0">
        <variable name="FIREBASE_VERSION" value="+" />
    </plugin>

my package.json

        "plugins": {
            "cordova-plugin-whitelist": {},
            "cordova-plugin-inappbrowser": {},
            "cordova-plugin-wkwebview-engine": {},
            "cordova-plugin-x-socialsharing": {
                "ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
            },
            "cordova-plugin-googleplus": {
                "PLAY_SERVICES_VERSION": "+"
            },
            "cordova-plugin-firebase": {},
            "cordova-android-play-services-gradle-release": {
                "PLAY_SERVICES_VERSION": "+"
            },
            "cordova-android-firebase-gradle-release": {
                "FIREBASE_VERSION": "+"
            }

the be sure to remove and add android again!

  1. cordova platform remove android
  2. cordova platform add android
  3. and apply the fix of my first post:
    The fix for error:

Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin'] > For input string: "+"

Then all should work!

tanoinc added a commit to tanoinc/mi-universidad-app that referenced this issue Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant