-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Error inflating class com mapbox.mapboxgl.lib.MapView Android #738
Comments
It cannot find the native library. Did Are you trying to run this on a device or in the emulator? If in the emulator, are you using ARM system image or x86? (You need to use ARM currently) |
when i click on make project it complete successfully and i'm trying to run it on the device |
Can you check if |
yes it exists, i worked on it, i don't have any errors but when it starts i get the the toolbar with Bright writen on it and after that it crash and the map does not show up this is what i got in the Android section after Running the program on my device: 01-02 14:46:31.276 4535-4535/com.mapbox.mapboxgl.app D/dalvikvm﹕ Zygote::ForkAndSpecialize : 0 |
Hmm it seems to be loading the library OK now. Do you have the log of the crash after it loads? |
i got this and after that it crash, and all i have in my Android studio logs is what i posted in my comment nothing else no errors nothing, i saw this i think that this is the problem but 'm not sure 01-02 14:46:32.275 4535-4535/com.mapbox.mapboxgl.app E/linker﹕ load_library(linker.cpp:759): library "libmaliinstr.so" not found it's in the past comment i posted. But i didn't find the linker.cpp file nor the libmaliinstr.so file so i don't really know what else to do??? |
Hmm Google shows a few hits for that error but not any solutions. What Android device do you have? What Android version and firmware/ROM are you running on the device? |
I have Lenovo S930 Android jelly bean 4.2.2 firmware |
Hi, i've been trying to run it in the emulator but i got those errors back, knowing that i didn't change a thing in the project since i fixed the first errors i got: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mapbox.mapboxgl.app/com.mapbox.mapboxgl.app.MainActivity}: android.view.InflateException: Binary XML file line #25: Error inflating class fragment |
@Aminebr5 You need to enable the "Use host GPU" option in the emulator settings. |
i got it to work on Samsung Galaxy GT-I9500 Android 4.4.2(API19) using the Style correction used in #719 , but now when i want to zoom or move the map nothing happens and there is no problems in the logs no errors, when i double-tap on the screen nothing happen it's like i didn't tap |
Does it draw the map? |
yes it draw the map ithe GPS works also but i don't have any control on the map i can't zoom and i can't move the map i don't know what's the problem |
Hmm, that is really strange. |
@ljbade if you want i can test it on my Galaxy S4 also |
the Zoom and control is working you had the GestureDetectorCompat as a comment is the MapView class in lib, but when i zoom in the brigth map it crash and i got this errors: 01-05 11:27:49.836 23944-24145/com.mapbox.mapboxgl.app A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 24145 (ox.mapboxgl.app) |
I just installed the build that @ljbade produced on a Samsung Galaxy S4 and was able to zoom and move the map as expected. The only (potential) issue that I'm having is that I don't see a location icon when I press the Find My Location button. Perhaps the build that I've got is using code later than when you tried @Aminebr5? |
@bleege, i downloaded the project in about December the 29th, 2014 so i think it's the latest version of the project that being said, i got the zoom and control to work, the GestureDetectorCompat was between in /* / as a comment in the MapView class so i took off the / */ and it's working but as i said in my last comment, when i zoom in the Brigth map it crash and i got the error: 01-05 11:27:49.836 23944-24145/com.mapbox.mapboxgl.app A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 24145 (ox.mapboxgl.app) when i looked up the SIGSEGV i found that it's an error due to the native code, but no further information. |
@Aminebr5 can you try this build on your phone: https://www.dropbox.com/s/rg13hvsecbolwoz/app-release.apk?dl=0 This is the same build that @bleege tested. |
Make sure you run Then you need to run |
nop, still not working i think that the URL for the style .JSON files in the code is wrong |
No that is a special URL that tells the framework to load the styles from Android's AssetManager, that URL is correct. |
I judst realised you also need to run |
@Aminebr5 Did you have any more success with |
Since I haven't heard an update on this I am going to close it. Feel free to reopen if you wish to continue on this. |
Hello, sorry for the delay i had some issues and Congrats for the merge, i've tryed to run the last version but now i back to the first error that i posted in here the application get compiled successfully when i run Make android, but when i test it on the device it crash without starting, i runned it also in Android studio it's where i got the same error i first posted, did any one have any solution for this, thank you in advance |
@Aminebr5 we changed the way the access token is set. You now need to set the From the readme:
|
I'm on Linux, for the token i created a token.txt and i pasted the token in it, i saw that the gradle will take the value of the token now, but what should i do now (should i creat a token.txt file or not) |
You need to set I usually set it by appending |
still not working crashing on startup and still getting same error as the one i posted in this issue |
@Aminebr5 I just realised I made a typo above with a space before the =. Can you retry it like above (now fixed) with no space before the =. |
@ljbade i've tryed the gradle bring the token from the environment variable but same error, i don't understand i got the token.txt file created but it crash with the same error as in the first post which was because of the token at the first place, you have any idea about the problem? |
@ljbade i've tryed the version that you just merged today, still same error and crash on startup |
Haven't seen this for a long time |
I'm trying to compile Mapbox-gl-native android-mason on Android Studio, i've this error popping out every time i run it, is there any solution to this,
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mapbox.mapboxgl.app/com.mapbox.mapboxgl.app.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class com.mapbox.mapboxgl.lib.MapView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2365)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
at android.app.ActivityThread.access$600(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1377)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5449)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class com.mapbox.mapboxgl.lib.MapView
at android.view.LayoutInflater.createView(LayoutInflater.java:613)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at com.mapbox.mapboxgl.app.MapFragment.onCreateView(MapFragment.java:43)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:920)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1206)
at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2159)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297)
at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:547)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.mapbox.mapboxgl.app.MainActivity.onCreate(MainActivity.java:74)
at android.app.Activity.performCreate(Activity.java:5135)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2329)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
at android.app.ActivityThread.access$600(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1377)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5449)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at com.mapbox.mapboxgl.app.MapFragment.onCreateView(MapFragment.java:43)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:920)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1206)
at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2159)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297)
at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:547)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.mapbox.mapboxgl.app.MainActivity.onCreate(MainActivity.java:74)
at android.app.Activity.performCreate(Activity.java:5135)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2329)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
at android.app.ActivityThread.access$600(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1377)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5449)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load mapbox-gl from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.mapbox.mapboxgl.app-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.mapbox.mapboxgl.app-2, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:514)
at com.mapbox.mapboxgl.lib.NativeMapView.(NativeMapView.java:32)
at com.mapbox.mapboxgl.lib.MapView.initialize(MapView.java:147)
at com.mapbox.mapboxgl.lib.MapView.(MapView.java:112)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at com.mapbox.mapboxgl.app.MapFragment.onCreateView(MapFragment.java:43)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:920)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1206)
at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2159)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297)
at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:547)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.mapbox.mapboxgl.app.MainActivity.onCreate(MainActivity.java:74)
at android.app.Activity.performCreate(Activity.java:5135)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2329)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
at android.app.ActivityThread.access$600(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1377)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5449)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
The text was updated successfully, but these errors were encountered: