-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource files not being available under the iOS target #6
Comments
The plugin is internal to this library, you can find its source code here. However I don't think it is the cause of your issue, I just checked on Maven Central and it seems the font is correctly uploaded for Apple targets. The official documentation says that "your project needs to use Kotlin 2.0.0 or newer and Gradle 7.6 or newer" for publication, but this maybe also applies to your case, what version of Kotlin and Gradle are you using? |
We use Gradle 8.0.0 and Kotlin 1.9.20 so its probably the cause of this error. I'll try to update to Kotlin 2.0.0 in order to see if it solves my issue, but first I'm writting a build script for Xcode that copies the .otf files inside the app bundle. |
Ok, the script effectively copies the files inside the app bundle but the problem still happens. I'll try to update to Kotlin 2.0.0 to check if it solves the issue. |
Finally we took the following approach:
|
So was that caused by the Kotlin version? If it is I might add a warning to the README about this.
Oh yeah if you're using the pro version you should do that and simply use
I thought about adding an additional module for the Pro icons constants, but as far as I know a Pro subscription is required to download the pro |
I'm not completely sure because the update is difficult for us because of other dependencies we have, but I can assure that with Kotlin 1.9.20 and using our own .otf file inside composeResources and with the workaround that I mentioned before,
Related to this sentence, yep, a Pro subscription is required, but we have that. As a proposal (I'll try to create a pull request to add this), it would be a good idea to add a mechanism that enable users to add their own .otf files as we do. If I'm not wrong, this mechanism would need to be implemented in the plugin module, in order to generate all the helper code needed to make the custom added fonts (i.e. FontAwesome Pro) easy to access in the entire module scope that applies the plugin. |
I'll just leave this issue open then, I don't really know what is causing it and I can't test it as I don't have a mac.
That is basically what the core library already does, see val iconFont = rememberStaticIconFont(fontResource = Res.font.fontawesome_solid_pro)
The plugin module only provides a way to reduce duplicated code in the project Gradle files, it is not meant to be used outside this repo.
Do you mean the icon constants, or the font constructor (like Also, correct me if I'm wrong, but I think you are using the pro font alongside the |
We are trying to use FontAwesome FontIcons in a CMP view and it works fine under the Android target but, under the iOS target, we are receiving this error at Xcode console after loading the CMP view:
I believe that there is a plugin to do the resouces copy task, but I couldn't find a to use it. I refer to the multiplatform-structure plugin, wich is used in your testApp sample.
The text was updated successfully, but these errors were encountered: