EddyVerbruggen / cordova-plugin-googleplus

:heavy_plus_sign: Cordova plugin to login with Google Sign-In on iOS and Android
567 stars 630 forks source link

BUILD FAILED: Could not find com.google.android.gms:play-services-auth:11.8.0 #478

Open scottforte opened 6 years ago

scottforte commented 6 years ago

https://github.com/EddyVerbruggen/cordova-plugin-googleplus/blob/63f5c998bca843d2eb2120028432dcdfe6467d94/plugin.xml#L32

Phonegap Build is failing with this exception:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'project'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
   > Could not find com.google.android.gms:play-services-auth:11.8.0.
     Required by:
         project :
   > Could not find com.google.android.gms:play-services-identity:11.8.0.
     Required by:
         project :

I tried removing the plugin, just to confirm the plugin was actually causing the error. Once I removed the plugin, the build succeeded. So it is the plugin, and this is the only line of code that looks like it could be causing the error. Not sure how to solve it, wish I could be of more help.

The plugin was working fine about a month ago.

Using: Phonegap Build Version of Plugin: latest <plugin name="cordova-plugin-googleplus" source="npm">

Here is the full error Message. Not sure is this helps.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'project'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
   > Could not find com.google.android.gms:play-services-auth:11.8.0.
     Required by:
         project :
   > Could not find com.google.android.gms:play-services-identity:11.8.0.
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.256 secs
Error: /project/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'project'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
   > Could not find com.google.android.gms:play-services-auth:11.8.0.
     Required by:
         project :
   > Could not find com.google.android.gms:play-services-identity:11.8.0.
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    at ChildProcess.whenDone (/project/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
EddyVerbruggen commented 6 years ago

Cause: #474, not sure what to do.. switching back to the old version will give other issues.

lvloper commented 6 years ago

I managed to correct this error by changing the version of com.google.android.gms:play-services-identity and com.google.android.gms:play-services-auth from 11.8.0 to 11.0.4 in my platforms/android/project.properties

scottforte commented 6 years ago

Hey @EddyVerbruggen, can you elaborate when you say "other issues". Is going back to 11.0.4 as @lucianomizra suggested the best "for now" fix?

EddyVerbruggen commented 6 years ago

The issues mentioned in the linked bug.

gilzonme commented 6 years ago

Did anyone found solution for this?

oleksii-lyhun commented 6 years ago

I solved this problem simply by changing the version of android in config.xml <engine name="android" spec="^7.0.0" /> Or you can open file

platforms->android->build.gradle

and add code maven { url "https://maven.google.com" } to buildscript.repositories and to allprojects.repositories

KlejdyszS commented 6 years ago

I did all the things you guys posted, but it still does not compile in phonegap build, anyone has some better solution?

I still get error

Could not find com.google.android.gms:play-services-auth:11.8.0.

after including

<plugin name="cordova-plugin-googleplus" source="npm">

gilzonme commented 6 years ago

@KlejdyszS i did this by changing the version to a lower one. And it worked.

vipulism commented 6 years ago

@lucianomizra these changes works for me when i made the same changes in my platforms/android/build-extras.gradle all version of 11.8.0 to 11.0.4 thanks

DRKRahul commented 6 years ago

@EddyVerbruggen did you get any solution for this issue?

coldwhiz commented 6 years ago

Using phonegap build with "phonegap-version" as "cli-8.0.0" and "pgb-builder-version" as "2", I am facing a different issue. It is asking to use a higher version 11.6.2. For now using a fork as quick fix.

BUILD FAILED in 9s
18 actionable tasks: 18 executed
Error: /gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.2.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s
    at ChildProcess.whenDone (/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
garybentley commented 6 years ago

In phonegap build, changing:

com.google.android.gms:play-services-auth:11.8.0 com.google.android.gms:play-services-identity:11.8.0

to:

com.google.android.gms:play-services-auth:+ com.google.android.gms:play-services-identity:+

allowed a clean build. I used a cloned repo and created my own plugin but with only those changes.

The login works.

patelashish16 commented 5 years ago

my issue solve

cordova plugin remove cordova-plugin-google-analytics

ionic cordova platform rm android

ionic cordova platform add android

ionic cordova build android

work fine

bppearsoft commented 5 years ago

i use the ionic pro package service and it was failing with 11.8.0. I fixed it by changing this in my package.json file: "PLAY_SERVICES_VERSION": "11.6.2"

MarcosRibeiroJesus commented 5 years ago

In phonegap build, changing:

com.google.android.gms:play-services-auth:11.8.0 com.google.android.gms:play-services-identity:11.8.0

to:

com.google.android.gms:play-services-auth:+ com.google.android.gms:play-services-identity:+

allowed a clean build. I used a cloned repo and created my own plugin but with only those changes.

The login works.

`A problem occurred evaluating root project 'android'.

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

amamitpandey commented 5 years ago

in Ionic 3

Update file from plateform -> android -> project-properties

target=android-27 android.library.reference.1=CordovaLib android.library.reference.2=app cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0 cordova.system.library.2=com.android.support:support-v4:24.1.1+ cordova.system.library.3=com.facebook.android:facebook-android-sdk:4.36.0 cordova.system.library.4=com.google.firebase:firebase-core:10.+ cordova.system.library.5=com.google.firebase:firebase-messaging:10.+ cordova.gradle.include.1=cordova-plugin-fcm-with-dependecy-updated/app-FCMPlugin.gradle cordova.system.library.6=com.google.android.gms:play-services-auth:10.+ cordova.system.library.7=com.google.android.gms:play-services-identity:10.+ cordova.system.library.8=com.android.support:support-v4:24.1.1+

and build it once again for android

it working for me

davinderkumar commented 5 years ago

I am also getting this problem, on Meteor 1.8. Here is error log

:javaPreCompileRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':releaseCompileClasspath'.
> Could not find play-services-identity.jar (com.google.android.gms:play-services-identity:11.8.0).
  Searched in the following locations:
      https://jcenter.bintray.com/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
27 actionable tasks: 2 executed, 25 up-to-date
=> Errors executing Cordova commands:         

   While building Cordova app for platform Android:
   Error: /Users/davinder/Work/map/appname/app/.meteor/local/cordova-build/platforms/android/gradlew: Command failed with exit code 1 Error output:
   FAILURE: Build failed with an exception.

   * What went wrong:
   Could not resolve all files for configuration ':releaseCompileClasspath'.
   > Could not find play-services-identity.jar (com.google.android.gms:play-services-identity:11.8.0).
   Searched in the following locations:
   https://jcenter.bintray.com/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.jar

It was fixed after I changed android - project.properties file line cordova.system.library.4=com.google.android.gms:play-services-identity:11.8.0 to cordova.system.library.4=com.google.android.gms:play-services-identity:11.0.4

my previous builds with 1.6 has cordova.system.library.4=com.google.android.gms:play-services-identity:+

is there any fix available to this so I do not have to manually change these versions?

patelashish16 commented 5 years ago

Call 9106413704

On Thu 28 Mar, 2019, 12:31 AM Davinder Kumar Meen, notifications@github.com wrote:

I am also getting this problem, on Meteor 1.8. Here is error log

:javaPreCompileRelease FAILED

FAILURE: Build failed with an exception.

BUILD FAILED in 2s 27 actionable tasks: 2 executed, 25 up-to-date => Errors executing Cordova commands:

While building Cordova app for platform Android: Error: /Users/davinder/Work/map/appname/app/.meteor/local/cordova-build/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

It was fixed after I changed android - project.properties file line

cordova.system.library.4=com.google.android.gms:play-services-identity:11.8.0 to

cordova.system.library.4=com.google.android.gms:play-services-identity:11.0.4

my previous builds with 1.6 has cordova.system.library.4=com.google.android.gms:play-services-identity:+

is there any fix available to this so I do not have to manually change these versions?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/478#issuecomment-477305068, or mute the thread https://github.com/notifications/unsubscribe-auth/AT_--EatEYw2RA90ZbdLCeok8TrDcELnks5va7_ugaJpZM4TGIw9 .

Piter-Ruiz commented 5 years ago

Hey @amamitpandey so much thank you!! It working for me!!

ngthienlinh commented 5 years ago

I have the same build error. Fix it by editing platforms/android/build.gradle, make sure jcenter() is below maven:

...
buildscript {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }
}
...
allprojects {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }
}
...
mayankkataria commented 2 years ago

Solution: In cordova-plugin-googleplus/plugin.xml - Replace '$PLAY_SERVICES_VERSION' with '+'

GuidoGagliardini commented 1 year ago

I managed to correct this error by changing the version of com.google.android.gms:play-services-identity and com.google.android.gms:play-services-auth from 11.8.0 to 11.0.4 in my platforms/android/project.properties

in ionic 5 - Android SDK 33 - Cordova 11 and :

    "cordova-plugin-googleplus": "git+https://github.com/EddyVerbruggen/cordova-plugin-googleplus.git",
    "cordova-plugin-fcm-with-dependecy-updated": "git+https://github.com/marutifh/cordova-plugin-fcm-with-dependecy-updated.git",
      "cordova-plugin-fcm-with-dependecy-updated": {
        "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher",
        "ANDROID_FIREBASE_BOM_VERSION": "29.0.1",
        "ANDROID_GOOGLE_SERVICES_VERSION": "4.3.4",
        "ANDROID_GRADLE_TOOLS_VERSION": "7.1.3",
        "IOS_FIREBASE_MESSAGING_VERSION": "~> 7.4.0",
        "ANDROID_FCM_VERSION": "23.0.0"
      }

I had to change in platfomrs/android/app/build.gradle


    implementation "com.google.android.gms:play-services-auth:17.0.0"
    implementation "com.google.android.gms:play-services-identity:17.0.0"

for this

    implementation "com.google.android.gms:play-services-auth:17.0.0"
    implementation "com.google.android.gms:play-services-identity:17.0.0"

in project.properties

cordova.system.library.2=com.google.android.gms:play-services-auth:15.0.1
cordova.system.library.3=com.google.android.gms:play-services-identity:15.0.1

for this

cordova.system.library.2=com.google.android.gms:play-services-auth:17.0.0
cordova.system.library.3=com.google.android.gms:play-services-identity:17.0.0