CapacitorGoogleAuth icon indicating copy to clipboard operation
CapacitorGoogleAuth copied to clipboard

Could not resolve com.google.android.gms:play-services-auth:18.+

Open black-hawk85 opened this issue 4 years ago • 12 comments

Since few days I'm getting the following error while gradle build

> Could not resolve all files for configuration ':app:stagingDebugRuntimeClasspath'.
   > Could not resolve com.google.android.gms:play-services-auth:18.+.
     Required by:
         project :app > project :codetrix-studio-capacitor-google-auth
      > Failed to list versions for com.google.android.gms:play-services-auth.
         > Unable to load Maven meta-data from https://dl.bintray.com/ionic-team/capacitor/com/google/android/gms/play-services-auth/maven-metadata.xml.
            > Could not GET 'https://dl.bintray.com/ionic-team/capacitor/com/google/android/gms/play-services-auth/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

I'm using @codetrix-studio/[email protected]

Any idea how to solve this?

black-hawk85 avatar Dec 17 '21 07:12 black-hawk85

When I try to access to https://dl.bintray.com/, I got a 502 bad gateway. It seems to be related to dl.bintray.com https://isdown.app/integrations/bintray

Le ven. 17 déc. 2021 à 08:56, black-hawk85 @.***> a écrit :

Since few days I'm getting the following error while gradle build

Could not resolve all files for configuration ':app:stagingDebugRuntimeClasspath'. Could not resolve com.google.android.gms:play-services-auth:18.+. Required by: project :app > project :codetrix-studio-capacitor-google-auth > Failed to list versions for com.google.android.gms:play-services-auth. > Unable to load Maven meta-data from https://dl.bintray.com/ionic-team/capacitor/com/google/android/gms/play-services-auth/maven-metadata.xml. > Could not GET 'https://dl.bintray.com/ionic-team/capacitor/com/google/android/gms/play-services-auth/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

I'm using @@.***

Any idea how to solve this?

— Reply to this email directly, view it on GitHub https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues/163, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2M5BIBYUX6A7GUIPZFMZLURLUKFANCNFSM5KIGRAXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Cordialement, Adel Abdelli

adelabd avatar Dec 17 '21 08:12 adelabd

Ya I saw the 502 message aswell while manually opening the URL. So means shall wait for few days n try again?

black-hawk85 avatar Dec 17 '21 08:12 black-hawk85

jcenter() was deprecated and should be replaced by mavenCentral(). This must be fixed in this plugin.

patryk-eco avatar Dec 22 '21 08:12 patryk-eco

Yes, I also saw it. My temporary workaround is to make an offline gradle build in command line

./gradlew assembleStagingDebug --offline

But I agree with you, it must be fixed in the plugin.

black-hawk85 avatar Dec 22 '21 08:12 black-hawk85

@patryk-eco has right. https://developer.android.com/studio/build/jcenter-migration

adelabd avatar Dec 22 '21 09:12 adelabd

You can use my fork https://github.com/patryk-eco/CapacitorGoogleAuth.git in the package.json:

npm i -D patryk-eco/CapacitorGoogleAuth#fix-jcenter

patryk-eco avatar Dec 22 '21 09:12 patryk-eco

I had to make an additional fix. This should work for you, if you are curious: npm i github:patryk-eco/CapacitorGoogleAuth#d09f1e5

patryk-eco avatar Dec 22 '21 10:12 patryk-eco

Unfortunately still getting errors. Does your fork work with Capacitor 2?

black-hawk85 avatar Dec 22 '21 15:12 black-hawk85

Hey guys, just to prevent duplication: Did you inform the capacitor-google-auth project? Otherwise, I would create an issue there.

carsten-klaffke avatar Dec 28 '21 11:12 carsten-klaffke

@carsten-klaffke I haven't created an issue there yet. You can do it if you want

black-hawk85 avatar Dec 28 '21 11:12 black-hawk85

@black-hawk85

Unfortunately still getting errors. Does your fork work with Capacitor 2?

For me it worked! Did you run "npm install" and "npm run build" in the fork? And then "ionic cap update" and "ionic cap sync" in your project?

carsten-klaffke avatar Dec 30 '21 16:12 carsten-klaffke

My workaround to fix this issue:

Step 1, set up postinstall step: Create in a root of your project file called 'postinstall.ts' and add this string to your package.json (to the "scripts"): "postinstall": "node postinstall.ts"

Step 2, Add package to replace required string in CapactiorGoogleAuth: npm i replace-in-file --save

Step 3, content of postinstall.ts :

const replace = require('replace-in-file');

const set_specific_version = {
  files: 'node_modules/@codetrix-studio/capacitor-google-auth/android/build.gradle',
  from: 'gms:play-services-auth:18.+',
  to: 'gms:play-services-auth:18.1.0',
  allowEmptyPaths: false,
};
replace(set_specific_version)
  .then(() => {
    console.log('postinstall.ts: Modified file succesfully !');
  })
  .catch(error => {
    console.error('postinstall.ts: Error occurred:', error);
  });

Now, on each npm install, npm will automatically patch capacitor-google-auth with specific version of play-services, and gradle build will work;

Nikita-schetko avatar Jan 10 '22 20:01 Nikita-schetko