Bootstrap icon indicating copy to clipboard operation
Bootstrap copied to clipboard

Icon versioning doesn't work on iOS 11

Open revolter opened this issue 7 years ago • 25 comments

I tried with the Example project too and it shows the default app icon.

revolter avatar Sep 21 '17 07:09 revolter

It looks like it's a permission issue, but I don't know how to debug it. Doesn't anyone have any idea or clue to fix this?

revolter avatar Nov 20 '17 13:11 revolter

@revolter You can take a look at this PR: https://github.com/wordpress-mobile/WordPress-iOS/pull/8108/files to see how our final implementation on the WordPress iOS app looks like

elibud avatar Nov 20 '17 13:11 elibud

@elibud would be nice to get PR if you guys have time, shouldn't you also reference original source of this script ? it feels like you are ignoring the MIT license requirement

krzysztofzablocki avatar Nov 20 '17 14:11 krzysztofzablocki

@krzysztofzablocki at this point we've diverged quite a bit from the original implementation that's the reason we didn't submit a PR.

Here's the results from our investigation about the problems on iOS 11:

  • XCode manages app icons through asset catalogs
  • XCode also includes the icon files in the app and Info.plist, possibly for backwards compatibility
  • The script replaces the files in the app root directory but not the asset catalog
  • iOS 11 uses the asset catalog and not the files in the app root directory

So what we did was add a new run script phase to our project to do the following:

  • For each icon in AppIcon.appiconset. Add the blur, info version and commit data. Copy it over to AppIcon-Internal.appiconset.
  • Update the Release-Internal scheme to use AppIcon-Internal.
  • Remove the existing Generate Build Icons phase as is no longer needed.
  • We also moved the script out of the project file.

Regarding retribution, would something like this be appropriate as a comment on the script:

Based on Eric Krzysztof Zablocki Boostrap library - https://github.com/krzysztofzablocki/Bootstrap

Thanks

elibud avatar Nov 20 '17 15:11 elibud

@elibud yeah just mentioning me & linking to repo is fine with me, also thanks for info :)

krzysztofzablocki avatar Nov 20 '17 15:11 krzysztofzablocki

@elibud, Just curious, how did you find out that it uses asset catalogs in iOS 11?

revolter avatar Nov 20 '17 15:11 revolter

@krzysztofzablocki here's the PR that adds the attribution https://github.com/wordpress-mobile/WordPress-iOS/pull/8197 Apologies about that, it was never our intention to omit it.

@revolter honestly, just trial and error.

elibud avatar Nov 20 '17 18:11 elibud

@elibud, It doesn't work for me. The script throws this error:

mkdir: /Users/iulian/Library/Developer/Xcode/DerivedData/AppName-flfsycpcooxferchcgqiawomflkh/Build/Intermediates.noindex/AppName.build/Debug-iphonesimulator/SchemeName.build/ModifiedIcons: File exists

revolter avatar Nov 21 '17 12:11 revolter

@revolter can you try cleaning and deleting derived data and then try again? (I don't clean derived data myself but I generally clean before making the new build)

elibud avatar Nov 21 '17 12:11 elibud

No error from the script but the overlay still doesn't show up :(

revolter avatar Nov 22 '17 10:11 revolter

@revolter we've recently moved that script one phase down and we are seeing the same problem. Someone from my team will be working on that and once a PR is up I will post it here.

elibud avatar Nov 22 '17 11:11 elibud

Great, thank you!

revolter avatar Nov 22 '17 12:11 revolter

Ok @revolter here's the new PR and it works perfectly: https://github.com/wordpress-mobile/WordPress-iOS/pull/8214 Hope it helps.

elibud avatar Nov 22 '17 18:11 elibud

I want to use your project iconVersioning.sh file,what should i do? (on Xcode9 iOS11)

Luis-X avatar Dec 07 '17 10:12 Luis-X

@elibud, I didn't have time to test it, and neither do I know, but I'll let you know when I test it.

revolter avatar Dec 07 '17 15:12 revolter

@Luis-X, #33 might help you.

@krzysztofzablocki, What do you think about my idea from Twitter? Is it ok if we discuss it here? Or in another issue? Do you have time to maintain the icon versioning part of this project (I only use that, and it looks like I'm not the only one) or you need some help?

revolter avatar Dec 07 '17 15:12 revolter

@revolter how about you create a subspec for just icon versioning in CocoaPods as I did for other parts? I'm swamped with other projects atm

krzysztofzablocki avatar Dec 07 '17 15:12 krzysztofzablocki

I was thinking about creating a fastlane plugin instead, I wonder how other people would vote between these 2 solutions.

revolter avatar Dec 07 '17 16:12 revolter

@revolter Thank you very much! @krzysztofzablocki I watch this Blog and Use it, But on Xcode9 iOS11 not work, I'm sure, I only use iconVersioning.sh on my Project, can you and try fix it?

Luis-X avatar Dec 08 '17 08:12 Luis-X

If @krzysztofzablocki, gives me permission to use the icon versioning script in a fastlane plugin, while obviously referencing the original source, and if I find myself some time, I'll do it as I need it too.

revolter avatar Dec 08 '17 10:12 revolter

@revolter sure, go ahead

krzysztofzablocki avatar Dec 08 '17 10:12 krzysztofzablocki

@revolter @krzysztofzablocki I commit my code on this Demo include icon_version.sh file, Run it on Xcode 9, Please look this img.png icon-version

Luis-X avatar Dec 08 '17 14:12 Luis-X

@Luis-X Try with the version from here.

revolter avatar Dec 08 '17 16:12 revolter

I finally finished an initial version of a fastlane plugin to version icons: https://github.com/revolter/fastlane-plugin-icon_versioning 🎉

@krzysztofzablocki, Let me know if the mentions are ok and complete or if I should update them 😃

For the rest of the interested people, I successfully integrated it in my project and it works like a charm. Let me know if it works for you too, if you have any issues or feedback, and as always, PRs are welcome ❤️

revolter avatar Mar 11 '18 23:03 revolter

@elibud Your script is working, thank you very much! 🎉

TimorYang avatar Oct 16 '18 08:10 TimorYang