Can't find file templates for Source Signing in Xcode 4.2 - iphone

In my Xcode 4.2 project, I've created an Ad Hoc configuration and want to add the code signing entitlements file to the project, which is usually named Entitlements.plist.
In the past, I create this by selecting a folder in the project tree on the left, then context clicking, selecting "New File...". In the dialog that comes up there's usually a "Code Signing" entry in the iOS tree of the left -- but it's missing now.
The items that are there are as follows:
Cocoa Touch
C and C++
User Interface
Core Data
Resource
Other
I've googled for a solution, and searched on Stackoverflow, but not turned up an answer.
I know that I could create an empty plist manually, and just put in the usual default data which is findable on the web somewhere, but it's bothering me that I can't find the usual thing.

Although I can't find out an actual reference saying that the code signing entitlements template isn't there any more by design, I have found a reference stating entitlements are not needed: https://developer.apple.com/legacy/library/technotes/tn2250/_index.html#//apple_ref/doc/uid/DTS40009933-CH1-TROUBLESHOOTING_GUIDE-CODE_SIGNING_ENTITLEMENTS.
So I'm assuming it's by design in newer versions of XCode.

Try removing the Code Signing Entitlements configuration from the project and target build settings and try your build again.
For more details refer https://developer.apple.com/legacy/library/technotes/tn2250/_index.html#//apple_ref/doc/uid/DTS40009933-CH1-TROUBLESHOOTING_GUIDE-CODE_SIGNING_ENTITLEMENTS

Related

Finding the right way to include static libraries in Xcode

First of all I have to say that I'm new with Xcode and I found some things a bit comfusing for beginners.
For now I want to include SQLite support in my test app. I found the wrapper "FMDB" which seems very easy to use.
I was already able to include the .m and .h files into my project and setting the header line for bridging to Swift.
But if I build my app then I will get some link errors. I think the problem is that the sqlite library is missing. But I've no idea to include it. So I searched the web for some tutorials but all I found seems too old and didn't help me.
What I've already done are the following steps: I selected the top item of my project in the Project Explorer. Then I selected my build target and switched to the tab "Build Phases". But now I see no possibility to include the libsqlite.a file. I followed some suggestions and typed the keyword "sqlite" in the search field but I only get the message "No results found."
I'm using Xcode 8 + Swift 3 on Mac Sierra.
I think that U should find libsqlite.a file in the filesystem and only then add libsqlite.a to project by right click on project files in Xcode 8 and selecting "add files to " and select you .a library from system location like Homebrew's sqlite root folder, only then you can select this static library in "+" linking menu. Please read this answer:
https://stackoverflow.com/a/15974037/2835276
I solved my problem by including sqlite3.c and sqlite3.h from sqlite.org so every wrapper works fine.

Save for Enterprise or ad-hoc deployment not present

I am trying to build an IPA file for my app in view of some ad-hoc enterprise distribution. I have been looking at how to do this with Xcode 4.3.2, the version I am using at present, and I reached the point where in the organiser I should select the 'Save for Enterprise or ad-hoc deployment' option. The problem is that this option does not actually appear in the first place. In fact, I only have the 'Save Built Products' and 'export as Xcode archive' options.
I would imagine the issue lies in some configuration settings for my app, but have been unable to find any help over the web. Hence my question here :-)
Would appreciate some help in understanding what is wrong with my code.
Thanks in advance to anyone helping here.
Cheers.
If your project uses a third-party lib as a sub-project, there are a couple of settings that you may need to change so that xcode will recognize your app as a single–bundle rather than multiple products. Only single-bundle apps can be saved for enterprise or ad-hoc deployment, or submitted to the app store.
First, in the Build Settings tab of the third-party lib target, set the Skip Install setting to Yes.
Second, in the Build Phases tab of the third-party lib target, look in the Copy Headers phase and ensure that there are no headers in the Public or Private section (they should all be in the Project section).
I finally got around this. It turned out the issue was that I was using third-party libs by including their (source) Xcode project rather than as pre-compiled libs. For some reason Xcode sees them as distinct apps, and won't let me wrap all of them under one single IPA.
I removed the project, dropped the actual static libs and headers, produced the archive and...tadaaah: here I could sy my most wanted export option.
Thanks everyone for the help, a special thanks to The Saad who helped me finding out this.
well, I met the same problem when I was using GMGridView. I didn't use Diferdin's solution since I still want to keep the GMGridView project there.
My solution is: Go to GMGridView's target, click "Build Phases" -> "Copy Headers", then move all header files under "Public" and "Private" to "Project".
Redo the Product -> Archive, then you may find the option "Save for Enterprise or ad-hoc deployment not present".
This worked for me, hope it could be helpful to anyone who met the same problem as mine.
Also I believe the idea could also be applied to any other thrid-party projects.
Good luck!
Maybe you've done that already, but we have to be sure.
Did you specified in both product and target the code signing identity for adhoc distribution to be your new prov. profile?
Then did you try to archive your app ? (Product -> archive) If it's grayed, just specify the target to be iOS Device, even if no device is plugged.
If Archive is successful, you should have an archive in the organizer. Select it, and choose to distribute as usual.
I experienced the something today. There is no option to export the ad-hoc. so fix this, by "Validate Settings".
Go to your project targets,
Under the configuration list there will be a clock button called "Validate Settings". Click on it
and click "Perform Changes"
Build for Archiving again
To explain the issue, It looks like Xcode understand project's file as Mac Application instead of iOS App.
Hope this helps.
Just as a follow-up, I know several others have answered. I ran into this issue, and the answers in this post were very helpful. Some summarized responses:
For me, this wasn't a profile issue. I have completed a ton of adhoc and distribution app binary builds successfully, so I knew it wasn't a profile problem in my case.
I took one poster's advice, and did the project "validate settings", and it performed some recommended changes...but that didn't solve the issue.
the issue was in fact project libraries that were not making it into the primary bundle. In my case, I had some libraries, that had their own resource bundles. The key is, when you do an archive build, make sure and select the build, select "show in finder", and then "show package contents" to see what additional stuff is not making it into the main application bundle. That's how I located a couple additional resource bundles that were being bundled into some libraries that I didn't even need.
Helpful thing I found was to turn Skip Install off on your main project. If upon archiving you still see a package created (organizer pops up) then a sub-project is still creating a product. Turn off all the sub-projects Skip Install to NO and get your project to the point where an archive does not popup in Organizer. You can then safely turn Skip Install to YES on your main project and little sparkles of achievement will appear in your brain.

Code Sign error: Provisioning profile can't be found

I have been working the whole day to try to build my app on my device.
I get this error when I try to build on my device.
I have been reading about this problem but do not really understand how to fix it. The following is where I would believe the problem is. I am new on this so I have no experience how to solve this.
When I open the "Dont Code sign" I have "Automatic profile selector (recommended)" with two lines I can select and also "My profile for dev" with one line to select. Do not know if this is where the problem is?
Any help is appreciated.
Here's how I did it.
Shut down Xcode.
Back up the project.pbxproj file.
Edit the project.pbxproj file and remove lines of instances where it mentions the old provisioning profile.
eg. Delete line:
PROVISIONING_PROFILE = "8D024EDA-DC05-40DF-B3EB-536392615EE2";
Restart Xcode and perform a full clean of the project.
It should then build without warnings.
Enjoy!
In my case it was because the xcode 4.0.2 prevented deletion of stale data in the project.pbxpro in the *.xcodepro directory. I ended up hand editing the file after shutting down xcode. In the file I looked for all of the occurrences of "PROVISIONING", something like this:
PRODUCT_NAME = Xyzzy;
PROVISIONING_PROFILE = "CF5F0AEA-92D9-48E1-99DF-301AB36C2BFB";
"PROVISIONING_PROFILE[sdk=*]" = "CF5F0AEA-92D9-48E1-99DF-301AB36C2BFB";
SDKROOT = iphoneos;
and changed it to:
PRODUCT_NAME = Xyzzy;
"PROVISIONING_PROFILE[sdk=*]" = "";
SDKROOT = iphoneos;
I restarted xcode and the build succeeded with out issue. A word of caution make sure that you back up the project directory before make changes to the project files, and only hand edit the files when you have no other options.
I went and changed code signing identity the on project and target to "Don't Code Sign" and then changed back to the correct code signing identity. That fixed it for me.
what exactly is the error message?
Did you add your device including the required provisioning profile in the organizer? What do you see in the organizer when selecting your iPhone under devices? It should be there with the correct valid profile...
If you are working with a project created by someone else as a template, you need to change the code signing identity
screenshot: http://i.stack.imgur.com/UIpGS.png (Xcode 4.2)
ps. OSX would not let me edit the .pbxproj file with a text editor
I had this problem when I had to reissue development provisioning profiles with new names/ids.
The solution was to update all references in Edit Project Settings | Build (Code Sign) referring to Code Sign Developer (name). (Not Edit Active Executable.)
Click on the item(s) and check that the new profile is explicitly selected, and rebuild and run.
I suspect that the reason you get this error in the first place depends on whether or not you have set xCode up to try to resolve these dependencies automatically. In one of my builds replacing the profile was seamless - in the other I had to manually update it. Clearly the best solution would be a seamless one.
I've had this before, and it just worked by restarting Xcode. Probably won't work for you but I'll throw it out there anyway.
I had same error where the very previous build built just fine. I noted that my Build Settings -> Code Signing -> Provisioning Profile had been reset to strange one. All I had do is to point it to correct one to resolve the issue.
This one can be fixed by changing the project settings AND clicking Project > Edit Active Executable > Build and changing the settings there.
I just redid my provisioning profile and re-added devices to the portal in Organizer. Then I clicked my project icon, entered Build Settings, Code Signing and remapped to the new provisioning profile.
I had the provisioning profile set to one thing in Projects and another in Targets. Do a search in your project for the file that is missing and see if it pops up. No hand editing needed!
Like #Jonathan, I just restarted Xcode and it worked after it automatically retrieved the profile from my Apple developer account. This was Xcode 6.2

Xcode falsely claims CFBundleExecutable to be (null)

I'm trying to create an ad-hoc build of an iPhone app for beta testing.
On their end, they're seeing an error like the following:
"The info.plist for application at xxx specifies a CFBundleExecutable of (null), which does not exist"
Here is an excerpt from the actual info.plist:
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
And it clearly is not null.
What am I doing wrong here?
The WORKING SOLUTION is this (and only this):
In Xcode, choose “Executables” from the project hierarchy. Click your project executable then press Command-I. Choose the General tab and set the working directory to “Build Products directory”.
Found via BrainwashInc, who credits MacHackShack. I thought this valuable information was way too important to leave floating around on random blog.
It seems like sometimes XCode may flip this setting, as I suddenly started having this issue, and the fix above repaired it. Changing it back to "project directory" reproduces the issue for me, every time.
I also had to restart XCode to get the debugger to work once this fix installed the app, that may be unrelated.
I don't think there is ONE working solution to this. I found several solutions that doesn't work for me. At the end, I did find one solution.
By deleting whatever I had in the "Producs" folder in xCode I managed to get it working. I am using xCode 3.2.1.
Note: I did the change regarding "Build Products directory” above as well, perhaps both solutions needs to be implemented, up to you to try it out.
This is, to say the least, quite anoying. As a beginner, things are complicated enough without bugs in the SDK...
Hope this will help someone out there!
Cheers
It sounds like you're looking at the info.plist in the project not the built product.
The '${EXECUTABLE_NAME}' in the project info.plist is just a place holder for a variable in the build script. You need to look at the info.plist in your built product to see what is listed there. It sounds like for some reason, the build script is not populating the field as it should.
You might actually check that the contents of the application package actually has an executable. Sounds weird I know but a few years ago I mucked about with my build setting son a project and ended up with a product without an executable. Everything else, the package, resources, string files etc was there just no actual program.
This is a know issue of SDK:
Changing an iPhone Executable's working directory from “Build Products directory” may cause the application not to install properly with the error message “The Info.plist for application at (null) specifies a CFBundleExecutable of (null), which does not exist.”
as you can see here:
http://developer.apple.com/iphone/library/releasenotes/General/RN-iPhoneSDK-3/index.html
For me, it worked to change the working directory.
I created the problem deleting by hand the build directory.

Build Error - missing required architecture i386 in file

I'm getting this error when building my iPhone application:
ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library
/Frameworks/UIKit.framework/UIKit, missing required architecture i386 in file
It goes the same for all the frameworks in my app. It's very weird since this was not happening earlier.
This happens when you add a framework to your project and unintentionally copy the framework into your project directory.
The fix is to check your project directory (where you store your project on disk) for any iphone SDK *.Framework files and delete them.
Project will build fine afterwards.
I had this same problem, and the solution turned out to be an easy fix. Backup then open project.pbxproj (located inside your project file bundle) in TextMate or TextEdit and search for the section titled "/* Begin XCBuildConfiguration section */". Look for a key named FRAMEWORK_SEARCH_PATHS and delete it and it's contents (once per build configuration, so I removed it in two places). Here is an example of what I deleted:
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks\"",);
My project now build for both the iPhone device and the iPhoneSimulator.
What has happened here is that Xcode has mysteriously added a "Framework Search Paths" entry that points to a particular iPhone device SDK. For example, mine was recently set to:
$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/System/Library/Frameworks
This leads the compiler to find frameworks of the incorrect architecture. Removing any values under the "Framework Search Paths" key in your target's build settings will resolve the issue.
I just wanted to mention that in XCode if you go to "Edit Project Settings"
and find "Search Paths" There is a field for "Framework Search Paths". Updating this should fix the problem, without having to hack the project file!
Cheers!
Jesse
Check that you didn't copy the framework into your project when you added it. If you copied it, it can't find the original paths. To fix this problem. Delete the AVFoundation framework from your frameworks folder in your project, then add it again, but this time, make sure you don't have copy check marked.
This fixed it for me!
I fixed it in a different way.The reason why i was getting this error was that i added security.framework twice in my project.I was not able to see security framework in xcode ,i opened the project in finder and found this framework which i deleted and problem solved.
If your app is meant to run on the device, make sure you are not trying to run in it on the simulator. May sound obvious, but check anyway.
Though it is possible that something got deleted, it has been my experience that something gets screwed up in the project file. I have yet to pin down what that "something" is. I've had similar issues when the SDK installation is just fine. There are a couple of options.
First, add all of your files to a new project. This seems to usually work. Kind of a pain, though.
Second, you can right-click project in XCode/Get Info/Build/Library Search Paths. Add new paths similar to /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/lib. Add appropriate versions of that string for each version (2.2.1, etc) and platform (simulator or iPhoneOS). Perform a similar action for Framework Search Paths if frameworks are your problem.
Third, which is more work but more reliable, is to open project.pbxproj from within MyProject.xcodeproj (Textmate is good for this). Look for "/* Begin XCBuildConfiguration section */", then "LIBRARY_SEARCH_PATHS" and "FRAMEWORK_SEARCH_PATHS". Add or modify the paths as appropriate, and save the file.
In any case, a pain in the butt, and I'd sure like to pin-point the cause because I've had this happen a couple of times. Project builds fine, then just up and refuses to do so with what seems to be little reason.
"Edit Project Settings" and find "Search Paths" There is a field for "Framework Search Paths". delete all!!
It just happened here to me as well. Thanks to a great partner we found the answer. Your Xcode may be pointing to the simulator ..change it to a IOS device instead ..built smooth after ....
Run the file command on the framework from Terminal:
file /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library /Frameworks/UIKit.framework/UIKit
You should get back a message telling you which architectures the UIKit binary is compatible with. If you don't see "i386" listed, then you've somehow managed to remove the i386 version of UIKit, which will mean that you can't build for the simulator.To fix that, you'll have to re-install the SDK.
If you get some other error, hopefully it'll help you figure out what the actual problem is.
I just want to let you know that In my case, I was having the same problem, I realized that I had an older Xcode folder called Xcode3.1.3 I just rename it because it was an older version and that did the magic for me.
Check your library search paths in your target settings. Sometimes goofy libraries get entered in there and this will give you a similar error.
You can remove all entries in this section.
I'd just experienced something slightly different, because I work on my own library (WM_GSRecognizerLib), but the error is the same.
What'd happen: due to some updates, the path targeting the lib to include (.a) was from the "Debug-iphoneos" folder (where it is generated). Compiling for Generic iOS Devices worked fine, but not for simulator, complaining for the missing i386 architecture.
What I did for this issue, is to also include the binaries from the "Debug-iphonesimulator" folder.
It can help for this topic, because the explanation is here: devices require binaries for arm64/armv7/armv7s, while simulator does need i386.
My solution was to set on simulator target debug YES, just look on git status to see the new line added as architecture only on .project. if you don't set this the build will run to all architectures and will show some missing architecture like i386 or other.
NOTE THAT obviously the main issue is to use some framework that implements some kind of specific architecture.
I too got the same error am using xcode version 4.0.2 so what i did was selected the xcode project file and from their i selected the Target option their i could see the app of my project so i clicked on it and went to the build settings option.
Their in the search option i typed Framework search path, and deleted all the settings and then clicked the build button and that worked for me just fine,
Thanks and Regards