nativescript-bitmap-factory
nativescript-bitmap-factory copied to clipboard
Cannot convert object to Ljava/lang/Object;
I have an issue only on android platform. Here is what am I doing:
const nickNameMarker = new Marker();
const bitmapWidth = owner.nick_name.length * 5;
createBitmap(bitmapWidth, 10)
.dispose((imageBitmap) => {
// imageBitmap.drawRect(`${bitmapWidth}x10`);
imageBitmap.writeText(owner.nick_name, undefined, {
size: 9,
color: '#ff1e1e'
});
nickNameIcon = new Image();
nickNameIcon.stretch = "aspectFill"
nickNameIcon.imageSource = imageBitmap.toImageSource();
this._imageCache.set(owner.nick_name, nickNameIcon);
nickNameMarker.icon = nickNameIcon;
});
Getting this error only on android:
Cannot convert object to Ljava/lang/Object; at index 1
If I comment line
this._imageCache.set(owner.nick_name, nickNameIcon);
then I'm getting this error only on android:
java.lang.IllegalStateException: Immutable bitmap passed to Canvas constructor
Please help!