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
Adaptive icons don't work #31
Comments
@mdudek thanks for reporting this! Will try and do some investigation. Curious if this is just an issue with windows or if it affects all platforms. I'm using Linux. @markmooibroek pinging you in case you get a chance to check it out before I do. |
Ill have a look, i used the |
Hmm seems to be working perfectly on MacOS then doing the |
@mdudek are you getting this issue in the example project or when you actually run the plugin on a real project? |
I'm using plugin on my flutter project. |
Same issue on MacOS, on new project. Pubspec:
Running command from the root folder of the project: Complete stack trace:
This could probably be fixed and be made more robust by using https://pub.dartlang.org/packages/path, although I didn't try myself if it fixes the issue. |
same problem here |
@lukaspili I think I've seen a similar error before. I'll try and get a fix out tonight. Thanks for posting the stack trace! |
Working on a fix for this. There's a XML package which looks like it will allow me to use a string to generate an XML file and so means we can get rid of the assets folder with the ic_launcher.xml and colors.xml files and just create a new dart file to act as a template having a string for each file. |
Seems to be working again in the example having replaced relative paths with string alternatives based in a template dart file: #32 |
@mdudek @lukaspili @sam0610 let me know if 0.5.1 fixes this, just published it. |
Just tried v0.5.1 and it runs without error. But it seems that app icon is not 'adaptive', there is still used classic 'non-adaptive' version of icon in launcher after apk installation. |
I'm glad there's no error appearing now. I'm wondering if the adaptive icon isn't working because I changed the directory from mipmap-anydpi-v26 to mipmap-v26, thought it should have worked. Are you running the example project or your own? |
According to the android docs it needs to be in the mipmap-anydpi (or mipmap-anydpi-v26 to work in combination with lower API levels). I think this is because its an xml file rather than a png. https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
|
That must be it! I'll change that tonight and do another quick test before releasing it. My mistake changing it, thought it should have still worked as long as v26 was in it. Apologies for changing that @markmooibroek. I'm going to put that quote in as a comment in the code to make sure I never forget about it. Might be good to add a unit test to make sure that the directory will always be mipmap-anydpi-v26. |
Heads up everyone v0.5.2 available now. Did a local test before publishing and it's working again for me! Hope it works for everyone else. |
Adaptive icons are working for me with v0.5.2! 😃 |
Confirmed ;-) |
When I run
flutter pub pub run flutter_launcher_icons:main
following exception is thrown:It seems that there is some problem with relative path '../assets/ic_launcher.xml' used in android.dart file.
The text was updated successfully, but these errors were encountered: