Archiving xcode project that contains static library - ios

I created a project with static library.
When I tried to archive, It fails and library Headers are missing.
But when I build the app, it works fine.
And in build folder headers, bundle resources and library are created outside app file.
Is it possible to create these file in app file and archive
or any other process available for archiving?
Thanks in advance.

If you are able to build the app but not archive then it seems that the build settings that you are using for archive build configuration (probably Release) is not correct. Quick test will be to change the build configuration for archive to same as build, most probably Debug (you can do that in Product->Scheme->Edit Scheme).
To fix this you can open the Build Settings for your target, search for "Header Search Path", click the ">" to open this setting and fix it for the build configuration that is used by archive (i.e. make it same as the build configuration used by Build)

Related

There are missing files when I archived from custom build configuration

We have different build configurations in our project, like the release, debug, sandbox, etc. The interesting case is when I archived from the release or debug build configuration, all archive files extracted as expected as shown in Image 1, but If I change build configuration to sandbox, some files and folders are missing as shown in Image 2.
Although we created custom build configurations by duplicating from debug or release, the archive doesn't contain all files or folders like in Image 1.
We use carthage(for internal network) and cocoapods(for others) as a dependency manager.
I tried many suggestions but couldn't find a solution.
Like,
setting skip install to NO in build settings,
removing all archive and derived data files, clean and re-archive,
giving the archive folder to read & write permission
Thank you all
If you're using Carthage for internal frameworks you should have same custom build configurations for them, too. Otherwise, it will bootstrap with Release configuration automatically which won't generate SwiftSupport files etc.
You also can avoid this by adding below before archiving in your custom configurations.
carthage bootstrap --configuration Debug
You should make sure that those files are included in Build Phases -> Copy Bundle Resources

How to address this warning generated by crashlytics / fabric?

Here is what I know/do:
I am importing Fabric via a pod.
The build script for Fabric is the last one
It is set to generate a dsysm
DEBUG_INFORMATION_FORMAT should be set to dwarf-with-dsym for all configurations.
This could also be a timing issue, make sure the Fabric run script build phase is the last build phase and no other scripts have moved the dSYM from the location Xcode generated it. Unable to process myapp.app.dSYM at path /Users/no-one/Library/Developer/Xcode/DerivedData/myapp-ahatoktzxteqbcaohqnktdtfczxr/Build/Products/Debug-appletvos/myapp.app.dSYM
Make sure your project build settings are generating a dSYM file.
Go into your target's Build Settings and then type in DEBUG_INFORMATION_FORMAT into the Search Bar that appears in the top right.
It looks like this:
And you can choose "Dwarf With Dsym" from the pop-up menu.

iOS - Custom Configuration - "No such module"

In my ios app, I'm trying to distinguish environments, to make web api calls to the proper environment (Development, Staging and Production).
For that I have created a configuration.plist file with the different endpoints for each environment and:
Duplicated the Debug Configuration and called it Development Build.
Created a new Scheme called Development (duplicated the Debug scheme)
and in the Info tab (Run section) chose the Development Build
configuration.
When I run in Debug mode, everything runs normally.
I'm using cocoa pods.
If I select Development scheme, I get a No such module 'JazzHands'
If I edit the Development scheme to use the Debug build, it works fine.
So I must be missing some thing for this not to work.
For those running into this question, try pod install this will generate some .xcconfig files with your configuration name. Clean your build folder and build again.
This worked for me with Cocoapods 1.0
Solution:
Create the same custom build configuration in JazzHands
Root cause:
Compilation error No such module is thrown because it can't locate the JazzHands for your custom build configuration
Background:
Every time you compile a folder is created in DerivedData.
This folder corresponds to your device / simulator and your app.
Inside this folder there would be a Build folder which would contain a folder corresponding to each build configuration for your project.
In your case Development folder would not contain the framework JazzHands binary
However Debug folder would contain the framework JazzHands binary
Example:
Given below is an example:
~/Library/Developer/Xcode/DerivedData/SomeApp-skjahjkdhsakjhdaskjdhaskjlhs/Build/Development-iphonesimulator
SomeApp - Name of the app
Development - Custom Build configuration

Xcode Archive linker error. Static libs created in Debug-iphonos directory

I'm using Xcode 4.3.3 to create an archive for iTunes submission and I get a linker error. I discovered that the reason behind it is that the static libraries created by my sub-projects are created in the build\Debug-iphoneos directory rather than Release-iphoneos. In the Product->Edit Scheme dialog I confirmed that the sub-projects Archive schemes all have the "Release" build configuration set and have "Reveal Archive in Organizer" checked. Also, my main project has Skip Install set to YES and the Target Skip Install is set to NO. All sub projects have Skip Install to YES. So I conclude that the Archive scheme for the sub projects are likely not being invoked by the main project when I Product->Archive it. I have looked at many settings and don't have a clue?
Thanks....

Can't create Archive with Static Library

I'm trying to create a archive for a app linking to a static library but with no luck.
I can built the app in both release and debug mode just fine. I can even built it for Archive (product->built for->archiving) but it fails miserably when I try to create the archive (products->Archive)
XCode can't seem to find the headers for the Static lib:
In file included from /Data/Code/iPhoneDev/ArchiveTest/ArchiveTestApp/ArchiveTestApp/ArchiveTestAppAppDelegate.m:9:
/Data/Code/iPhoneDev/ArchiveTest/ArchiveTestApp/ArchiveTestApp/ArchiveTestAppAppDelegate.h:10:24: error: DataFetcher.h: No such file or directory
In file included from /Data/Code/iPhoneDev/ArchiveTest/ArchiveTestApp/ArchiveTestApp/ArchiveTestAppAppDelegate.m:9:
/Data/Code/iPhoneDev/ArchiveTest/ArchiveTestApp/ArchiveTestApp/ArchiveTestAppAppDelegate.h:13: error: cannot find protocol declaration for 'DataFetcherDelegate'
Any ideas or suggestions on what I'm missing here?
I ended up roughly following the suggestions in this Questions:
Compile, Build or Archive problems with Xcode 4 (and dependencies)
Create a group call "Indexing headers" in your project
and drag the headers to this group, DO NOT add to any targets when
prompted. This includes any headers inside your dependency
For all dependancies set "Skip Install" build setting to "Yes"
Moving any "Public" headers in Build Phases to "Project" for dependency
Set the Build Setting "Installation Directory" on your Target to
$(LOCAL_APPS_DIR)
The archive was created with no errors with step 1-3, but for it to become a valid app step 4) was needed.
Amazing how half baked XCode4 seems

Resources