Closed dragitpro closed 5 months ago
Did you try any dev versions before the update? There may be broken caches. Try to delete all builds dirs in the project and build it again
Thanks for your answer. I hadn't tried the dev version before the update. I deleted the build folders in both the root project and the composeApp folder, invalidated the caches (with all three options checked), and I'm still facing the problem. The Android build is also impacted:
org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: files/loader_player.json at org.jetbrains.compose.resources.ResourceReader_androidKt$getPlatformResourceReader$1.getResourceAsStream(ResourceReader.android.kt:42) at org.jetbrains.compose.resources.ResourceReader_androidKt$getPlatformResourceReader$1.read(ResourceReader.android.kt:8) at org.jetbrains.compose.resources.ResourceReaderKt.readResourceBytes(ResourceReader.kt:15)
I also tried adding the following in case it would help: (not sure if need and how to use)
compose.resources {
publicResClass = true
generateResClass = auto
}
but it didn’t solve the problem.
I need a reproducer of the issue. Could you share your project?
Unfortunately, I can't share the project. However, I just tried to reproduce the issue on a minimal project and it works fine there. If you have any ideas about what could be causing this error, such as another cache folder to delete, please let me know. Otherwise, I will continue to investigate on my side
Maybe you can show your build log which is a reason of the app crash?
I find how to trigger the error : its when seting compose-plugin to "1.6.10-beta01" on https://kmp.jetbrains.com/ project using this code :
@OptIn(InternalResourceApi::class)
@Composable
fun DisplayJson(){
var json by remember { mutableStateOf<String?>(null) }
Text(json ?: "Loading...")
LaunchedEffect(Unit) {
val uri = "files/example.json"
json = readResourceBytes(uri).decodeToString()
}
}
So i'm not sure if it was me doing wrong using "1.6.10-beta01" as plugin-version , specialy after reading realse notes
Gradle Plugin org.jetbrains.compose, version 1.6.10-beta01. Based on Jetpack Compose libraries:
The code snippet uses java resources instead of compose multiplatform resources.
It won't work with a composeResources directory
Thanks ... Solution then : if someone find this issueto not waste a day like me val json = Res.readBytes(uri).decodeToString()
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Describe the bug
Just migrating the project from 1.6.2 to 1.6.10-beta01 triggered errors Seems like files are not included anymore or am I missing something ?
Affected platforms
Versions
Additional context
also tied with new api but doesnt seems made for that since path seems not correct :
or with okio FileNotFoundException