可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I'm putting together a universal app and I have the icons in my project, but I keep getting a warning from the compiler in regards to Icon.png.
I followed the instructions at http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html but still get the above error.
I've tried doing the following:
Putting the icons in the Shared group and adding them according to the plist according to the tech note.
Changing the icon paths to add Shared/ to them to point to the shared folder.
Creating a Resources group (which the tech note fails to point out that XCode doesn't create a Resources Group for a universal app) and moving them into that (I removed the "Shared/" prefixes from the plist.)
Moving the icons to the top level of the project.
I've also double-checked the icon sizes and they are all correct, as well as the names of each.
Anything I might have missed?
回答1:
For some reason the (possibly when adding multiple icons and changing the file?) the item gets moved to item 1-...
Make sure your icon is listed as item 0
in the plist
回答2:
I have same problem and find a solution works for me.
Please try below steps:
- Build > Clean All Targets
- Renamed Icon.png to xcon.png
- Renamed xcon.png to Icon.png
- Build > Build and Archive
- Resubmitted to iTunes connect - success!
Mostly do nothing but change the name of the Icon.png and change it back, but it works!
I have tried to use a 512*512 Icon.png for learning, but I copy a new one of 57*57 back later, then the issue come out, I think maybe it's the reason of this issue.
I am new on mac. My XCode4 crashes about 10 times a day. I am missing Visual studio.
回答3:
Here was my solution to this problem. There was an empty string in the MyApp-Info.plist
file. I manually deleted it (in a text editor) and my app verified and uploaded.
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string></string> <--------- Extra string shouldn't be there------
<string>Icon@2x.png</string>
<string>Icon.png</string>
</array>
</dict>
</dict>
回答4:
I had this issue. The answer for me was to check the capitalization. In my plist I had Icon-small-50.png Icon-small.png and Icon-small@2x.png I capitalized the S and the issue went away. e.g. Icon-Small-50.png Icon-Small.png and Icon-small@2x.png
回答5:
I had the exact same problem. When you build and archive, click show in finder, show the contents of the package of the archive and check if all the files are showing up. For me, the archive was missing Icon.png file for some reason. The archive utility has a bug. I moved the icons out of the resource folder, cleaned and built the project. Then again I moved the icons into the resource folder and cleaned and built it. Then the archive had copied the missing icon files.
回答6:
Had the empty string node as well, but it wasn't reflected in Xcode. Somehow, the info-plist file was out of sync with the filesystem. I had to remove the reference to it and re-add it to my project, THEN I saw the . Fixing that fixed my problem.
回答7:
- Remove all icon files from xcode interface
- Move all files from your project folder to some folder on desktop
- rename the files in recently created desktop folder
- delete all entries from info-plist file for icons
- start assigning icons again by dragging onto Xcode window at appropriate places.
- When you create icons for iphone, xcode automatically assigns those icons to ipad.
DO NOT DELETE THE ENTRIES IN IPAD SECTION. INSTEAD, DRAG IN THE IPAD RELATED ICONS TO REPLACE THE OLD ONES. Rememeber, this is important.
- Create archive.
回答8:
Add your Icon-files to "Build Phases" -> "Copy Bundle Resources"
Hope it helps...
回答9:
Right-click on the icon files and select Get Info. Pick the Targets tab and ensure that the target you are building is ticked. Just because a file is in the project, it doesn't necessarily mean that it is copied into the app bundle.
回答10:
I had the exact same error, cleaning the project and building again worked for me. It is definitely an Xcode issue - even on 4.0.2. Which version of Xcode are you using? Try updating to the latest.
回答11:
I was getting the same error, also with a universal app. I had a project from Xcode 3 (already submitted to store). I opened in Xcode 4 and saw the fancy image-linking page (click on target, "summary" and "app deployment info") when you click on the target. After linking various icons, testing, compiling, and then archiving, I got this error.
One extra thing- I'd added the icon names byhand in to the plist in Xcode 3. My guess is that this was conflicting with the image-linking feature in Xcode 4. So I removed one entry, "icon" in the plist. The new image-linker creates plist entries as an array. I left that the same, though I did verify the filenames with the image names in my bundle, and capitalized one of them in both places. I removed and added back the problematic image to the bundle.
I validated and it passed.
My guess is that "special" icon names- that are dynamically linked to certain features in the app- are going to be more sensitive than random ones. With the new image-linking ability, you can name your icon files anything you want.
Hope this helps.
回答12:
I also got this error when I had an extra blank line in my Info.plist. I had Item 0, which was Icon.png, and I had Item 1, which was blank. Item 1 had been my iPad icon, but I cleared it. Archiving then gave me the warning you saw. Removing the line for Item 1 completely fixed the issue.
回答13:
Had the same problem in xcode 4.2. Noticed my plist had strings for icon had items named both "icon.png' and 'Icon.png'. My icon file was named icon.png so tried deleting the string "Icon.png". This didn't work but decided to rename my asset 'Icon.png', removed them from the project and added them back in. Clean, build and success!
回答14:
In AppName.xcodeproj/project.pbxproj i changed the occurrences of icon.png -> Icon.png and the validations passed.
回答15:
I had this problem with a Default@2x.png icon file. It seems that the file was not in the build target (the Target Membership part of its properties).
The solution was to add it to the target. XCode mistakenly allowed files not in the target to be added to the list of icons.
As another answer said, using the finder to browse the Archive file makes it obvious that the file is not present. Still, case sensitivity or other plist errors need to be investigated.
回答16:
Based on my experience this kind of error usually shows up when one or more of the png files that were used in the project were corrupted. It's possible that the png file is interlaced which will cause this kind of error.
回答17:
- Clean your build
- Make sure the file is actually on the file system
- Make sure you can see the file in the project navigator.
- Most likely step 3 will fail. If so, drag the icon from the finder onto the Project Navigator. When asked, uncheck the "copy ..blabla" option because since the file is already there where you are dragging it to, it would fail.
Once the file shows up in the Project Navigator you should be golden.
- Vote this answer as "the answer" :)
回答18:
just ran into this tonight - its not good enough to be named correctly and in the proper folder. make sure you drag it into the x-code folder structure if i'm explaining that properly. in the folder view, make sure their actually listed in there.
回答19:
Same issue for me; I resolved by setting "Compress PNG Files" to "NO" in info.plist. Cleaned, archived, validated, success.
回答20:
Had the same issue building a 5.1 app.
Just simply removed and send to trash the offending files. Then re-imported, making sure the copy button was ticked.
Clean -> Build
Now works. I guess those files weren't being copied over as they should have been..
回答21:
This solution worked for me:
http://vawlog.vawidea.com/en/2010/11/icon-specified-in-the-infoplist-not-found-under-the-top-level-app-wrapper-iconpng/
回答22:
I spent far too much time on this issue too!
In the Targets / Info tab I found that I had empty rows in two sections, both under Icon files and under Icon files -> Primary Icon -> Icon files.
You need to remove the empty lines in BOTH sections to be able to archive and validate the app.
回答23:
This method worked for me and I did not need to rename files and all that other good stuff.
I found a method in the right-click context menu called Add Files to [Project]...
Step 1
Open XCode and make sure you are looking at your project view where it lists the project and top-level files below in a tree-style.
Step 2
Cmd-click or right-click on the Project Name (at top of left sidebar) and then point to "Add Files to [Project Name]..."
Step 3
Browse for files needing to be added. You will notice that files already added are greyed out whereas others that are not added stand out in full colour.
回答24:
I am using Xcode 4.3.3.
I solved the problem, by dragging my custom icon.png file from a folder where I placed it, into the project (ApplicationName-Resources-icons Folder).
After this, my icons folder looked like this:
- icon-72.png
- icon.png
- icon@2x.png
- icon-72@2x.png
So the before missing "icon.png" has been added. Thereafter the validation passed.
回答25:
Same error here.
It happens when I open an old project in Xcode 4.
The solutions is to:
find the .plist file, search for the key Icon file (Not "Icon
files" or "Icon files (iOS 5)").
Delete it (minus button).
Add it again and put the filename in value
Product->Clean and Product->Build again.
回答26:
This problem was driving me crazy! I tried everything posted here.
This is how it worked for me:
- Product -> Archive
- In organizer windows -> Archives right-click on the created archive
- Select "Show in Finder"
- right-click on {YourAppArchive}.xcarchive and select "Show packages contents"
- go to Products -> Applications
- right-click on {YourApp} and select "Show packages contents"
- Copy the missing Icon files here
- Go back to Xcode organizer and hit "Validate..."