This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Crash: When Attempting to Download Offline Region #7137
Copy link
Copy link
Closed
Description
Original post mapbox/mapbox-java#215:
I receive this error when I attempt to download an Offline Region:
11-21 12:32:01.558 com.offgrid.electric.zola.sales.staging A/libc: /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/abort_message.cpp:74: void abort_message(const char *, ...): assertion "terminating with uncaught exception of type std::bad_alloc: std::bad_alloc" failed 11-21 12:32:01.559 com.offgrid.electric.zola.sales.staging A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 12494 (DefaultFileSour)I'm using the following version:
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.0-beta.5@aar') { transitive = true exclude group: "com.google.guava" }Here's the code:
public void createOfflineRegion (String styleUrl, LatLngBounds latLngBounds, float density) { offlineManager.createOfflineRegion( getDefinition( styleUrl, latLngBounds, density ), getMetaData(), new OfflineManager.CreateOfflineRegionCallback() { @Override public void onCreate (OfflineRegion offlineRegion) { offlineRegion.setDownloadState( OfflineRegion.STATE_ACTIVE ); offlineRegion.setObserver( new OfflineRegion.OfflineRegionObserver() { @Override public void onStatusChanged (OfflineRegionStatus status) { if ( status.isComplete() ) { Timber.i( "Region downloaded successfully." ); } } @Override public void onError (OfflineRegionError error) { Timber.e( "onError reason: " + error.getReason() ); Timber.e( "onError message: " + error.getMessage() ); } @Override public void mapboxTileCountLimitExceeded (long limit) { // Notify if offline region exceeds maximum tile count Timber.e( "Mapbox tile count limit exceeded: " + limit ); } } ); } @Override public void onError (String error) { Timber.e( "Error: " + error ); } } ); }Pretty much just copied from the Sample. Any ideas what could be causing this crash? Thanks
Hey @adavis, I modified the sample code a bit using the same code you provided and wasn't able to reproduce the crash. Could you provide the getMetaData() and getDefinition() methods also along with what parameters you are passing into createOfflineRegion(). If you are getting any additional logcat output when the crash occurs, that might help.
cc: @zugaldia
Reacted by Sagar chavada
Activity
adavis commentedon Nov 21, 2016
Parameters:
The other methods:
adavis commentedon Nov 21, 2016
@cammace I also see this in the logs:
cammace commentedon Nov 22, 2016
I've been tweaking around with the
OfflineTilePyramidRegionDefinitionparameters using the same bounding box, style, and pixel density provided by @adavis (thanks!). While I can't produce the exact same crash, if I tweak the max zoom level beyond 18 the region fails to complete downloading and results in the activity being destroyed:No logcat errors are shown.
cc: @ivovandongen
adavis commentedon Nov 22, 2016
Thanks @cammace, so I reduced the
MAX_ZOOMto18and now the crash is gone. Would be useful to have some logs around it though.zugaldia commentedon Nov 22, 2016
The absence of any logs is truly strange.
ivovandongen commentedon Nov 28, 2016
@cammace Have you tried to get the error by disabling the filters in Android Studio? The native crash stacktrace usually doesn't show up with the filters enabled.
cammace commentedon Nov 28, 2016
Yes @ivovandongen, I'll try reproducing this in the testapp on a branch later today.
abourtema commentedon Dec 23, 2016
I have problem , I use Mapbox in android , the app run good but when download map show me Mapbox tile count limit exceeded: 6000 , I use less 4000 tile
zugaldia commentedon Jan 2, 2017
@cammace Any luck getting further crash logs as suggested by @ivovandongen ?
@abourtema Your issue seems to be a different one. Do you mind opening a separate ticket including the code or settings that you're using to download the offline region so that we can reproduce it? Thanks.
tobrun commentedon Apr 19, 2017
@cammace Any update on this?
abourtema commentedon Apr 22, 2017