Skip to content
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

Adding icon to app #1056

Open
walseb opened this issue Dec 24, 2023 · 2 comments
Open

Adding icon to app #1056

walseb opened this issue Dec 24, 2023 · 2 comments

Comments

@walseb
Copy link

walseb commented Dec 24, 2023

Hello!

I have been searching around for how to add an icon when compiling an app, but I haven't found any documentation on this.

Is there a way to do this at the moment, besides modifying the icon after the fact in something like APK Editor Studio?

Thank you!

@walseb
Copy link
Author

walseb commented Dec 25, 2023

It appears the icons and most android stuff is done in reflex-platform. Relevant issue reflex-frp/reflex-platform#688
It seems icons can be set with android.iconPath = "path" in default.nix, however, that inserts the path to the attribute android:icon directly. It's not clear how to use the icon build script in reflex-platform to build the icons from a PNG file in obelisk.

@walseb
Copy link
Author

walseb commented Dec 28, 2023

So I skipped using the Obelisk icon build utility. One cryptic problem with android.iconPath = "path" is that even if you set it to a png file (where the file is specified without quotes so that nix pulls in the file when building), it still won't work, giving a Gradle error that seems to say the formatting of the icon is wrong. The cause is that the icon path isn't a file path, it needs to be using android style paths, such as "@drawable/ic_launcher", where the icon is located in /project-root/res/drawable/ic_launcher.png.

Then you need to also add this to default.nix: android.resources = ./res; so that obelisk builds with the local res folder. It seems like this line sets the resource folder to be some obelisk owned resources folder? https://github.com/reflex-frp/reflex-platform/blob/develop/android/default.nix#L32. Or maybe I made some mistake? I'm not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant