flutter_launcher_icons
flutter_launcher_icons copied to clipboard
CLI does not create Contents.json for IOS
flutter_launcher_icons ^1.7.2+1
does not create a Contents.json when running flutter packages pub run flutter_launcher_icons:main
.
Any plans to fix it?
Hi ! I just made a ruby script that will generate the Contents.json lines. You just have to copy the code in a ruby file inside Appicon.appiconset folder, and run it from there (ruby myscript.rb) . It will print json to the console, and you just have to copy it to Contents.json file.
require "json"
puts "Application version ?"
version = gets.chomp
reg = /(?:Icon-App-([0-9]+\.?[0-9]?)x[0-9]+\.?[0-9]?+@([0-9])x\.png)/
hash = Hash.new
hash["images"] = Array.new
Dir.entries(".").each do |entry|
puts entry
if match = entry.match(reg) then
size, idx = match.captures
item = Hash.new
item["size"] = size.to_s + "x" + size.to_s
item["filename"] = entry
item["scale"] = idx.to_s + "x"
item["idiom"] = "iphone"
hash["images"].push(item)
iItem = Hash.new
iItem["size"] = size.to_s + "x" + size.to_s
iItem["filename"] = entry
iItem["scale"] = idx.to_s + "x"
iItem["idiom"] = "ipad"
hash["images"].push(iItem)
end
#add in hash images
end
hash["info"] = Hash.new
hash["info"]["version"] = version.to_i
hash["info"]["author"] = "xcode"
puts JSON.pretty_generate(hash)
The missing thing is the app icon for App Store. Can be fixed looking at : this
Any fix is in place for this? It seems with the latest versions also we have the same problem.
I ran across the same issue. For those of you who are looking for a temporary solution, you can copy the Contents.json
files from the example directory:
https://github.com/fluttercommunity/flutter_launcher_icons/blob/master/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
For generation contents.json i uses this guy fork (found on network graph): https://github.com/karer/flutter_launcher_icons/commit/89c99d97a458130efa93459ab27933f37a64b43d
He just wrote one more line of code, please fix it on head repo!
Contents.json
file had already been moved.
https://github.com/fluttercommunity/flutter_launcher_icons/blob/master/example/default/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
This is a way to overwrite contents.json for ios.