Maps: [Android] SymbolLayer not working in release mode / black in debug mode

Created on 7 Jun 2019  路  3Comments  路  Source: react-native-mapbox-gl/maps

Describe the bug
SymbolLayer is not working for Android in release mode, nothing is displayed at all.

In debug mode, the image is displayed, but all black.

image

To Reproduce
Compile this repo's example project in the corresponding mode and use whatever scene that comes with a SymbolLayer ("Custom Icon" for instance)

Expected behavior
We expect SymbolLayer to work the same as for iOS.
image

Versions (please complete the following information):

  • Platform: Android
  • Device: any
  • OS: any
  • SDK Version 7.3.2, 8.0.0
  • React Native Version 0.59

Most helpful comment

In release mode the addImage method of RCTMGLStyle returns without downloading the asset. The reason is that RCTMGLStyleValue's shouldAddImage always returns false.

We have:

public boolean shouldAddImage() {
    return isAddImage;
}
isAddImage = imageURI != null && imageURI.contains("://");



md5-bb54a380a1152ef80c513843b473ca75



- isAddImage = imageURI != null && imageURI.contains("://");
+ isAddImage = imageURI != null;

_Concerning the asset rendering in black, it happens only within the simulator for me. It's probably a totally different issue._

All 3 comments

In release mode the addImage method of RCTMGLStyle returns without downloading the asset. The reason is that RCTMGLStyleValue's shouldAddImage always returns false.

We have:

public boolean shouldAddImage() {
    return isAddImage;
}
isAddImage = imageURI != null && imageURI.contains("://");



md5-bb54a380a1152ef80c513843b473ca75



- isAddImage = imageURI != null && imageURI.contains("://");
+ isAddImage = imageURI != null;

_Concerning the asset rendering in black, it happens only within the simulator for me. It's probably a totally different issue._

@alexisrougnant Thanks, yes not sure why is the imageURI.contains("://") condition there. ImageURI can be a path, uri, bundled image name and maybe base64 images, but in any case we want to decode it.

Regarding the black icon, it works fine for me in android simulator. Not sure what's going on in that case for you. The image is clearly loaded just the colors are screwed up.

FYI, emulator GL rendering can be quite flaky depending on underlying hardware and emulator in use. I suggest you check that against a real device.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gmaclennan picture gmaclennan  路  3Comments

jayhaluska picture jayhaluska  路  5Comments

fvieira picture fvieira  路  4Comments

lukemcgregor picture lukemcgregor  路  5Comments

mustafaskyer picture mustafaskyer  路  3Comments