mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

Received status code 401 from server: Unauthorized

Open tabbg opened this issue 2 years ago • 23 comments

  • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not resolve com.mapbox.maps:android:10.10.0. Required by: project :app > project :mapbox_maps_flutter > Could not resolve com.mapbox.maps:android:10.10.0. > Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android/10.10.0/android-10.10.0.pom'. > Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android/10.10.0/android-10.10.0.pom'. Received status code 401 from server: Unauthorized > Could not resolve com.mapbox.maps:android:10.10.0. > Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android/10.10.0/android-10.10.0.pom'. > Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android/10.10.0/android-10.10.0.pom'. Received status code 401 from server: Unauthorized

How to modify it?

tabbg avatar May 26 '23 02:05 tabbg

I am also facing the same issue with the package, I have done all the config settings given on the readme file of this package.

Does, any one able to fix this issue, or can help me how to fix this issue?

rahul07sharmars avatar Sep 14 '23 05:09 rahul07sharmars

Hello there, @tabbg and @rahul07sharmars

If I may, where have you placed your Mapbox secret key?

jimkelly-nzioka avatar Dec 18 '23 19:12 jimkelly-nzioka

I'm also facing the same issue.

@nziokajimkelly I've added secret key to .gradle/gradle.properties and android/gradle.properties.

sugambee avatar Jan 05 '24 11:01 sugambee

Has this been resolved?

maxiggle avatar Jan 25 '24 05:01 maxiggle

@maxiggle Please check if your credentials are placed properly.

Nabinda avatar Jan 25 '24 05:01 Nabinda

They are properly placed. I downloaded the example code and ran it, since the access token is supposed to be stored in GRADLE_HOME, i assume the example code uses my token. The example code works. When I remove it, the example code throws a null error

But somehow does not run for my project. The IOS versions works perfectly

maxiggle avatar Jan 25 '24 05:01 maxiggle

I was having same issue because I misconfigured the mapbox credentials

Nabinda avatar Jan 25 '24 05:01 Nabinda

may I share a few images?, so you can help me see what's different?

maxiggle avatar Jan 25 '24 05:01 maxiggle

Okay sure please

Nabinda avatar Jan 25 '24 05:01 Nabinda

Screenshot 2024-01-25 at 06 58 26 Screenshot 2024-01-25 at 06 59 35

maxiggle avatar Jan 25 '24 06:01 maxiggle

The first one when I open gradle.properties file Screenshot 2024-01-25 at 07 01 46

maxiggle avatar Jan 25 '24 06:01 maxiggle

Is this your token secret token?

Nabinda avatar Jan 25 '24 06:01 Nabinda

Yes it is

maxiggle avatar Jan 25 '24 06:01 maxiggle

I have the Pk which is the public one delivered via flutterdotenv package

maxiggle avatar Jan 25 '24 06:01 maxiggle

Screenshot 2024-01-25 at 07 08 02

maxiggle avatar Jan 25 '24 06:01 maxiggle

Did you create mapbox_access_token.xml file with this content too

<resources xmlns:tools="http://schemas.android.com/tools">
    <string name="mapbox_access_token" translatable="false" tools:ignore="UnusedResources">ADD_MAPBOX_ACCESS_TOKEN_HERE</string>
</resources>```

Nabinda avatar Jan 25 '24 06:01 Nabinda

No I did not Is that necessary?

maxiggle avatar Jan 25 '24 06:01 maxiggle

https://pub.dev/packages/flutter_mapbox_navigation As the document first step says that I think it is needed, you can give it a try

Nabinda avatar Jan 25 '24 06:01 Nabinda

This access token is the secret token Yes?

maxiggle avatar Jan 25 '24 06:01 maxiggle

No Its supposed to be public access token

Nabinda avatar Jan 25 '24 06:01 Nabinda

okay

maxiggle avatar Jan 25 '24 06:01 maxiggle

Still got the same error I deleted my gradle cache Still does not work

maxiggle avatar Jan 25 '24 06:01 maxiggle

If I add the MAPBOX_DOWNLOADS_TOKEN to the user_gradle home, does it automatically reflect on gradle.properties file generated in the Flutter project?

maxiggle avatar Jan 25 '24 06:01 maxiggle