System specifications:
Ubuntu 18
SDK 28
NDK 17
JDK 8
Android studio 3.2.1
Gradle 4.6
Steps to trigger the issue:
Cloning mapbox android SDK based on instaructions.
Building the project and run Test module successfully on emulator device.
Building aar file of release and debug of MapboxGLAndroidSDK using Ubuntu terminal as follows:
make clean
make android-configuration
make apackage BUILDTYPE=Release(Debug)
Building process was successful.
Importing aar to new Android project and creating simple map based on Mapbox first step.
Runing the project on emulator which throws this error:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/mapbox/android/telemetry/MapboxTelemetry;
at com.mapbox.mapboxsdk.module.telemetry.TelemetryImpl.<init>(TelemetryImpl.java:28)
at com.mapbox.mapboxsdk.ModuleProviderImpl.obtainTelemetry(ModuleProviderImpl.java:21)
at com.mapbox.mapboxsdk.Mapbox.initializeTelemetry(Mapbox.java:130)
at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:60)
at com.example.test.mymap.MainActivity.onCreate(MainActivity.java:24)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mapbox.android.telemetry.MapboxTelemetry" on path: DexPathList[[zip file "/data/app/com.example.test.mymap-1/base.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.test.mymap-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.test.mymap-1/lib/x86, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.mapbox.mapboxsdk.module.telemetry.TelemetryImpl.<init>(TelemetryImpl.java:28)
at com.mapbox.mapboxsdk.ModuleProviderImpl.obtainTelemetry(ModuleProviderImpl.java:21)
at com.mapbox.mapboxsdk.Mapbox.initializeTelemetry(Mapbox.java:130)
at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:60)
at com.example.test.mymap.MainActivity.onCreate(MainActivity.java:24)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Suppressed: java.lang.ClassNotFoundException: com.mapbox.android.telemetry.MapboxTelemetry
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 19 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
I've checked this issue to resolve the problem but running the ./gradlew dependencie command throws the following error:
Could not get unknown property 'mapbox.abis' for project ':MapboxGLAndroidSDK' of type org.gradle.api.Project.
In order to resolve the next error I've tried steps of this issue with no success.
How can I build a correct aar from MapboxGLAndroidSDK to use in my project?
@harry-wilson when you include a local aar file in a project it seems that it doesn't automatically download the required dependencies. Including the following dependencies to your consuming module will solve this:
api dependenciesList.mapboxAndroidTelemetry
api dependenciesList.mapboxJavaGeoJSON
api dependenciesList.mapboxAndroidGestures
implementation dependenciesList.mapboxJavaTurf
implementation dependenciesList.supportAppcompatV7
implementation dependenciesList.supportAnnotations
implementation dependenciesList.supportFragmentV4
implementation dependenciesList.okhttp3
The dependency list is defined here.
Closing this as resolved, if you have an idea where this issue stems from or how to resolve it at root please let us know! And please reach out if above didn't solve your issue.
Thanks @tobrun for your suggestion. It solved the problem as I added required dependencies to my project.
@harry-wilson when you include a local aar file in a project it seems that it doesn't automatically download the required dependencies. Including the following dependencies to your consuming module will solve this:
api dependenciesList.mapboxAndroidTelemetry api dependenciesList.mapboxJavaGeoJSON api dependenciesList.mapboxAndroidGestures implementation dependenciesList.mapboxJavaTurf implementation dependenciesList.supportAppcompatV7 implementation dependenciesList.supportAnnotations implementation dependenciesList.supportFragmentV4 implementation dependenciesList.okhttp3The dependency list is defined here.
Closing this as resolved, if you have an idea where this issue stems from or how to resolve it at root please let us know! And please reach out if above didn't solve your issue.
the link is 404
@tobrun where do you add these dependencies exactly
Most helpful comment
the link is 404