Giter Club home page Giter Club logo

Comments (18)

hyperobject avatar hyperobject commented on July 18, 2024 2

Adaptive icons are working for me with v0.5.2! 😃

from flutter_launcher_icons.

mdudek avatar mdudek commented on July 18, 2024 2

Confirmed ;-)

from flutter_launcher_icons.

mdudek avatar mdudek commented on July 18, 2024 1

I'm using plugin on my flutter project.

from flutter_launcher_icons.

lukaspili avatar lukaspili commented on July 18, 2024 1

Same issue on MacOS, on new project.

Pubspec:

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_launcher_icons: "^0.5.0"
  
flutter_icons:
  android: true 
  ios: true
  image_path: "assets/icon/icon.png"
  adaptive_icon_background: "#FDF9F5"
  adaptive_icon_foreground: "assets/icon/icon-android-foreground.png"

Running command from the root folder of the project: flutter pub pub run flutter_launcher_icons:main results in the error stated above.

Complete stack trace:

FileSystemException: Cannot copy file to 'android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml', path = '../assets/ic_launcher.xml' (OS Error: No such file or directory, errno = 2)
#0      _File.throwIfError (dart:io/file_impl.dart:647)
#1      _File.copySync (dart:io/file_impl.dart:352)
#2      createAdaptiveIcons (package:flutter_launcher_icons/android.dart:75:12)
#3      createIcons.<anonymous closure> (package:flutter_launcher_icons/main.dart:28:7)
#4      _RootZone.runUnary (dart:async/zone.dart:1381)
#5      _FutureListener.handleValue (dart:async/future_impl.dart:129)
#6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:638)
#7      Future._propagateToListeners (dart:async/future_impl.dart:667)
#8      Future._complete (dart:async/future_impl.dart:472)
#9      _SyncCompleter.complete (dart:async/future_impl.dart:51)
#10     _completeOnAsyncReturn (dart:async-patch/dart:async/async_patch.dart:292)
#11     loadConfigFile (package:flutter_launcher_icons/main.dart:38:3)
#12     _RootZone.runUnary (dart:async/zone.dart:1381)
#13     _FutureListener.handleValue (dart:async/future_impl.dart:129)
#14     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:638)
#15     Future._propagateToListeners (dart:async/future_impl.dart:667)
#16     Future._completeWithValue (dart:async/future_impl.dart:482)
#17     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:512)
#18     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#19     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#20     _runPendingImmediateCallback (dart:isolate-patch/dart:isolate/isolate_patch.dart:113)
#21     _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:166)

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.

from flutter_launcher_icons.

MarkOSullivan94 avatar MarkOSullivan94 commented on July 18, 2024 1

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.

from flutter_launcher_icons.

MarkOSullivan94 avatar MarkOSullivan94 commented on July 18, 2024

@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.

from flutter_launcher_icons.

markmooibroek avatar markmooibroek commented on July 18, 2024

Ill have a look, i used the dart ../bin/main.dart command from the example folder so never got to experience this error. Will try to see if i can reproduce it

from flutter_launcher_icons.

markmooibroek avatar markmooibroek commented on July 18, 2024

Hmm seems to be working perfectly on MacOS then doing the flutter pub pub run flutter_launcher_icons:main command from the example. Don't have a Windows PC at hand to test upon :-(

from flutter_launcher_icons.

MarkOSullivan94 avatar MarkOSullivan94 commented on July 18, 2024

@mdudek are you getting this issue in the example project or when you actually run the plugin on a real project?

from flutter_launcher_icons.

sam0610 avatar sam0610 commented on July 18, 2024

same problem here

from flutter_launcher_icons.

MarkOSullivan94 avatar MarkOSullivan94 commented on July 18, 2024

@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!

from flutter_launcher_icons.

MarkOSullivan94 avatar MarkOSullivan94 commented on July 18, 2024

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.

from flutter_launcher_icons.

MarkOSullivan94 avatar MarkOSullivan94 commented on July 18, 2024

Seems to be working again in the example having replaced relative paths with string alternatives based in a template dart file: #32

from flutter_launcher_icons.

MarkOSullivan94 avatar MarkOSullivan94 commented on July 18, 2024

@mdudek @lukaspili @sam0610 let me know if 0.5.1 fixes this, just published it.

from flutter_launcher_icons.

mdudek avatar mdudek commented on July 18, 2024

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.

from flutter_launcher_icons.

MarkOSullivan94 avatar MarkOSullivan94 commented on July 18, 2024

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?

from flutter_launcher_icons.

markmooibroek avatar markmooibroek commented on July 18, 2024

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

Next you must create alternative drawable resources in your app for use with Android 8.0 (API level 26) in res/mipmap-anydpi/ic_launcher.xml

from flutter_launcher_icons.

MarkOSullivan94 avatar MarkOSullivan94 commented on July 18, 2024

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.

from flutter_launcher_icons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.