Comments (9)
Thanks ... Solution then : if someone find this issueto not waste a day like me val json = Res.readBytes(uri).decodeToString()
from compose-multiplatform.
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
from compose-multiplatform.
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.
from compose-multiplatform.
I need a reproducer of the issue. Could you share your project?
from compose-multiplatform.
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
from compose-multiplatform.
Maybe you can show your build log which is a reason of the app crash?
from compose-multiplatform.
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:
from compose-multiplatform.
The code snippet uses java resources instead of compose multiplatform resources.
from compose-multiplatform.
It won't work with a composeResources directory
from compose-multiplatform.
Related Issues (20)
- Build failed when building native macOS app after added compose resources. HOT 1
- Encountered error after upgrading from 1.6.10-beta01 to 1.6.10-rc01 HOT 4
- Cannot boot for Desktop after upgrade to 1.6.10* HOT 4
- When will proguard be upgraded to 7.4? It seems that it cannot support jdk 21 now. HOT 2
- iOS - Scroll does not work at all when touch starts on a UIKitView inside eg a LazyColumn HOT 9
- Link issue on iOS (undefined symbol _OBJC_CLASS_$_UITextLoupeSession) with 1.6.10-rc03 HOT 1
- Request for ability to opt-out of resource tasks added in latest compose plugin (1.6.10-rc03) HOT 2
- Request for opting out of generating skiko wasm / js resources in latest compose plugin (1.6.10-rc03)
- Material3 Icon and Text vertical alignment is abnormal. HOT 1
- Support 1Password Universal Autofill on Mac
- RuntimeError: illegal cast for wasmJs with SparseArrayCompat.internalGet
- Android Composables not transformed by compiler in 1.6.10 HOT 5
- 1.6.10-rc03 version error HOT 3
- 1.6.10: MPP with JS but without WASM target: Cannot determine the version of Skiko for Compose '1.6.10 HOT 5
- Compose for Desktop doesn't emit lifecycle events, only states HOT 4
- [Web/Wasm] TextField not opening keyboard in mobile browser HOT 1
- String resource mapping web 1.6.10-rc03
- Change position of MenuBar HOT 2
- Compose Desktop IDE Plugin doesn't show when using Jetbrains Preview annotation HOT 1
- ImageViewer example: Android application crash due to missing Android Manifest FileProvider HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose-multiplatform.