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

Error on latest version #103

Open
guillemc23 opened this issue Nov 19, 2023 · 8 comments
Open

Error on latest version #103

guillemc23 opened this issue Nov 19, 2023 · 8 comments

Comments

@guillemc23
Copy link

Hey! I just updated this plugin to the latest version v6.2.21 and I got the following error:

System.err: An uncaught Exception occurred on "main" thread.
  System.err: Calling js method run failed
  System.err: Error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/mapbox/android/accounts/v1/MapboxAccounts;

I'm not sure what could be causing it so I'll just report it and roll back to 6.2.19 for the moment.

@farfromrefug
Copy link
Member

farfromrefug commented Nov 19, 2023

@guillemc23 I think it is because I enforce an older version of mapbox. it is necessary for people not wanting to use latest mapbox SDK for which you need an apu key.
you can still enforce a newer version (in which the account thing appeared).
you can set the versions of all those https://github.com/nativescript-community/ui-mapbox/blob/master/packages/ui-mapbox/platforms/android/include.gradle#L7 in before-plugins.gradle as explained here https://v6.docs.nativescript.org/core-concepts/android-runtime/advanced-topics/gradle-hooks

@guillemc23
Copy link
Author

guillemc23 commented Nov 28, 2023

@farfromrefug I'm not sure if I follow. I'm not enforcing any mapbox version, so I guess it's taking the default one? Also, if I don't add my token, the map won't load, how is it possible to use it without token? I don't need to do much with Mapbox, but I only updated it to check for compatibility with the latest @nativescript/geolocation

@guillemc23
Copy link
Author

guillemc23 commented Nov 29, 2023

I am trying to enforce a newer version of Mapbox in my project; I have added the latest version to my before-plugins.gradle as in:

    project.ext { 
        mapboxVersion = "10.16.2"   
    }

But according to the Mapbox docs, the newer versions require to add a new maven repo with authentication somewhere. I have set up properly my token but I'm still unable to download the latest SDK. I have tried adding the repository directly into the plugin's include.gradle but it's returning this error when building:

Build file '/Users/Guille/Desktop/NS/TestApp/platforms/android/app/build.gradle' line: 589
A problem occurred configuring project ':app'.
Could not find com.mapbox.mapboxsdk:mapbox-android-sdk:10.16.2.
Required by:
    project :app

The latest available in maven is 9.2.1, which still returns the same errors as before.

@CatchABus
Copy link

Are there any plans on supporting something like Maplibre? It's a fork of mapbox from the days it was OSS.
https://github.com/maplibre/maplibre-native#maplibre-native

This project originated as a fork of Mapbox GL Native, before their switch to a non-OSS license in December 2020.

@farfromrefug
Copy link
Member

@CatchABus yes I mention it multiple times that this should be the future. but I won't do it. i will mostly never use maplibre as I much prefer another oss map framework ;)

@notclive
Copy link
Contributor

notclive commented Dec 5, 2023

I see a different error at build time, but it looks to be caused by the same issue.

I'm not specifying any mapbox version (so it should use 8.6.6), but when I run nativescript build android, then I see:

Build file '[..omitted..]/platforms/android/app/build.gradle' line: 589
A problem occurred configuring project ':app'.
Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0.
Required by:
    project :app > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0

Command ./gradlew failed with exit code 1

This is happening because com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0 depends on com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0.

I don't understand how to use before-plugins.gradle to make this work, even versions 8.6.6 and lower depend on mapbox-android-accounts.

@notclive
Copy link
Contributor

notclive commented Dec 5, 2023

Once I add the credentials block to app.gradle (and specify a MAPBOX_DOWNLOADS_TOKEN) the above errors go away.

@farfromrefug
Copy link
Member

@notclive thanks indeed it is needed with latest mapbox. though not sure why it wasn't using 8.6.6 in your case. will have to check might be a transitive dependency

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