diff --git a/maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/IPhoneBuilder.java b/maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/IPhoneBuilder.java index 73c8796a38..188bd09878 100644 --- a/maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/IPhoneBuilder.java +++ b/maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/IPhoneBuilder.java @@ -2807,7 +2807,14 @@ public boolean accept(File file, String string) { // resulting partial Info.plist already contains the correct // CFBundleIcons entries, so we deliberately do not inject any // CFBundleAlternateIcons fragment here. Doing so would conflict with - // actool's output during the Info.plist merge. + // actool's output during the Info.plist merge. We do, however, need + // to inject CFBundleIconName -- without it actool will not emit the + // partial Info.plist containing CFBundleIcons / CFBundleAlternateIcons, + // and -[UIApplication setAlternateIconName:] would then fail at runtime + // because the bundle does not advertise the alternate icons. + if (!localizedIcons.isEmpty() && !inject.contains("CFBundleIconName")) { + inject += "\nCFBundleIconName\nAppIcon"; + } String locationUsageDescription = null; if (xcodeVersion >= 9) { if ( (locationUsageDescription = request.getArg("ios.locationUsageDescription", null)) != null ){