-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Map tiles do not load on Android #1468
Comments
Yep, seeing the same thing here --> #1435 (comment) |
So far ruled out the cause being network reachability state logic, or not setting the default marker symbol. I have determined that The function However it appears the
@kkaefer Do you have any ideas as to why |
It looks like the APIs for MapViews have changed. Let's look at the latest iOS version on the native binding side. |
Same with on my Android devices:
Unfortunately I seem to have lost root during upgrade to Android 5 and cannot provide any log files (no time ATM to play around and get root again). |
@BergWerkGIS You do not need root to view logcat output. There are tons of apps on Google Play that make sharing logcat output very easy. |
@mb12 ahh. Good to know, will try another app. I'm using "catlog" and the only log it showed, was the one that it could not get root permissions. |
The following works well (including simple filters/regex searches). https://play.google.com/store/apps/details?id=org.jtb.alogcat If your device is connected via USB and if you have debug environment set up on your machine, the following is useful to copy the entire logcat to a file. adb logcat -d > any file on your Mac/PC |
Hmm I suspect something with I manually set the longitude to 149.1244, latitude to -35.3075 and zoom level to 10 and this was the resulting state:
|
@mb12 I've tried the suggest The readme of All I get from
|
I have been digging further and put debug prints in I have code like this in Java just in the MapView constructor:
Which results in calls to the C++ This is what I am logging from
Only longitude is getting set, both latitude and zoom do not change. The default You can find the my debug code in https://github.com/mapbox/mapbox-gl-native/tree/1468-android-no-tiles |
Did the following:
One Plus One:
started to show, but not "Bright". Nexus 7 (2013): |
@ljbade why is w, h, fb_w, fb_h zero? Can you check if Map::resize is being called at all or at the right point? |
I am in an earlier problem here, in that
In looking at your debug branch @ljbade in https://github.com/mapbox/mapbox-gl-native/compare/1468-android-no-tiles I don't see any deltas that would get me past the problems above. Am I doing something wrong in my setup here, or are we having a disconnect with styles? I only get a black render; no style background color (right before the crash). (Note that the UI still is labeled Bright, but this is loading a remote Mapbox Streets.) |
@incanus hmm I think it might be because I have a older git clone that likely kept the old styles around. Perhaps I should finish the |
I made some progress after noticing iOS only uses I got this to appear after pinch zooming in a little bit with latest debug branch: Aside from the |
Thanks to @jfirebaugh for getting the x86 emulator working I can confirm this bug only affects ARM builds (both emulator and real devices) Above: left is x86, right is ARM, both AVDs the same configuration, both the same commit and build command So something in ARM compile/link configuration is wrong or their is a compile/build tool bug that only affects ARM. In the mean time I will merge a fix for swapped lat/lng I found in the Java side in the process of looking at this bug. |
@bleege master should work fine on both Linux and OS X x86 emulator when I test it. I have confirmed both arm-v7 and arm-v5 builds have the bug which is interesting because they use different floating point models. |
I have built the debug branch for both x86 and ARM and captured the startup log which shows the x86 - https://gist.github.com/ljbade/bc0972040ae685321a17 Importantly comparing the x86 (loads map):
ARM (no map):
The lat/lng/zoom numbers are different. And there is an even a @jfirebaugh You make any sense of this? |
ARM differs even earlier, just after construction: x86:
ARM:
|
@mb12 from memory Just try using |
Can you please tell me what file I can change to pass -mfloat-abi=softfp instead of -mfloat-abi=hard? 'softfp' is the floating point ABI that ndk-build uses in all the sample applications that come bundled with Android NDK. I've included details below (incl. full command line from a sample app and one from mapbox gl). I took the sample opengl android NDK application that comes bundled with the Android SDK. This is to figure out the differences in ARM specific compiler flags used in samples vs what are used in mapbox gl. The biggest difference I have found is that the sample examples in NDK get compiled with "-mfloat-abi=softfp" while MAPBOX GL is compiled with "-mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1". Another difference I've noticed is that the default compiler in Android NDK is g++ while mapbox gl is compiled with clang++.
|
This is to confirm that the issue indeed gets fixed if we used soft floating point ABI as in the sample applications provided by android NDK. I've verified the change on a Samsung device. |
@mb12 thanks, that was the clue. I recompiled the app without hardfp and it's working great on Android now. https://groups.google.com/forum/#!searchin/android-ndk/hard$20float/android-ndk/NbUq9FDDZOo/TJJsAS6nM7wJ has a lot of insight and information related to using hard float with JNI. |
We're using Clang, so the hard float was forced for armv7 in mapbox/mason@80433ca |
Hmm I am sure I turned on hard float ages ago. What a wierd bug. We should test the performance of hard-float + gcc vs soft-float + clang. |
I am going to update mason to use soft float and then recompile all the modules, which will also update the NDK to r10e at the same time as part of mapbox/mason#87 |
OK I closed mapbox/mason#87. Rebuilt latest master to pull in new modules and everything works. Closing. |
Found an issue in mapbox/mason#87 master crashes when I run it within the CURL error handler and I found libcurl was built without SSL enabled. Need to fix. |
Going to rebuild openssl and libcurl then see if it fixed the crash. |
Crash fixed! |
@ljbade Can you please elaborate what is "run it in CURL"? |
@mb12 basically we use libcurl for our HTTP requests on Android. The problem was after updating the mason modules OpenSSL was being built with the wrong compile flags. Thus libcurl configure script was disabling SSL support because it couldn't link against OpenSSL. The result was that libcurl couldn't handle HTTPS requests which we use to load tiles. libcurl returned an error code which our code then throws a C++ exception at. |
Is there any plan to fix the following issue? This would reduce the number of external dependencies for Android (incl. Curl). |
@mb12 yes that and there is another ticket on using OkHTTP for HTTP requests instead of curl. Don't know what the time frame on them is yet. |
@ljbade @mb12 The OkHttp work can start at anytime. I just got pulled into more of the iOS work for the past months since we settled on it. |
@mb12 if you want to take a crack at it feel free |
After the app loads the map only renders the styles background fill colour and no tiles load.
@kkaefer I think you encountered this too a while back?
The text was updated successfully, but these errors were encountered: