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

Migration guide from 2.3.0 to 2.4.0 #775

Open
michaburger opened this issue Nov 18, 2024 · 7 comments
Open

Migration guide from 2.3.0 to 2.4.0 #775

michaburger opened this issue Nov 18, 2024 · 7 comments

Comments

@michaburger
Copy link

Hi there, what do I have to do in order to migrate from 2.3.0 to 2.4.0? My app is working as of 2.3.0 and I am defining the access tokens in the gradle.properties file as well as with MapboxOptions.setAccessToken(). What has changed in 2.4.0 regarding the tokens? Now I get > Could not resolve com.mapbox.maps:android:11.8.0. Required by: project :app > Could not resolve com.mapbox.maps:android:11.8.0. > Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android/11.8.0/android-11.8.0.pom'. > Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android/11.8.0/android-11.8.0.pom'. Received status code 401 from server: Unauthorized > Could not resolve com.mapbox.maps:android:11.8.0.

@evil159
Copy link
Contributor

evil159 commented Nov 18, 2024

Hi @michaburger, there shouldn't be any specific steps to migrate, could you check if you have authentication setup for Mapbox Maven repository in your grade files?

@michaburger
Copy link
Author

Yes I do. Fact is, everything works perfectly with 2.3.0. The error only happens after upgrading to 2.4.0. Something must have changed regarding the tokens, what did you change exactly and what do I have to do?

@evil159
Copy link
Contributor

evil159 commented Nov 18, 2024

@michaburger We have lifted the authentication requirement for obtaining Maps SDK binaries, could you remove authentication from your maven setup and try again?

@michaburger
Copy link
Author

Ok, I removed the authentication part from my build.gradle file:

authentication { basic(BasicAuthentication) }

Result is still the same, 2.3.0 still works fine.

` > Failed to transform android-core-11.8.0.aar (com.mapbox.maps:android-core:11.8.0) to match attributes {artifactType=android-aar-metadata, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not download android-core-11.8.0.aar (com.mapbox.maps:android-core:11.8.0)
> Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android-core/11.8.0/android-core-11.8.0.aar'.
> Could not HEAD 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android-core/11.8.0/android-core-11.8.0.aar'. Received status code 401 from server: Unauthorized

Failed to transform common-24.8.0.aar (com.mapbox.common:common:24.8.0) to match attributes {artifactType=android-aar-metadata, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not download common-24.8.0.aar (com.mapbox.common:common:24.8.0)
> Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/common/common/24.8.0/common-24.8.0.aar'.
> Could not HEAD 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/common/common/24.8.0/common-24.8.0.aar'. Received status code 401 from server: Unauthorized

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 1m 5s
[!] Gradle threw an error while downloading artifacts from the network.
Error: Gradle task assembleDebug failed with exit code 1`

@favazHF
Copy link

favazHF commented Nov 21, 2024

I got error when trying to compile in Android with 2.4.1 version :(

@BishopSam
Copy link

@michaburger where you able to resolve it?

@evil159
Copy link
Contributor

evil159 commented Dec 2, 2024

Could you check if #789 helps?
Alternatively, since the current latest version(2.4.1) searches for SDK_REGISTRY_TOKEN and MAPBOX_DOWNLOADS_TOKEN, removing those from environmental variables and/or project properties should help as well.

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

4 participants