What is the definition of a single bundle application in XCode? - ios

I get this error when I try to validate my iPad app archive that I have build with XCode 4:
“TVGuidePlusHD” does not contain a single–bundle application or
contains multiple products. Please select another archive, or adjust
your scheme to create a single–bundle application.
I know about the "Skip install" setting, but still it fails for me.
The contents of the archive are these:
So is the problem the tvguide.db file? This is my .sql document which is compiled automatically to a sqlite db file and actually is supposed to be copied to the application bundle only.

I'll answer my own question.
After making sure that the tvguide.db file is not inside the "Applications" folder, then the archive is considered a single-bundle application and is validated correctly.

Related

Getting error after changing project folder name in XCode

When I created my project, I called it "Project1". Then, later I've changed it to "Project2" from the Xcode. I changed all "Project1" to "Project2", but now, when I compile my project, it looks for files in Project2/Project1/myFile.swift and I get the next error:
<unknown>:0: error: no such file or directory: '/Users/myusername/Copy/Projects/Project2/Project1/myFile.swift'
I need to make that it will look at
/Users/myusername/Copy/Projects/Project2/myFile.swift
without Project1 in the path.
How can I solve this problem? Also, I changed from Xcode Identity and Type section Location of my project.
Today I had the same problem when I renamed the folder containing the Xcode project and some parent folders of it.
In my case there where a .swift file shown with it's name in red in the list of files of Xcode (Navigator area). I think that this means that Xcode was not capable to find that file.
I selected that file (actually it's not a real file but a representation of it).
Then, in the File Inspector (Utility area), I clicked on the Folder icon and chose the file on Finder.
This worked for me.
Renaming projects in xcode in one of the most annoying things in iOS development. I assume you want to rename your app. I faced this problem once and figured out a simple, clean way to do it.
Go back to the point where everything worked.
Open project in xcode and click on the project icon in the project structure( first file)
Go to the info tab
Search for Bundle Name. Most probably it will automatically be set to $(PRODUCT_NAME) which is a shell variable that will set your app name the same as the project name.
Set it to whatever you want your app name to be
Done
Note : If you use custom URL Schemes this might produce an error when redirecting.
ALWAYS use git or some other SVN in your projects. This will come in handy in this kind of situations
Change you folder name in you finder "Project1" to "Project2"
Remove "myFile.swift" file from project (copy on Desktop)
Restart Xcode. Copy "myFile.swift" in project select "Copy file to folder" hope this will help.

Xcode and iOS9's "Asset packs must be in /OnDemandResources" error

I updated to iOS 9 GM and Xcode 7 GM and am in the process of submitting an update to my game.
However, the validation process now comes up with an "Asset packs must be in /OnDemandResources." error.
Here's the log
2015-09-14 18:50:52 +0000 [MT] Failed to generate distribution items
with error: Error Domain=IDEFoundationErrorDomain Code=1 "Unexpected
asset pack at
/Applications/churningseas.app/AssetPacks/Dropbox.assetpack. Asset
packs must be in /OnDemandResources."
UserInfo={NSLocalizedDescription=Unexpected asset pack at
/Applications/churningseas.app/AssetPacks/Dropbox.assetpack. Asset
packs must be in /OnDemandResources.}
2015-09-14 18:50:52 +0000 [MT]
Presenting: Error Domain=IDEFoundationErrorDomain Code=1 "Unexpected
asset pack at
/Applications/churningseas.app/AssetPacks/Dropbox.assetpack. Asset
packs must be in /OnDemandResources."
UserInfo={NSLocalizedDescription=Unexpected asset pack at
/Applications/churningseas.app/AssetPacks/Dropbox.assetpack. Asset
packs must be in /OnDemandResources.}
And here is my Xcode directory, showing the Assetpacks are currently under Ressources (I went a little crazy with blurring, sorry about that):
I guess this is due to Apple's new "app thinning" system, which I'm not particularly wanting to use right now for a small update.
Is there a way to disable on-demand resources? If not, how to fix this (do I simply need to move my "Assetpacks" folder to another one called "OnDemandResources")? I so, where? I'm a little nervous to mess up my file structure...
Also, I did already look at the assets section of the build setting, and "Enable on-demand resources" was already set to "no"
any help is appreciated. Thanks a lot!
This seems to have become an issue since iOS 9 introduced on demand resources. The terms "AssetPacks" or "assetpack" inside folder references cause an error when attempting to validate an archive.
Because this seems to effect Codea-exported projects under version 2.3.1 and earlier. Here is a fix specifically for a Codea exported project:
Find the file named libversion in the root of your exported project. It will contain a version number, most likely 2.3.1. Change it to 2.3.2
Delete libcodea.a and libtools.a from your Libs/ folder
Delete the "AssetPacks" folder reference from the "Resources" group in your exported Xcode project — if Xcode asks you to move the files to trash say NO.
In Finder: rename the "AssetPacks" folder to "Assets"
In Finder: Rename every "SomePack.assetpack" folder within it to "SomePack.assets"
Drag the root level "Assets" folder back into Xcode, tell Xcode to add this as a "Folder Reference" (not a "Group")
There's a more in-depth discussion here https://bitbucket.org/TwoLivesLeft/core/issues/366/trying-to-export-xcode-file-so-i-can#comment-22075482
It took me a while to figure this out but I seem to have gotten something that works. Once you archive your build, if you go to XCode's preferences and click on the tab Location, you will find the location of the archive saved files. If you then click the link just under the Archives section, it will bring you to a folder (which you open) that contains the archives in it. Navigate to the date on which you archived the build and then (using get info to determine time) locate your build. Right click on it and then click "Show Package Contents". Then click on Products. Make a new folder called "OnDemandResources". Click on Applications and right click on the file and open the package contents. Depending on the previous locations of your assets they will be somewhere there, but for me they were in a handy folder titled Assets. Once you have found the folder containing your assets you need to copy it and delete it. Inside the OnDemandResources folder we created earlier, make a new folder called what ever your package bundle identifier is (com.------.-----) and add to the end of it: .New.assetpack . Then paste your AssetPacks (or Assets) file inside. Now you to create a new text edit file, set it to plain text, and then type: bplist00“TTags_CFBundleIdentifier°SNew_?com.Identifier.Identifier.asset-pack-00000008CM2Z9
')-o
This is what it says for mine, I don't know if it will work for you, but I don't see why not.
This method worked for me and now I have a working .ipa file. I hope it works for you!

File in folder that added using "Create folder references for any added folders" not updated

I need to make a folder in app bundle to manage my resources file, images, sounds, etc. So I add my resources folder to xcode using "Create folder references for any added folders".
Problem
I got a problem when I want to update file in this folder (add file, rename, add sub folder), after I build it (both simulator and device) the folder didn't update to reflect my change, I have to Product > Clean to make it update. I wonder if I ship my product this will cause the problem or not, force user to reinstall my app every time I update my resources won't be a good thing to do.
The resource files will be effectively copied in to your application bundle at compile time. If it is working after clean, and you see it working well on your phone, the same way the correct files will be copied to the application bundle when you Archive the App before submission. So I would not worry about this until you are sure to make a Clean also before Archiving at the time of submission.

XCode 4.3.1 breaks validation of apps with directories added by reference. Any workaround?

I've discovered that Xcode 4.3.1 has a serious issue validating apps with resources within a directory tree inside an application bundle.
Apps can pass validation within the Xcode "Build for Archive" process - it only fails when the validation is run via Organizer, which is required to save for ad hoc or App Store submittal.
After spending hours trying to trace down the usual code signing entitlement issues, I eventually noticed the following line in the system console when the export fails:
3/10/12 2:32:48.450 PM [0x0-0x261261].com.apple.dt.Xcode: /Users/chris/Library/Developer/Xcode/Archives/2012-03-10/Coverage 3-10-12 2.32 PM.xcarchive/Products/Applications/Coverage.app/Tiles/T-Mobile-roam/4: Is a directory
The "Tiles" directory has been added to my project via "Create folder reference for any added folders".
I discovered that removing the Tiles directory allows the app to build and validate. Adding it back results in this code sign failure.
It seems that adding a multi-level directory tree completely screws up the validation process, and the error messages send developers on a wild goose chase trying to track down code signing and entitlement issues that really aren't an issue.
I never had any issues with prior releases of Xcode - this seems to be a new serious bug in Xcode 4.3.1.
Is there any workaround possible that will allow us to submit updates to our app?
Notes:
This thread seems related: https://devforums.apple.com/message/630800
This question touches on a similar issue as well:
Xcode 4.3: Codesign operation failed (Check that the identity you selected is valid)
I spent a day trying to isolate this bug, and I've finally nailed it.
The code signer in XCode 4.3.1 when validating for the App Store or saving for AdHoc distribution chokes whenever there is a subdirectory in your bundle that has the same name as its parent directory.
For example:
test/test/file.x -- FAIL
test/test2/file.x -- WORKS
This seems to be new in Xcode 4.3.1, and hopefully will be fixed soon.
UPDATE: I have heard back from Apple DTS support confirming the issue, and indicating that there is no known workaround yet other than renaming the directories in the bundle. ugh
Maybe I've found a workaround:
Open Organizer;
Right click on the archive you want to export and select "Reveal in Finder";
Right click on the xcarchive file and select "Show package content";
Go to Products/Applications;
Create a folder and name it Payload;
Drag the .app file into the folder (don't copy it, since it would invalidate the signing);
Zip the folder;
Rename the .zip file to .ipa
It worked for me.
Let me know if it's ok even for you.
I had the same problem. The solution was to remove files beginning by "._".
Be careful, these files are hidden even when you display hidden files !
In my case, I think that these files were generated by Photoshop.
I had the same problem and solved it like this:
There was a script (under Build Phases) which did try to "clean up" frameworks, by removing seemingly unneeded items, such as the Headers.
However, this destroyed the basic structure of the framework, which probably led to it not being detected properly any more, thus failing the signing or verify operation.
For example, the "Headers" folder and symlink should not be removed, only the *.h files inside the Headers folder!
So, check if your .framework folder contains the basic structure that looks like this:
mylib.framework/
mylib -> symlink to Versions/Current/mylib
Headers -> symlink to Versions/Current/Headers
Resources -> symlink to Versions/Current/Resources
Versions/
A/
Headers/
Resources/
mylib
Current -> symlink to A
We just ran into this where somehow, our .app was getting other .apps built into its bundle. Presumably code signing was choking on the nested app.

Where is my application binary in Xcode to submit?

I've built an app for the App Store (ex-iTunes store). However, I can't figure out how to submit the app.
Where is the actual binary that I need to submit to the App Store? What folder does it get built in?
You could use XCode and on the left expand "Products". Highlight your .app and then go up top where it says "Action" drop that down and select "Reveal in Finder"
Look at a path something like this:
"/Users/{user}/Library/Developer/Xcode/DerivedData/{appname-somehash}/Build/Products/Debug-iphoneos/{app-name}.app"
You can run "find" to locate it.
By default, you'll see a build directory inside the directory containing your project.
In that build directory:
<Project Name>.build` contains all the object files created during compilation
and a series of folders with the following naming scheme:
<build setting>-<platform>
You're likely looking for something like "Release-iphoneos". In that folder you should find the .app package to submit.

Resources