https://kotlinlang.org logo
x

xxfast

06/07/2023, 11:44 AM
Hi all. I'm following the codeviewer example to load fonts in my compose-multiplatform project. I've kept all the font assets in
src/commonMain/resources
directory and this is included in andorid sourcesets with
Copy code
android {
  sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/resources")
}
However, now agp complaints with
Copy code
AGPBI: {"kind":"error","text":"The file name must end with .xml","sources":[{"file":"/Users/TFNX46/Developer/MULTIPLATFORM/NYTimesKMP/app/src/commonMain/resources/fonts/CheltenhamBold.ttf"}],"tool":"Resource and asset merger"}

Execution failed for task ':app:packageDebugResources'.
Am I missing a configuration? I'm using agp 8.0.1 with gradle 8.0
a

ayodele

06/07/2023, 2:20 PM
My guess is it expects the manifest.
x

xxfast

06/08/2023, 1:54 AM
Hmm.. cant see anything special on the manifests files
a

ayodele

06/08/2023, 6:35 AM
I remembered I had to add an empty manifest file, dunno why though, and not investigated further. You can check how I did it here . Though the resource are png files not font
a

Alex Acosta

08/16/2023, 6:35 PM
I am facing the same issue, I have both manifests the same and build.gradle.kts resources management
1.5.0-beta02 & kotlin 1.9.0
3 Views