Comments (4)
@sereden you forgot about the src dir: move resources/commonMain
-> resources/src/commonMain
from compose-multiplatform.
I'm getting a similar problem but with fonts
Config:
compose-plugin = "1.6.10"
kotlin = "2.0.0"
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinVersion" }
// res config:
compose.resources {
publicResClass = true
packageOfResClass = "sample.resources"
generateResClass = always
}
Code to expose font:
@Composable
public fun workSans(): FontFamily {
return FontFamily(Font(Res.font.worksans_default))
}
Caused by: java.lang.IllegalStateException:
Unable to load font Font(assetManager, path=composeResources/sample.resources/font/worksans-default.ttf, weight=FontWeight(weight=400), style=Normal)
at androidx.compose.ui.text.font.FontListFontFamilyTypefaceAdapterKt.firstImmediatelyAvailable(FontListFontFamilyTypefaceAdapter.kt:195)
at androidx.compose.ui.text.font.FontListFontFamilyTypefaceAdapterKt.access$firstImmediatelyAvailable(FontListFontFamilyTypefaceAdapter.kt:1)
at androidx.compose.ui.text.font.FontListFontFamilyTypefaceAdapter.resolve(FontListFontFamilyTypefaceAdapter.kt:133)
at androidx.compose.ui.text.font.FontFamilyResolverImpl$resolve$result$1.invoke(FontFamilyResolver.kt:93)
at androidx.compose.ui.text.font.FontFamilyResolverImpl$resolve$result$1.invoke(FontFamilyResolver.kt:92)
at androidx.compose.ui.text.font.TypefaceRequestCache.runCached(FontFamilyResolver.kt:192)
... 131 more
from compose-multiplatform.
Guys, do you know is it possible to share resources between
composeApp
andserver
? I can't do it because it says myserver
module should be marked as multiplatform module (becauseresources
module, that I apply toserver
module` should be also marked as multiplatform) - https://kotlinlang.slack.com/archives/C3PQML5NU/p1716676813612929
How is this related to the issue?
from compose-multiplatform.
same issue here using
kotlin = "2.0.0"
compose = "1.6.20-dev1646"
whenever I try to create a composeResources directory I only get suggested this which is the old impl
from compose-multiplatform.
Related Issues (20)
- iOS. Animation crashes with OOM inside bottom sheet
- TextField error: kotlin.IllegalStateException: ComposeScene is closed HOT 3
- NPE in UndecoratedWindowResizer.desktop.kt in java.awt.PointerInfo.getLocation()
- Deep Linking Support - iOS HOT 5
- Compose Multiplatform and Jetpack Compose method signatures are inconsistent. HOT 1
- connection to Database HOT 3
- version update from 1.6.20-dev1673 -> 1.7.0-dev1686 breaks AnimatedContent HOT 2
- Offset difference in IME padding between iOS and Android HOT 1
- Build iOS failed with kotlin 2.0.0, compose 1.6.11. java.lang.IllegalArgumentException: Failed requirement. HOT 1
- iOS App with shared Compose UI module crashes on launch with `MissingResourceException` HOT 2
- composeResClass cannot be generated in modules other than shared
- Where can I see the changes to the slot table in the Compose July '24 release? HOT 1
- ModalBottomSheet Closes on Back Press with Keyboard Open in Compose Multiplatform HOT 1
- No such value argument slot in IrCallImpl: 1 (total=1) HOT 1
- Improve code style: Replace wildcard imports with explicit imports HOT 1
- Compose multiplatfrom and jetpack compose compatibility problem (java.lang.NoSuchMethodError MeasureScope#layout$default) HOT 1
- compose resources not loading on iOS ~ after 1.6.8 HOT 4
- Support type-safe navigation HOT 3
- (Select-All -> Delete) action in TextField doesn't work when empty text state disposes composition
- Questions related to `*.dll ` packaging
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.