2

I have added mapbox sdk to existing android project via direct download (https://docs.mapbox.com/android/maps/overview/#add-the-dependency)

I have added dependancy to build.gradle file like below.

implementation project(':mapbox-android-sdk-9.3.0')

After that i have changed my source code using it and it was complied successfully and , but in runtime i got below exception.

 Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mapbox.android.telemetry.MapboxTelemetry" on path: DexPathList[[zip file "/data/app/com.xxxx.yyyy-LPdA94f71sQIsIW4AiNNZw==/base.apk"],nativeLibraryDirectories=[/data/app/com.xxxx.yyyy-LPdA94f71sQIsIW4AiNNZw==/lib/arm64, /system/lib64, /vendor/lib64, /product/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)

error was throwing by below line

Mapbox.getInstance(this.getActivity(), getString(R.string.mapbox_access_token));

Appreciate someone can help me to resolve this issue, thanks lot of your comments and feedback.

2 Answers2

1

I think, direct download process is not working and it asked many dependencies and after adding all of them, it asked libmapbox-gl.so , so this process is not working properly.

So i followed, map sdk adding via maven repository its working without any issue and we only need to create secret token first according to given steps. Please, follow the Maven steps (first tab) https://docs.mapbox.com/android/maps/overview/#add-the-dependency

0

What's username , its mapbox?

credentials {
            username = 'mapbox'
            // Use the secret token you stored in gradle.properties as the password
            password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
        }
  • Welcome to stackoverflow. Are you asking what the password is or was this your answer? To what question? Please add more context to your answers so everybody understands what you are telling. – tobi.g Aug 02 '20 at 20:19
  • 1
    @Van Halen yes, username is `mapbox` and password is generated token after login the mapbox account via ur credentials – Dileepa Chandrasekara Aug 03 '20 at 03:31