maps icon indicating copy to clipboard operation
maps copied to clipboard

RN 0.66 Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0

Open gentlee opened this issue 3 years ago • 17 comments

Describe the bug
After upgrading React Native from 0.63.4 to 0.66 android project does not compile, showing the error:

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0.
     Required by:
         project :app > project :react-native-mapbox-gl_maps > com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0

Versions (please complete the following information):

  • Platform: Android
  • Dev OS: macOS 11.6
  • react-native-mapbox-gl Version 8.3.0
  • React Native Version 0.66

gentlee avatar Oct 12 '21 20:10 gentlee

can you please try with:

android/build.gradle

repositories {
    // ...
    jcenter()
}

ferdicus avatar Oct 13 '21 07:10 ferdicus

can you please try with:

android/build.gradle

repositories {
    // ...
    jcenter()
}

Works for me! Thanks

liamgarrison avatar Oct 13 '21 13:10 liamgarrison

notice, that this is probably just a temporary workaround as jcenter as a dep repo is no longer maintained indefinitely (some time 2022 I believe). I couldn't get it to work with mavenCentral unfortunately, although I believe, that mapbox did move their deps there 😕

ferdicus avatar Oct 13 '21 13:10 ferdicus

Is there any update soon to make this library work without jcenter() ?

danidaryaweesh avatar Oct 25 '21 00:10 danidaryaweesh

Is there any update soon to make this library work without jcenter() ?

nah, not in the works atm - feel free to open a PR though.

Also jcenter not gonna shut down anymore, so that's that 🤷🏿

ferdicus avatar Nov 03 '21 16:11 ferdicus

can you please try with:

android/build.gradle

repositories {
    // ...
    jcenter()
}

works for me, really thank you

francistec avatar Jan 14 '22 02:01 francistec

jcenter() is no longer supported in new RN versions

dacx avatar Mar 02 '22 12:03 dacx

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 01 '22 21:05 stale[bot]

jcenter.bintray.com is consistently returning error codes today. Because of that, we are removing jcenter from build.gradle to unblock Android builds locally. Doing so results in the error mentioned in this Issue's original description.

> Could not resolve all files for configuration ':app:dataminrStagingDebugRuntimeClasspath'.
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom
       - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom
       - https://www.jitpack.io/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom
     Required by:
         project :app > project :react-native-mapbox-gl_maps > com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0

Despite the fact that Jfrog says it will maintain it as read-only indefinitely, my team has seen issues where Jcenter + Bintray are unavailable which blocks any new Android builds.

It would be beneficial to move these dependencies to an actively-maintained dependency repository, like mavenCentral, to avoid the potential pain caused by jcenter's reliability diminishing over time.

ryanjwessel avatar May 04 '22 20:05 ryanjwessel

I also saw this Pull Request that references the flakiness of jcenter in January of this year.

ryanjwessel avatar May 04 '22 20:05 ryanjwessel

We spent the majority of the morning trying to fix this issue. Seems the conclusion was that jcenter was down and now it is back up. We are using React-Native 0.64.1, because some dependencies have not yet updated, and jcenter was still kept on as read only.

NathanNovak avatar May 04 '22 21:05 NathanNovak

jcenter.bintray.com is consistently returning error codes today. Because of that, we are removing jcenter from build.gradle to unblock Android builds locally. Doing so results in the error mentioned in this Issue's original description.

> Could not resolve all files for configuration ':app:dataminrStagingDebugRuntimeClasspath'.
   > Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom
       - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom
       - https://www.jitpack.io/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom
     Required by:
         project :app > project :react-native-mapbox-gl_maps > com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0

Despite the fact that Jfrog says it will maintain it as read-only indefinitely, my team has seen issues where Jcenter + Bintray are unavailable which blocks any new Android builds.

It would be beneficial to move these dependencies to an actively-maintained dependency repository, like mavenCentral, to avoid the potential pain caused by jcenter's reliability diminishing over time.

Hi we're experiencing the same issue, are you able to resolve the issue by now?

kooinam-ridebeam avatar May 12 '22 03:05 kooinam-ridebeam

Still not building...Any news or workaround?

Thanks!

Bad-Listener avatar May 18 '22 08:05 Bad-Listener

The Getting Started docs for Android does explain how to use mavenCentral over jCenter for this dependency. It does require more setup to provide the secret access token but should resolve this issue. I have not tried this yet, but it seems like it should work.

ryanjwessel avatar May 23 '22 14:05 ryanjwessel

I confirm, it's the only way to build right now getting rid of jcenter dependencies. Thanks mate!

PS. Be aware to follow the process of issuing a download token, and everything should be fine!

Bad-Listener avatar May 24 '22 12:05 Bad-Listener

As @ryanjwessel said, you can get rid of the deprecated jcenter() with a mapbox repo.

This is a step by step guide:

  1. Authorize here: https://account.mapbox.com/access-tokens/create/
  2. Check the box "DOWNLOADS:READ" and create a new token.
  3. Insert into android/gradle.properties your token: MAPBOX_DOWNLOADS_TOKEN=<here>
  4. Replace "jcenter()" with "mavenCentral()" in android/build.gradle and put the code under allprojects -> repositories:
	maven {
            url 'https://api.mapbox.com/downloads/v2/releases/maven'
            authentication {
                basic(BasicAuthentication)
            }
            credentials {
                // Do not change the username below.
                // This should always be `mapbox` (not your username).
                username = 'mapbox'
                // Use the secret token you stored in gradle.properties as the password
                password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
            }
       }

Doesn't matter if you had maven records before. This should work.

xaiamov avatar Jul 22 '22 13:07 xaiamov

I've followed these instructions to the letter but still no joy

Dakuan avatar Aug 07 '22 09:08 Dakuan

@Dakuan Did you find anyway to fix it ?

m7amad-7asan avatar Jan 02 '23 08:01 m7amad-7asan