-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Does Mapbox Support Robolectric testing? #14492
Comments
@erluxman yes we do support them, we also use them ourselves for testing the SDK for some scenarios. The crash you are hitting can be expected as you are trying to load/access a native library on the JVM of your development machine(vs instrumented on a device) while the shared objects are created specifically for android. This won't work and that it doesn't work is a works as designed. Solutions to this either range from mocking components that require native code or running an instrumented unit test instead so you are able to load to shared object on the JVM of an Android device. |
Are there any sample of testing Mapbox for Android App which uses Mapbox and has other UIs rather than testing just MapBox? I can't run any kind of Robolectric test due to above error. |
As indicated above, you need to mock components that load native libraries. |
@erluxman If this is happening due to the initialization in your |
@saadfarooq do you have any example of using TestApplication? Sorry that I am very very very beginner with Testing, let alone the Robolectric. |
This issue is duplicate and I solved it in #14428 |
Is this issue actually a duplicated from #14428 ? the proposed answer to that thread wont work. I believe the real question is:
|
Steps to reproduce
Mapbox.getInstance(this, BuildConfig.MAPBOX_ACCESS_KEY)
java.lang.UnsatisfiedLinkError: com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize()V
Expected behavior: The test should pass.
Actual behavior: Full Stacktress
Configuration
Android versions: Any
Device models: Any
Mapbox SDK versions:Any
The text was updated successfully, but these errors were encountered: