mapbox / mapbox-maps-flutter

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

Bug(android): Missing Plugin for 11.4.0 #580

Open supposedlysam-bb opened 3 weeks ago

supposedlysam-bb commented 3 weeks ago

When upgrading to 2.0 and running the build for Android I receive


FAILURE: Build failed with an exception.

* 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:11.4.0.
     Required by:
         project :app > project :mapbox_maps_flutter
      > Could not resolve com.mapbox.maps:android:11.4.0.
         > Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android/11.4.0/android-11.4.0.pom'.
            > Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android/11.4.0/android-11.4.0.pom'. Received status code 403 from server: Forbidden
      > Could not resolve com.mapbox.maps:android:11.4.0.
         > Could not get resource 'https://api.mapbox.com/downloads/v2/snapshots/maven/com/mapbox/maps/android/11.4.0/android-11.4.0.pom'.
            > Could not GET 'https://api.mapbox.com/downloads/v2/snapshots/maven/com/mapbox/maps/android/11.4.0/android-11.4.0.pom'. Received status code 403 from server: Forbidden

* 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 44s
[!] Gradle threw an error while downloading artifacts from the network.

Is there something I can do to get around this?

maios commented 3 weeks ago

Hi @supposedlysam-bb, can you double check that you have setup Mapbox download token according to this guide?

You mentioned that this happened when upgrading to MapboxMaps Flutter v2.0, does this mean that you have been using older version of this plugin, with the same download token and it worked?

supposedlysam-bb commented 3 weeks ago

It looks like it's actually building fine in my CI, but not locally.

Thanks for the link to the Android guide. I opened up the Android guide, then looked at the Flutter readme on the pub but they have conflicting information. Should I be using SDK_REGISTRY_TOKEN or MAPBOX_DOWNLOADS_TOKEN in the ~/.gradle/gradle.properties file?

Side by side of the guide (left) and Flutter pub readme (right) image

PrzemyslawPluszowy commented 3 weeks ago

I have the same error in a new project. I added SDK_REGISTRY_TOKEN=... in Gradle and I tried to use MapboxOptions.setAccessToken. This is my first time using this package. Can help me to fix it?

PrzemyslawPluszowy commented 3 weeks ago

It looks like it's actually building fine in my CI, but not locally.

Thanks for the link to the Android guide. I opened up the Android guide, then looked at the Flutter readme on the pub but they have conflicting information. Should I be using SDK_REGISTRY_TOKEN or MAPBOX_DOWNLOADS_TOKEN in the ~/.gradle/gradle.properties file?

Side by side of the guide (left) and Flutter pub readme (right) image

ok i have it in gardle.propeties use SDK_REGISTRY_TOKEN=

but in android/app/src/main/res/values/strings.xml

create string.xml and inside

`<?xml version="1.0" encoding="utf-8"?>

YOUR KEY TOKEN ` documentation on pub dev is incomplete
PrzemyslawPluszowy commented 3 weeks ago

oh when i crated key a mark DOWNLOAD:READ

supposedlysam-bb commented 3 weeks ago

I'm still having trouble getting it to build locally. Is there a debugging technique I can use to better understand what's going on and why I'm receiving a 403 @maios?