mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

Gradle sync failed. Received status code 401 from server: Unauthorized #16582

Open MakarovMVict opened 3 years ago

MakarovMVict commented 3 years ago

I am trying to import a project into a gradle(MapboxGLAndroidSDKTestApp), an error occurs "Gradle sync failed: Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/gradle/plugins/sdk-registry/0.3.0/sdk-registry-0.3.0.pom'. Received status code 401 from server: Unauthorized". I am logged in at https://www.mapbox.com and I have a key. I put this key into DEFAULT_MAPBOX_ACCESS_TOKEN, but it didnt helped.I replaced SDK_REGISTRY_TOKEN with my token from account in gradle.build , but it didnt help credentials { username "mapbox" password = project.hasProperty('SDK_REGISTRY_TOKEN') ? project.property('SDK_REGISTRY_TOKEN') : System.getenv('SDK_REGISTRY_TOKEN') }

Progdrasil commented 3 years ago

also reported in https://github.com/mapbox/mapbox-gl-native-android/issues/614 . Seems like an important issue in the fact that we can't update our dependencies...

Ra1Ca7eM commented 3 years ago

read the passages carefully

From the token creation page, give your token a name and make sure the box next to the Downloads:Read scope is checked