Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Android TestApp Crashing When MapView Is Loaded #5108

Closed
bleege opened this issue May 23, 2016 · 10 comments
Closed

Android TestApp Crashing When MapView Is Loaded #5108

bleege opened this issue May 23, 2016 · 10 comments
Labels
Android Mapbox Maps SDK for Android crash

Comments

@bleege
Copy link
Contributor

bleege commented May 23, 2016

After updating to the latest on master 25c4436 and running the TestApp on a Samsung S5 (API 21) the app crashes when any Activity with a MapView is loaded. The error (see stacktrace below) points to an issue with the geojsonvt, and not the still open issue about switching arm64 to use gold instead of bfd as the Samsung S5 is 32 bit. I've tried checking out the previous version of mason c03b19241ad6450dab16bf06466f849cb5a15757 and rebuilding with the same issue happening. Based on that it's unclear to me if this is related to the new NDK version in #5092 .

Steps To Reproduce

  1. Update code to 25c4436
  2. Update Git submodules
  3. Make Android
    1. make clean
    2. make android
  4. Run TestApp on arm device
  5. Choose Polygon activity (any will do it, but for consistency in debugging let's focus on this one)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6mapbox9geojsonvt7Convert11projectRingERKNSt6__ndk16vectorINS0_6LonLatENS2_9allocatorIS4_EEEEd" referenced by "libmapbox-gl.so"...
         at java.lang.Runtime.loadLibrary(Runtime.java:371)
         at java.lang.System.loadLibrary(System.java:989)
         at com.mapbox.mapboxsdk.maps.NativeMapView.<clinit>(NativeMapView.java:44)
         at com.mapbox.mapboxsdk.maps.MapView.initialize(MapView.java:203)
         at com.mapbox.mapboxsdk.maps.MapView.<init>(MapView.java:166)
         at java.lang.reflect.Constructor.newInstance(Native Methodat java.lang.reflect.Constructor.newInstance(Constructor.java:288at android.view.LayoutInflater.createView(LayoutInflater.java:614at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:750at android.view.LayoutInflater.rInflate(LayoutInflater.java:813at android.view.LayoutInflater.inflate(LayoutInflater.java:511at android.view.LayoutInflater.inflate(LayoutInflater.java:415at android.view.LayoutInflater.inflate(LayoutInflater.java:366at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140at com.mapbox.mapboxsdk.testapp.activity.offline.OfflineActivity.onCreate(OfflineActivity.java:64at android.app.Activity.performCreate(Activity.java:6221at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2614at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726at android.app.ActivityThread.access$900(ActivityThread.java:172at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421at android.os.Handler.dispatchMessage(Handler.java:102at android.os.Looper.loop(Looper.java:145at android.app.ActivityThread.main(ActivityThread.java:5835at java.lang.reflect.Method.invoke(Native Methodat java.lang.reflect.Method.invoke(Method.java:372at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194

/cc @tmpsantos @kkaefer @jfirebaugh @zugaldia @tobrun @cammace @danswick

@bleege bleege added Android Mapbox Maps SDK for Android crash labels May 23, 2016
@bleege bleege added this to the android-v4.1.0 milestone May 23, 2016
@jfirebaugh
Copy link
Contributor

@kkaefer Did you rebuild the Android geojsonvt binaries as part of mapbox/mason@72f30dd? If so, and if we don't have a quick fix for this, we should roll back that commit, and the binaries.

@bleege
Copy link
Contributor Author

bleege commented May 23, 2016

I checked out the latest commit prior the NDK update in master ( 7272d7c ), updated the git submodule, made the SDK / TestApp, and successfully ran it on the Samsung S5. This tells me that @jfirebaugh is on the right path.

@jfirebaugh
Copy link
Contributor

Hmm, that's inconsistent with what you earlier reported @bleege. Building on 7272d7c should be exactly equivalent to building with the prior mason hash, because the only change in 25c4436 was updating the mason hash.

The reason I said the binaries could be the issue is because you said that reverting mason didn't help. If the binaries changed in an incompatible manner, than reverting mason wouldn't completely resolve the issue, because the binaries are stored on S3.

So we need to conclusively determine whether or not reverting 25c4436 resolves the issue, as you are now reporting, or whether it does not, as you reported in the initial description.

@bleege
Copy link
Contributor Author

bleege commented May 24, 2016

Yeah, this is an odd one. I'll give things another try with master and see where it leads. Below is the steps I followed to get the "working" version that I previously mentioned.

git checkout 7272d7c84cf6e874b417ecd165f46f26ae7729c9
git submodule update
make clean
make android

The original attempt to use the "old" Mason dependencies with the latest from master was:

git pull origin master  // Equivalent to git checkout 25c4436d37d84cb8eb800385b412e784a0789087
cd .mason/
git checkout c03b19241ad6450dab16bf06466f849cb5a15757
cd ../
make clean
make android

@bleege
Copy link
Contributor Author

bleege commented May 24, 2016

I just did a clean build from master and updated .mason and it errored out again with a similar stack trace. Here's my steps:

git checkout master
git pull  //  Grabs latest from `master` which is the NDK commit at 25c4436d37d84cb8eb800385b412e784a0789087
git submodule update  // Results in Submodule path '.mason': checked out '72f30dd4a483f8e52133b8112c061db10c04fdba'
make clean
make android

Here's the stack trace from this:

05-23 21:39:13.679 15095-15095/com.mapbox.mapboxsdk.testapp E/art: dlopen("/data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN6mapbox9geojsonvt7Convert11projectRingERKNSt6__ndk16vectorINS0_6LonLatENS2_9allocatorIS4_EEEEd" referenced by "libmapbox-gl.so"...
05-23 21:39:13.689 15095-15095/com.mapbox.mapboxsdk.testapp E/AndroidRuntime: FATAL EXCEPTION: main
                                                                              Process: com.mapbox.mapboxsdk.testapp, PID: 15095
                                                                              java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6mapbox9geojsonvt7Convert11projectRingERKNSt6__ndk16vectorINS0_6LonLatENS2_9allocatorIS4_EEEEd" referenced by "libmapbox-gl.so"...
                                                                                  at java.lang.Runtime.loadLibrary(Runtime.java:371)
                                                                                  at java.lang.System.loadLibrary(System.java:989)
                                                                                  at com.mapbox.mapboxsdk.maps.NativeMapView.<clinit>(NativeMapView.java:44)
                                                                                  at com.mapbox.mapboxsdk.maps.MapView.initialize(MapView.java:203)
                                                                                  at com.mapbox.mapboxsdk.maps.MapView.<init>(MapView.java:178)
                                                                                  at com.mapbox.mapboxsdk.testapp.activity.annotation.PolygonActivity.onCreate(PolygonActivity.java:55)
                                                                                  at android.app.Activity.performCreate(Activity.java:6221)
                                                                                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
                                                                                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2614)
                                                                                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                                  at android.app.ActivityThread.access$900(ActivityThread.java:172)
                                                                                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
                                                                                  at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                  at android.os.Looper.loop(Looper.java:145)
                                                                                  at android.app.ActivityThread.main(ActivityThread.java:5835)
                                                                                  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:1399)
                                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

@mpuchala
Copy link

mpuchala commented May 24, 2016

Same here just after updating to new snapshot release.

E/art: dlopen("/data/app/.../lib/arm/libmapbox-gl.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE" referenced by "libmapbox-gl.so"...
FATAL EXCEPTION: main
Process: ..., PID: 4194
                                                                                java.lang.RuntimeException: Unable to start activity ComponentInfo{....MainActivity}: android.view.InflateException: Binary XML file line #21: Error inflating class com.mapbox.mapboxsdk.maps.MapView
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
                                                                                    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: android.view.InflateException: Binary XML file line #21: Error inflating class com.mapbox.mapboxsdk.maps.MapView
                                                                                    at android.view.LayoutInflater.createView(LayoutInflater.java:633)
                                                                                    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
                                                                                    at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
                                                                                    at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
                                                                                    at ....onCreateView(...Fragment.java:144)
                                                                                    at android.app.Fragment.performCreateView(Fragment.java:2053)
                                                                                    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:894)
                                                                                    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
                                                                                    at android.app.BackStackRecord.run(BackStackRecord.java:834)
                                                                                    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1452)
                                                                                    at android.app.Activity.performStart(Activity.java:6005)
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2288)
                                                                                    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.reflect.InvocationTargetException
                                                                                    at java.lang.reflect.Constructor.newInstance(Native Method)
                                                                                    at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
                                                                                    at android.view.LayoutInflater.createView(LayoutInflater.java:607)
                                                                                    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) 
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                                                                                    at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
                                                                                    at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
                                                                                    at ....onCreateView(...Fragment.java:144) 
                                                                                    at android.app.Fragment.performCreateView(Fragment.java:2053) 
                                                                                    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:894) 
                                                                                    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) 
                                                                                    at android.app.BackStackRecord.run(BackStackRecord.java:834) 
                                                                                    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1452) 
                                                                                    at android.app.Activity.performStart(Activity.java:6005) 
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2288) 
                                                                                    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.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE" referenced by "libmapbox-gl.so"...
                                                                                    at java.lang.Runtime.loadLibrary(Runtime.java:371)
                                                                                    at java.lang.System.loadLibrary(System.java:988)
                                                                                    at com.mapbox.mapboxsdk.maps.NativeMapView.<clinit>(NativeMapView.java:44)
                                                                                    at com.mapbox.mapboxsdk.maps.MapView.initialize(MapView.java:203)
                                                                                    at com.mapbox.mapboxsdk.maps.MapView.<init>(MapView.java:166)
                                                                                    at java.lang.reflect.Constructor.newInstance(Native Method) 
                                                                                    at java.lang.reflect.Constructor.newInstance(Constructor.java:288) 
                                                                                    at android.view.LayoutInflater.createView(LayoutInflater.java:607) 
                                                                                    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) 
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                                                                                    at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
                                                                                    at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
                                                                                    at ....onCreateView(...Fragment.java:144) 
                                                                                    at android.app.Fragment.performCreateView(Fragment.java:2053) 
                                                                                    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:894) 
                                                                                    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) 
                                                                                    at android.app.BackStackRecord.run(BackStackRecord.java:834) 
                                                                                    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1452) 
                                                                                    at android.app.Activity.performStart(Activity.java:6005) 
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2288) 
                                                                                    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) 

@dariav
Copy link

dariav commented May 24, 2016

Having the same issue as @mpuchala

@bleege
Copy link
Contributor Author

bleege commented May 24, 2016

Discussed internally and decided to revert the Android NDK update commit 25c4436 for now so that development can continue.

@bleege
Copy link
Contributor Author

bleege commented May 24, 2016

I reverted the Android NDK commit, rebuilt locally, and successfully tested the TestApp on a Samsung S5. The reverted commit is 6abd3d7 on master now.

The next step is to create a new ticket to upgrade to the latest NDK and start work on it after 4.1.0 FINAL ships.

@jfirebaugh
Copy link
Contributor

This has regressed on master because we've re-updated mason, which again pulled in NDK r11c. We need to revert the update in mason itself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android crash
Projects
None yet
Development

No branches or pull requests

4 participants