nutiteq/hellomap3d-android

Crash when call RegisterLicense

oooits72 opened this issue · 4 comments

when i call MapView.RegisterLicense("my_key", getActivity().getApplicationContext()); app crash and log show "01-14 09:56:13.625 9321-9321/ru.smarttransport.citytransport A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 9321 (t.citytransport)"

Are you sure you do RegisterLicense with right key before creating new MapView? The sequence should be:

// 0. The initial step: register your license. This must be done before using MapView!
MapView.RegisterLicense("YOUR_LICENSE_KEY", getApplicationContext());

// Create map view
MapView mapView = (MapView) this.findViewById(R.id.map_view);

// Create layer
UnsignedCharVector styleBytes = AssetUtils.loadBytes("osmbright.zip");
if (styleBytes != null){
  // Create style set
  MBVectorTileStyleSet vectorTileStyleSet = new MBVectorTileStyleSet(styleBytes);
  vectorTileDecoder = new MBVectorTileDecoder(vectorTileStyleSet);
}
TileDataSource vectorTileDataSource = new NutiteqOnlineTileDataSource("nutiteq.mbstreets");
baseLayer = new VectorTileLayer(vectorTileDataSource, vectorTileDecoder);

mapView.getLayers().add(baseLayer);

Yes, i call register when app start , before do anything with map, but when i don't call register all working very nice

App always random crashes with "Fatal signal 11 (SIGSEGV) at 0x00000021 (code=1)"

3.0RC had a bug in RegisterLicense that could crash when you supplied invalid license string. This was fixed in the official 3.0 release. Note that valid licenses should have worked also in pre-release versions. Closing this for now.