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

armeabi is not work on armv7 devices #3985

Closed
Trinea opened this issue Feb 17, 2016 · 24 comments
Closed

armeabi is not work on armv7 devices #3985

Trinea opened this issue Feb 17, 2016 · 24 comments
Assignees
Labels
Android Mapbox Maps SDK for Android build support

Comments

@Trinea
Copy link

Trinea commented Feb 17, 2016

For smaller size, We add

ndk {
    abiFilters "armeabi"
}

in My app's build.gradle file, It means always compile armeabi folder, so use armeabi so if on armv7 devices, That's work for all tripartite library.

But when use mapbox, map is empty on armv7 devices if only use armeabi so like above.

I want to know why so lib of armeabi is not work on armv7 devices?

Thank you very much. @bleege

@bleege bleege added Android Mapbox Maps SDK for Android support labels Feb 17, 2016
@bleege
Copy link
Contributor

bleege commented Feb 18, 2016

Can you tell us what version of the Mapbox Android SDK that the app is using? Version 3.2.0 ships with support for the following ABI:

  • armeabi
  • armeabi-v7a
  • mips
  • x86
  • x86_64

If you're looking to ship smaller versions of your app's .apk files, I'd recommend exploring different apk-split options that Google makes available in the Gradle build tools.

/cc @mapbox/support

@Trinea
Copy link
Author

Trinea commented Feb 20, 2016

Thank you for your replay, My mapbox android sdk version is 3.1.0, It's already ships with support for the following ABI:

  • armeabi
  • armeabi-v7a
  • mips
  • x86
  • x86_64

My problem is that: why armeabi "so" lib of mapbox is not work on armv7 devices?

"so" of armeabi can also be work on armv7 devices usually, But if i compile armeabi folder of mapbox only, without armeabi-v7 folder by abiFilters "armeabi", The map is blank on armv7 devices.

@zugaldia
Copy link
Member

@Trinea This is my understanding as well, armeabi ABIs should work on armeabi-v7a devices. This could be a performance issue, or a bug with a specific device. Could you tell us which device have you been using to run your tests?

Independently, I'd also like to recommend the solution @bleege mentions above to reduce the size of your SDK. Shipping different APK split by ABI will guarantee that your users will take advantage of newer devices' CPU capabilities.

@Trinea
Copy link
Author

Trinea commented Mar 12, 2016

@zugaldia yes

we only compile armeabi for all devices. It's our project remaining problem, and we have not time to fix it now.

Our appstore does not support apk-split, we donnot use Google Play.

@zugaldia
Copy link
Member

@Trinea thank you for the feedback, this is very useful. Could you point us at the device you're using to reproduce this empty map issue?

@Trinea
Copy link
Author

Trinea commented Mar 13, 2016

ndk {
abiFilters "armeabi"
}
build.gradle like above

on Nexus 5

@bleege
Copy link
Contributor

bleege commented Mar 14, 2016

@Trinea Could you tell us about other dependencies that the app is using? Specifically, are there any other .aar that contain native code (ex: .so).?

@zugaldia
Copy link
Member

Just confirming that the TestApp shows the following crash on a Nexus 5 if we include the filter indicated above:

03-14 17:23:14.458 12684-12684/? I/art: Late-enabling -Xcheck:jni
03-14 17:23:14.513 12684-12684/com.mapbox.mapboxsdk.testapp W/System: ClassLoader referenced unknown path: /data/app/com.mapbox.mapboxsdk.testapp-2/lib/arm
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err: java.io.FileNotFoundException: /jacoco.exec: open failed: EROFS (Read-only file system)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:452)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at org.jacoco.agent.rt.internal_773e439.output.FileOutput.openFile(FileOutput.java:67)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at org.jacoco.agent.rt.internal_773e439.output.FileOutput.startup(FileOutput.java:49)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at org.jacoco.agent.rt.internal_773e439.Agent.startup(Agent.java:122)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at org.jacoco.agent.rt.internal_773e439.Agent.getInstance(Agent.java:50)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at org.jacoco.agent.rt.internal_773e439.Offline.<clinit>(Offline.java:31)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at com.mapbox.mapboxsdk.testapp.MapboxApplication.$jacocoInit(MapboxApplication.java)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at com.mapbox.mapboxsdk.testapp.MapboxApplication.<init>(MapboxApplication.java)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at java.lang.Class.newInstance(Native Method)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at android.app.Instrumentation.newApplication(Instrumentation.java:996)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at android.app.Instrumentation.newApplication(Instrumentation.java:981)
03-14 17:23:14.533 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at android.app.LoadedApk.makeApplication(LoadedApk.java:573)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4680)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at android.app.ActivityThread.-wrap1(ActivityThread.java)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at android.os.Looper.loop(Looper.java:148)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5417)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err: Caused by: android.system.ErrnoException: open failed: EROFS (Read-only file system)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at libcore.io.Posix.open(Native Method)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:438)
03-14 17:23:14.534 12684-12684/com.mapbox.mapboxsdk.testapp W/System.err:   ... 21 more
03-14 17:23:14.548 12684-12704/com.mapbox.mapboxsdk.testapp D/LeakCanary: Could not attempt cleanup, leak storage not writable.
03-14 17:23:14.624 12684-12684/com.mapbox.mapboxsdk.testapp W/LocationServices: Location Permissions Not Granted Yet.  Try again after requesting.
03-14 17:23:14.635 12684-12684/com.mapbox.mapboxsdk.testapp D/AndroidRuntime: Shutting down VM
03-14 17:23:14.636 12684-12684/com.mapbox.mapboxsdk.testapp E/AndroidRuntime: FATAL EXCEPTION: main
                                                                              Process: com.mapbox.mapboxsdk.testapp, PID: 12684
                                                                              java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mapbox.mapboxsdk.testapp/com.mapbox.mapboxsdk.testapp.MainActivity}: android.view.InflateException: Binary XML file line #32: Binary XML file line #32: Error inflating class com.mapbox.mapboxsdk.maps.MapView
                                                                                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                                  at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                                  at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                  at android.os.Looper.loop(Looper.java:148)
                                                                                  at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                  at java.lang.reflect.Method.invoke(Native Method)
                                                                                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                               Caused by: android.view.InflateException: Binary XML file line #32: Binary XML file line #32: Error inflating class com.mapbox.mapboxsdk.maps.MapView
                                                                                  at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
                                                                                  at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
                                                                                  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
                                                                                  at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
                                                                                  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
                                                                                  at com.mapbox.mapboxsdk.testapp.MainActivity.onCreate(MainActivity.java:103)
                                                                                  at android.app.Activity.performCreate(Activity.java:6251)
                                                                                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476at android.app.ActivityThread.-wrap11(ActivityThread.javaat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344at android.os.Handler.dispatchMessage(Handler.java:102at android.os.Looper.loop(Looper.java:148at android.app.ActivityThread.main(ActivityThread.java:5417at java.lang.reflect.Method.invoke(Native Methodat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616Caused by: android.view.InflateException: Binary XML file line #32: Error inflating class com.mapbox.mapboxsdk.maps.MapView
                                                                                  at android.view.LayoutInflater.createView(LayoutInflater.java:645)
                                                                                  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
                                                                                  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
                                                                                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
                                                                                  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                                                                                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
                                                                                  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                                                                                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
                                                                                  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                                                                                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
                                                                                  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                                                                                  at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
                                                                                  at android.view.LayoutInflater.inflate(LayoutInflater.java:423at android.view.LayoutInflater.inflate(LayoutInflater.java:374at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109at com.mapbox.mapboxsdk.testapp.MainActivity.onCreate(MainActivity.java:103at android.app.Activity.performCreate(Activity.java:6251at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476at android.app.ActivityThread.-wrap11(ActivityThread.javaat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344at android.os.Handler.dispatchMessage(Handler.java:102at android.os.Looper.loop(Looper.java:148at android.app.ActivityThread.main(ActivityThread.java:5417at java.lang.reflect.Method.invoke(Native Methodat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616Caused by: java.lang.reflect.InvocationTargetException
                                                                                  at java.lang.reflect.Constructor.newInstance(Native Method)
                                                                                  at android.view.LayoutInflater.createView(LayoutInflater.java:619)
                                                                                  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704at android.view.LayoutInflater.rInflate(LayoutInflater.java:835at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798at android.view.LayoutInflater.rInflate(LayoutInflater.java:838at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798at android.view.LayoutInflater.rInflate(LayoutInflater.java:838at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798at android.view.LayoutInflater.rInflate(LayoutInflater.java:838at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798at android.view.LayoutInflater.inflate(LayoutInflater.java:515at android.view.LayoutInflater.inflate(LayoutInflater.java:423at android.view.LayoutInflater.inflate(LayoutInflater.java:374at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109at com.mapbox.mapboxsdk.testapp.MainActivity.onCreate(MainActivity.java:103at android.app.Activity.performCreate(Activity.java:6251at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476at android.app.ActivityThread.-wrap11(ActivityThread.javaat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344at android.os.Handler.dispatchMessage(Handler.java:102at android.os.Looper.loop(Looper.java:148at android.app.ActivityThread.main(ActivityThread.java:5417at java.lang.reflect.Method.invoke(Native Methodat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.mapbox.mapboxsdk.testapp-2/base.apk"],nativeLibraryDirectories=[/data/app/com.mapbox.mapboxsdk.testapp-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libmapbox-gl.so"
                                                                                  at java.lang.Runtime.loadLibrary(Runtime.java:367)
                                                                                  at java.lang.System.loadLibrary(System.java:1076)
                                                                                  at com.mapbox.mapboxsdk.maps.NativeMapView.<clinit>(NativeMapView.java:44)
                                                                                  at com.mapbox.mapboxsdk.maps.MapView.initialize(MapView.java:193)
                                                                                  at com.mapbox.mapboxsdk.maps.MapView.<init>(MapView.java:157)
                                                                                  at java.lang.reflect.Constructor.newInstance(Native Methodat android.view.LayoutInflater.createView(LayoutInflater.java:619at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704at android.view.LayoutInflater.rInflate(LayoutInflater.java:835at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798at android.view.LayoutInflater.rInflate(LayoutInflater.java:838at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798at android.view.LayoutInflater.rInflate(LayoutInflater.java:838at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798at android.view.LayoutInflater.rInflate(LayoutInflater.java:838at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798at android.view.LayoutInflater.inflate(LayoutInflater.java:515at android.view.LayoutInflater.inflate(LayoutInflater.java:423at android.view.LayoutInflater.inflate(LayoutInflater.java:374at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109at com.mapbox.mapboxsdk.testapp.MainActivity.onCreate(MainActivity.java:103at android.app.Activity.performCreate(Activity.java:6251at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476at android.app.ActivityThread.-wrap11(ActivityThread.javaat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344at android.os.Handler.dispatchMessage(Handler.java:102at android.os.Looper.loop(Looper.java:148at android.app.ActivityThread.main(ActivityThread.java:5417at java.lang.reflect.Method.invoke(Native Methodat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616

@zugaldia
Copy link
Member

If the filter is changed to abiFilters "armeabi-v7a", everything works as expected.

For reference: Computing Version code in multi-flavor setup.

@tmpsantos
Copy link
Contributor

From the many things I've been trying, upgrading to Android NDK Revision 11c (March 2016) unfortunately won't fix this issue.

It seems to me that the compiler is generating invalid code for the C++14 stuff we use on run_loop.hpp.

@bleege
Copy link
Contributor

bleege commented Jun 2, 2016

@Trinea @tmpsantos After re-reading this ticket, I'm still a bit confused by it's overall direction. Is the goal of this to be able to only ship the armeabi .so with an app and have that single .so run on arm V5, V6, and V7 chips?

@KarenZZhang
Copy link

KarenZZhang commented Jun 3, 2016

@tobrun @lxbarth We need armeabi .so to run on armV7 devices. How to solve this? Pls help!.Thanks!

@xinnong
Copy link

xinnong commented Jun 3, 2016

@bleege @tobrun Because of the app packaging configuration, a developer needs to have armabi .so run on arm V7. They would not be able to change that in short time frame.

@bleege
Copy link
Contributor

bleege commented Jun 3, 2016

@KarenZZhang @xinnong Excellent! Thank you for clarifying the needs. This ticket makes much more sense now. 👍

I'll touch base with @tmpsantos on the work that he's started on this already and see what we can do.

@bleege
Copy link
Contributor

bleege commented Jun 3, 2016

Just noting that I've talked with @tmpsantos and he's had some success getting this to work in his local development environment. More technical information will come from him as he's running point on this investigation.

@KarenZZhang
Copy link

Thank you so much for your kind help! @bleege @tmpsantos @tobrun

@bleege
Copy link
Contributor

bleege commented Jun 6, 2016

I talked with @tmpsantos over the weekend and he said that he's going to pick this up on Monday.

@xinnong
Copy link

xinnong commented Jun 6, 2016

Excellent! Thanks @bleege @tmpsantos

@tmpsantos
Copy link
Contributor

Have a fix for this being tested/reviewed at #5254. I got an armeabi build working on a Nexus 5 (armv7) and Nexus 5x (armv8) with that branch.

tmpsantos added a commit that referenced this issue Jun 6, 2016
Backported patches fixing ARMv5 support for issue #3985.
@bleege
Copy link
Contributor

bleege commented Jun 6, 2016

This fix has also been cherrypicked on to the release-android-v4.1.0 branch which means that it'll ship with 4.1.0 Final. To help expedite it's availability process I've kicked off a new build to produce a new 4.1.0-SNAPSHOT. It should be available in about 30 minutes.

Great job @tmpsantos!

@wingwuyf
Copy link

wingwuyf commented Jun 8, 2016

@bleege How can I get the new build 4.1.0-SNAPSHOT? I can't find it in mavenCentral. Thanks!

@bleege
Copy link
Contributor

bleege commented Jun 8, 2016

@wingwuyf We publish nightly SNAPSHOTS and according the Web site it looks like the latest one is Number 48 from this morning. Please note that SNAPSHOTS aren't on the main mavenCentral() server but on Maven Central's SNAPSHOT server. This means the app's build.gradle will need to add it. Full installation details on how to do this are available on the Mapbox Android SDK Web site.

@bleege bleege added this to the android-v4.1.0 milestone Jun 8, 2016
@bleege bleege mentioned this issue Jun 8, 2016
14 tasks
@wingwuyf
Copy link

wingwuyf commented Jun 8, 2016

@bleege I've tried the 4.1.0-SNAPSHOT, it works fine without any trouble. Thank you so much!

@bleege
Copy link
Contributor

bleege commented Jun 8, 2016

@wingwuyf Great to hear that everything is working for you!

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

No branches or pull requests

8 participants