cowbell / cordova-plugin-geofence

Geofencing plugin for cordova
Apache License 2.0
265 stars 316 forks source link

Struggling with error Found com.google.android.gms:play-services-location:+, but version 9.0.0 is needed for the google-services-plugin #245

Open Baadier-Sydow opened 7 years ago

Baadier-Sydow commented 7 years ago

I'm struggling along with this error

        Found com.google.android.gms:play-services-location:+, but version 9.0.0
        is needed for the google-services plugin

I tried running ionic cordova build android --stacktrace --debug --log but it doesnt give me any more information on the offending plugin.

My understanding is that theirs a version clash with my plugin dependencies but this was the last plugin I installed https://github.com/cowbell/cordova-plugin-geofence/ and it says

<framework src="com.google.android.gms:play-services-location:+" />

in its plugin.xml and my gradle.build for my project has this compile block

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    debugCompile(project(path: "CordovaLib", configuration: "debug"))
    releaseCompile(project(path: "CordovaLib", configuration: "release"))
    compile "com.android.support:support-v4:25.+"
    compile "com.android.support:appcompat-v7:25.+"
    compile "com.squareup.okhttp3:okhttp:3+"
    compile "com.android.support:support-v4:24.1.1+"
    compile "com.google.firebase:firebase-core:+"
    compile "com.google.firebase:firebase-messaging:+"
    compile "com.google.android.gms:play-services-location:+"
    // SUB-PROJECT DEPENDENCIES END
}

I've done a search across the plugins and I only see these mentions in 2 plugins

cordova-plugin-fcm

        <framework src="com.google.firebase:firebase-core:+" />
        <framework src="com.google.firebase:firebase-messaging:+" />

cordova-plugin-geofence

<framework src="com.google.android.gms:play-services-location:+" />

Am I thinking about this incorrectly? I'm not a Java/Android developer so this part of it is all new to me

mibzman commented 7 years ago

I was having this exact issue! I resolved it by sigh adding another plugin.

someone made a package to resolve this exact conflict: https://github.com/dpa99c/cordova-android-play-services-gradle-release

Adding this plugin resolved my issue

Baadier-Sydow commented 7 years ago

Thanks, I'll give it a shot.

I've already spent quite a bit of time on this but the plugin you mentioned may also resolve the issues we had trying to setup up the Firebase Analytics plugin which resulted in similar errors.