Though topic is asked several times. But none of those solutions worked for me.
My project is as follows
../src/main/
|
|-- java/media/uqab/api/
| |
| |-- Api.kt
|
|
|-- assets/
|
|-- info_list.json
I tried to get the info_list.json
file from Api.kt
. But getting a null
value.
class Api {
companion object {
fun getInfoList(): List<Info> {
//...
val str: InputStream? = Api::class.java.getResourceAsStream("/assets/info_list.json")
//...
}
}
}
I don't know what happened! It was working even a few days ago.
I also tried getResourceAsStream returns null. But didn't work for me.