https://kotlinlang.org logo
#compose
Title
# compose
d

Davide Giuseppe Farella

08/26/2020, 6:20 PM
Any clue what this is happening? 😞
java.lang.NullPointerException: BitmapFactory.decodeResource(res, resId) must not be null
c

caelum19

08/26/2020, 6:23 PM
Are any of those drawables vectors?
d

Davide Giuseppe Farella

08/26/2020, 6:24 PM
Yup:
new -> Vector Asset -> pick .svg file
Ok, I resolved myself with your hint 😛
Thank you 🙂
c

caelum19

08/26/2020, 6:26 PM
np 🙂
For searchers etc: vectorResource() instead of imageResource()
🙏 1
d

Davide Giuseppe Farella

08/26/2020, 6:28 PM
Oh, yes, right, sry about that 😄 I was so concentrated in try to load it with the original color that I forgot 😄
r

romainguy

08/26/2020, 6:29 PM
Maybe we should change the error message to give more hints about what’s going on
✔️ 6
d

Davide Giuseppe Farella

08/26/2020, 6:29 PM
Same, for searchers, don’t wrap into
Icon
but just
Image
🙂
@romainguy yup, that would be great!
r

romainguy

08/26/2020, 6:30 PM
“Unable to decode source bitmap, please check the file is not corrupted and contains a raster bitmap”
or something like this
Would you mind filing a bug?
d

Davide Giuseppe Farella

08/26/2020, 6:30 PM
Sure, np 🙂
n

Nader Jawad

08/26/2020, 6:30 PM
@romainguy I think there is more work for us to do regarding resource loading in general
r

romainguy

08/26/2020, 6:30 PM
Definitely
But this seems like an easy thing to do that would be helpful 🙂
d

Davide Giuseppe Farella

08/26/2020, 6:37 PM
r

romainguy

08/26/2020, 6:52 PM
Thanks!
🙏 1
d

Davide Giuseppe Farella

08/26/2020, 7:01 PM
Thank you for allow me to forgot about Xml design 😄
😄 1
r

romainguy

08/26/2020, 7:37 PM
Can’t wait for 5 years from now when our industry will decide that separating UI from code is better again 😛
🚫 1
😂 4
d

Davide Giuseppe Farella

08/26/2020, 7:40 PM
Given that we had 1) code in Java, design in xml 2) code and design in xml ( data binding ) 3) code and design in Kotlin I'd expect 4) design in Kotlin and code in xml As the next step 😄
😂 4
g

gsala

09/07/2020, 4:54 PM
Just spent an hour on the same issue 😭
7 Views