mapbox / mapbox-maps-flutter

Interactive, thoroughly customizable maps for Flutter powered by Mapbox Maps SDK
https://www.mapbox.com/mobile-maps-sdk
Other
275 stars 107 forks source link

Received status code 401 from server: Unauthorized #174

Open tabbg opened 1 year ago

tabbg commented 1 year ago

How to modify it?

rahul07sharmars commented 11 months ago

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?

jimvandijk commented 8 months ago

Hello there, @tabbg and @rahul07sharmars

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

sugambee commented 8 months ago

I'm also facing the same issue.

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

maxiggle commented 7 months ago

Has this been resolved?

Nabinda commented 7 months ago

@maxiggle Please check if your credentials are placed properly.

maxiggle commented 7 months ago

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

Nabinda commented 7 months ago

I was having same issue because I misconfigured the mapbox credentials

maxiggle commented 7 months ago

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

Nabinda commented 7 months ago

Okay sure please

maxiggle commented 7 months ago
Screenshot 2024-01-25 at 06 58 26 Screenshot 2024-01-25 at 06 59 35
maxiggle commented 7 months ago

The first one when I open gradle.properties file

Screenshot 2024-01-25 at 07 01 46
Nabinda commented 7 months ago

Is this your token secret token?

maxiggle commented 7 months ago

Yes it is

maxiggle commented 7 months ago

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

maxiggle commented 7 months ago
Screenshot 2024-01-25 at 07 08 02
Nabinda commented 7 months ago

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>```
maxiggle commented 7 months ago

No I did not Is that necessary?

Nabinda commented 7 months ago

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

maxiggle commented 7 months ago

This access token is the secret token Yes?

Nabinda commented 7 months ago

No Its supposed to be public access token

maxiggle commented 7 months ago

okay

maxiggle commented 7 months ago

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

maxiggle commented 7 months ago

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?