Mapbox android SDK error - java.lang.ClassNotFoundException: Didn't find class “com.mapbox.android.telemetry.MapboxTelemetry”

本秂侑毒 提交于 2020-12-26 09:07:01

问题


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.


回答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




回答2:


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'] ?: ""
        }


来源:https://stackoverflow.com/questions/63066242/mapbox-android-sdk-error-java-lang-classnotfoundexception-didnt-find-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!