Integrate Linphone in own iOS project - ios

I am creating a voip call based project with Linphone and I have also successfully build and run the Linphone project and successfully run audio and video call. Now I am integrating Linphone in my own project and I am facing many problems and issues with this. I have used some following links for help but nowhere are complete instructions. Can anyone provide me the complete running steps for this-
http://shallwelearn.com/blog/build-linphone-for-iphone-and-ipad/
Integrate Linphone app to my iOS app
How to integrate Linphone into an existing project (SIP in IOS)
http://www.linphone.org/technical-corner/linphone/overview
How to integrate Linphone into an existing project (SIP in IOS)
http://lists.gnu.org/archive/html/linphone-developers/2014-09/msg00109.html
http://www.successmonkey.co.nz/blog/building-linphone-for-ios

Download Liblinphone iPhone SDK from the link: http://www.linphone.org/releases/ios choose latest one.
Move two folders (include and lib) to your project folder
Add paths to these folders in your project Build settings - INCLUDE folder goes to headers and LIB folder goes to libraries.
In General tab in Linked frameworks add all files from LIB folder
Download/clone the repo https://github.com/BelledonneCommunications/linphone-iphone
Find 4 files: LinphoneManager.h/.m and Utils.h/.m , include them in your project folder and add them to the left pane to other class files also
Try to compile your project - xCode will spam you with errors - this is ok.
You need to inspect errors and just delete all file imports causing errors (Some Linphone Address book files/ some config store files and some helpers classes that you do not need for basic use in your project (because most likely you already implemented this features in your existing project))
Then compile again and inspect all errors in methods. Comment delete any problematic chunks of code (there will be about 10-15 of them).
LinphoneManager class already include many useful features - like good watch and use of linphone core with good logging and etc and etc, but not all of them (unfortunately).

With Xcode 11 using macos 10.15.6 Catalina
Linphone SDK 4.4.0 Using Cocoapod
https://github.com/BelledonneCommunications/linphone-sdk/blob/master/README.md
Using a local linphone SDK
Clone the linphone-sdk repository from out gitlab:
$ git clone https://gitlab.linphone.org/BC/public/linphone-sdk.git --recursive
$ git submodule update --init --recursive
Or
$ git clone --recurse-submodules https://gitlab.linphone.org/BC/public/linphone-sdk.git
Rebuild the project:
PODFILE_PATH= pod install
where is your build directory of the linphone-sdk project, containing the linphone-sdk.podspec file and a linphone-sdk ouptut directory comprising built frameworks and resources.
Pod file looks like
source "https://gitlab.linphone.org/BC/public/podspec.git"
source "https://github.com/CocoaPods/Specs.git"
def common_pods
use_frameworks!
pod 'linphone-sdk', '4.4.0'
end
Then open linphone.xcworkspace with Xcode to build and run the app.
Linphone SDK 4.4.0 Using Compile
$ git clone https://gitlab.linphone.org/BC/public/linphone-sdk.git -- recursive
$ git submodule update --init --recursive
Or
$ git clone --recurse-submodules https://gitlab.linphone.org/BC/public/linphone-sdk.git
Goto the build directory
$ mkdir build && cd build
———————————
https://gitlab.linphone.org/BC/public/linphone-cmake-builder/blob/ios-3.13.19/README.python.md
first, install brew
$ brew install cmake
$ brew install yasm
$ brew install pkg-config
Install pip ->
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py
$ python -m pip install pystache //Check by $ python -m pip list
$ brew install doxygen
———————————
$ cmake .. -G Xcode -DLINPHONESDK_PLATFORM=IOS -DENABLE_G729=YES -DENABLE_G729B_CNG=YES -DENABLE_VCARD=OFF -DENABLE_ILBC=OFF -DENABLE_SILK=OFF -DENABLE_ISAC=OFF -DENABLE_MKV=OFF -DENABLE_GSM=OFF -DENABLE_DOC=OFF -DENABLE_UNIT_TESTS=OFF -DENABLE_LIME=OFF -DENABLE_GPL_THIRD_PARTIES=OFF -DENABLE_NON_FREE_CODECS=OFF
Note - in this step we will also enable G729 dedec support in our linphone sdk.
$ cmake --build . --config RelWithDebInfo
The compilation process is done now need to integrate with Xcode
Compiled Linphone SDK integrates into Xcode.
Find compiled sdk in below directory
linphone-sdk -> build -> linphone-sdk -> apple-darwin
Frameworks and share folder add into xcode project, Frameworks have multiple universal architectures.
Frameworks path add into framework search in build settings
Every framework of Frameworks folder, should be type "embed and sign" (means embed framework.) instead of "do not embed" as default while adding into Xcode Framework setting. it's the most very important part.
apple-darwin -> Tools folder have deply.sh script, copy its contents and create a new run script in "build settings" and paste in it"
the tricky part is where to place the 4th point's script for upload app using archive with strip and slice. Edit Scheme -> Archive -> open dropdown -> post actions -> + to add new script -> copy and paste.
6 (Optional). If experience script causes application crash due to fat library used our project, There is a minor change in the script, I found a solution from this URL - Errors building Xcode Project after adding in Run Script fatal error: lipo: input file
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
# Start of Script modify - identify if the framework is FAT. If it is, then it skips it.
if [ ! -f "${FRAMEWORK_EXECUTABLE_PATH}" ]; then
continue
fi
if xcrun lipo -info "${FRAMEWORK_EXECUTABLE_PATH}" | grep --silent "Non-fat"; then
echo "Framework non-fat, skipping: $FRAMEWORK_EXECUTABLE_NAME"
continue
fi
echo "Thinning framework $FRAMEWORK_EXECUTABLE_NAME"
# end of Script modify
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[#]}"
rm "${EXTRACTED_ARCHS[#]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done
If you are using pod then de integrate pod using terminal command "pod deintegrate" on your pod directory. also delete .xcworkspace file from the project.
Now install pod using terminal command "pod install"
Note: If your case was Adding script causes app crash as I mentioned in 6th point but every time adding the script, have to pod de integrate help me avoid it.
:) Now enjoy using linphone sdk in your project.
end of linphone sdk
Linphone SDK Configuration in our projects.
Enable Codec - To enable audio codec first enable defaultValue of g729_preference in the Audio.plist file and last step In Project -> Target -> Build Settings find "Preprocessor macros" and include HAVE_G729, it prints in sip log like Adding G729/8000 for compatibility, just in case.
#Update - add 5th point fo compile for upload the app to the app store and G729 codec configuration.

Related

library not found for -lRCTOrientation

I'm very beginner in React Native, I build a mobile application which is working OK an android, but when I tried to generate the IPA for iOS using Xcode, I faced this issue
ld: library not found for -lRCTOrientation
clang: error: linker command failed with exit code 1 (use -v to see invocation).
RCTOrientation is shown in red color and i can't find this package in my project folder
Try:
1)
in Xcode make sure you have followed these 3 steps:
a) Add node_modules/react-native-orientation/iOS/RCTOrientation.xcodeproj to your xcode project, usually under the Libraries group
It should show up somewhere in a list like this:
b) add libRCTOrientation.a (from Products under RCTOrientation.xcodeproj) to build target's Linked Frameworks and Libraries list
It should show somewhere in a list like this:
c) Add $(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/ to Project Name -> Build Settings -> Header Search Paths
Make sure that path is correct, in my case I had to add /../ inside it, as above for my RN project, the rn-orientation docs specify that without /../.
in Xcode go to Product menu and run Clean build folder
run react-native run-ios
If it still doesn't work try
2) Xcode go to Product menu, Schemes, Edit schemes, Build and make sure parallelized build is NOT enabled in Build Options
If it still doesn't work:
3) try to clean all the caches and restart npm:
rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-* && watchman watch-del-all && rm -rf ios/build && rm -rf node_modules && yarn install && npm start -- --reset-cache
If you don't have yarn installed just replace yarn word with npm in the above command.
Source for Xcode add library steps: https://github.com/yamill/react-native-orientation
UPDATE: RN 0.60+ supports autolinking and after installing the library with yarn or npm, running a pod install in ios folder, a cache clean, a JS server restart and a rebuild should fix such issues.

Quickest way to add Carthage in Xcode Project

What is quickest way to add dependencies in Xcode project using Carthage.
How to add or edit dependencies later.
Install Carthage
Download Carthage
Open terminal
Terminal: cd ~/Path/To/Folder Containing Project
Create Carthage file as:
Terminal: touch Cartfile
Open Cartfile file from project folder and add required dependency
Example Cartfile file
github "Alamofire/Alamofire" == 4.5
github "Alamofire/AlamofireImage"
After Editing Cartfile file save it.
Run following command from terminal
Terminal: carthage update --platform iOS
xCode > Build phases
Plus button on top left > New Run Script Phases
Run Script > Shell script window > add following:
/usr/local/bin/carthage copy-frameworks
Run Script > Input file window > add following:
$(SRCROOT)/Carthage/Build/iOS/DependencyName.framework
Link Binary With Libraries > Plus button > Add Other > Navigate to
Project Folder > Carthage > Build > iOS >
Framework to add
Done
Using Carthage flow
[iOS Dependency manager]
TL;DR:
Download dependency -> build fat binary -> it should be imported -> slice for release
Long version:
Installing Carthage
//Homebrew
brew install carthage
Create Cartfile file at the project(.xcodeproj)/workspace(.xcworkspace) directory
Modify Cartfile. Add necessary dependency == repo
github "<owner>/<repo>" == <version>
Run carthage update under Cartfile location. High level logic:
`carthage update [dependency]` {
- reads `Cartfile`, resolves dependency graph and generates `Cartfile.resolved` to store a list of versions that will be actually built
//--no-use-binaries - this flag force a Carthage to not use a `Prebuilt framework`
//--no-build - this flag skip a building step - `carthage build`
`carthage bootstrap [dependency]` {
- reads `Cartfile.resolved`
`carthage checkout [dependency]` {
`carthage fetch <path>` {
- fetch dependency from `Cartfile.resolved` into `~/Library/Caches/org.carthage.CarthageKit/` folder
}
- checkout/move a dependency from `~/Library/Caches/org.carthage.CarthageKit/` to generated `Carthage/Checkouts` folder
}
`carthage build [dependency]` {
- builds all `shared frameworks schemes` from `Carthage/Checkouts` into generated `Carthage/Build` folder
//--no-skip-current - (+current consumer)this flag also builds all `shared frameworks schemes` of a consumer workspace/project(in addition to `Carthage/Checkouts` folder)
}
}
}
Drag and drop builded frameworks to General -> Frameworks and Libraries
//framework location
<cartfile_path>/Carthage/Build/
Run the next script. This step is important because carthage build a fat binary(arm64... + x86_64) using lipo[About]. Apple reject application which uses it. That is why you should add this extra step to cut architecture for simulator(x86_64)
Build Phases -> + -> New Run Script phase ->
// /usr/local/bin/carthage - path to Carthage, copy-frameworks - command which sets a necessary architecture and copies framework to an application bundle
Shell -> /usr/local/bin/carthage copy-frameworks
//path to a generated Carthage/Build
Input files -> + -> $(SRCROOT)/Carthage/Build/<platform>/<name>.framework
*Any carthage command should be called from Cartfile folder
If you run into some error
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/2q/jhrcxkmx49g21lydqfrf26ph0000gn/T/carthage-xcodebuild.AySUH3.log
//you can use open command to review the log
open /var/folders/2q/jhrcxkmx49g21lydqfrf26ph0000gn/T/carthage-xcodebuild.AySUH3.log
Crear Carthage cache
rm -rf ~/Library/Caches/org.carthage.CarthageKit
Get stuck on update
carthage update --platform ios --verbose --new-resolver
//e.g.
//The dependency graph contained a cycle
Use XCFramework[About] --use-xcframeworks
//error
Building universal frameworks with common architectures is not possible. The device and simulator slices for "<schema_name>" both build for: arm64
Rebuild with --use-xcframeworks to create an xcframework bundle instead.
//solution
carthage update --platform ios --verbose --new-resolver --use-xcframeworks
[Carthage --no-use-binaries]
[Fast Carthage build]
[Local Carthage]
Install carthage on your mac: brew install carthage
Create a Cartfile in the project root directory, e.g. vim Cartfile and paste:
github "AFNetworking/AFNetworking" ~> 4.0
Build the frameworks: Run carthage update --platform iOS
Warning: dependending on the library you are using, you'll need to follow their instructions on what carthage update command to run specifically. You may need to run e.g. carthage update --use-xcframeworks --platform iOS --no-use-binaries instead. Check their readme.
Add it to Xcode: In finder, navigate to $project_dir/Carthage/Build. You will find a FrameworkName.framework or FrameworkName.xcframework. Drag the .framework/ .xcframework into your Xcode Project (in the project navigator).

Unable to build Xcode iOS project using Apollo framwork to work with GraphQL

I am working on an Xcode project that connects to a GraphQL API. To do this, I'm using the Apollo framework .
In my project, I've installed the cocoapod that includes the Apollo framework, and then added the following run script in Xcode:
if which apollo-codegen >/dev/null; then
APOLLO_FRAMEWORK_PATH="$(eval find $FRAMEWORK_SEARCH_PATHS -name "Apollo.framework" -maxdepth 1)"
if [ -z "$APOLLO_FRAMEWORK_PATH" ]; then
echo "warning: Couldn't find Apollo.framework in FRAMEWORK_SEARCH_PATHS; make sure to add the framework to your project."
exit 0
fi
cd "${SRCROOT}/${TARGET_NAME}/GraphQL"
$APOLLO_FRAMEWORK_PATH/check-and-run-apollo-codegen.sh generate \
$(find . -name '*.graphql') \
--schema schema.json \
--output Generated/GraphQLAPI.swift
else
echo "Skipping Apollo code generation"
fi
This is how it looks in Xcode:
My directory structure in Xcode looks like this:
I then run the following command from Terminal:
npm install -g apollo-codegen
When I then try to build my Xcode project, I unfortunately get the following build error:
/Users/JohnDoe/Library/Developer/Xcode/DerivedData/The_Game-dfpiqreyqdjocaawjrfwhrxhdosf/Build/Intermediates.noindex/The Game.build/Debug-iphonesimulator/The Game.build/Script-7851AAFF2110C71000903FAD.sh: line 12: /Users/JohnDoe/Library/Developer/Xcode/DerivedData/The_Game-dfpiqreyqdjocaawjrfwhrxhdosf/Build/Products/Debug-iphonesimulator/Apollo/Apollo.framework/check-and-run-apollo-codegen.sh: No such file or directory
I honestly have no idea why I'm getting this area. Can anyone see why?
The build script has changed in recent versions of apollo ios, because apollo-codegen is now part of the new apollo cli. it should reference check-and-run-apollo-cli.sh instead.
Also make sure you use the latest version of apollo (currently 0.9.2) by specifying the version in your podfile. You might also need to update your pod repo by running pod repo update.

Invalid Bundle, The bundle contains disallowed nested bundles, contains disallowed file 'Frameworks'

I added a shared framework to share code between app and watch extension. Later I removed the shared framework since it cause lots of problems. I can build
and run my app on iphone and watch. However when I submit to app store, I see these two errors:
ERROR ITMS-90205: "Invalid Bundle. The bundle at 'xxx WatchKit Extension.appex' contains disallowed nested bundles."
ERROR ITMS-90206: "Invalid Bundle. The bundle at 'xxx WatchKit Extension.appex' contains disallowed file 'Frameworks'."
I have tried all the solutions mentioned on stackoverflow(this , this, this) None of them works for me. How do I fix the error? Errors message from apple really doesn't give a clue what I should to.
I still do not fully understand what causes the issue, but I've stumbled upon an answer that has finally solved the issue for me.
https://github.com/CocoaPods/CocoaPods/issues/4203
Specifically, the post by mikehouse on Oct 12, 2015 was the solution to the the problem.
Add the following run script to ALL you embedded extension targets. In my case I had to add the run script as a build phase to my Today extension and my Apple Watch App extension.
cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"
if [[ -d "Frameworks" ]]; then
rm -fr Frameworks
fi
The "ITMS-90206" error was resolved in this post: Validation Error: Invalid Bundle. The bundle at ... contains disallowed file 'Frameworks'
The setting needs to be changed from Yes to No within the Build options of your WatchKit Extension:
Embedded Content Contains Swift Code: No
The above didn't work for me.
Embedded Content Contains Swift Code: NO
Didn't really do anything for me.
I experienced this issue using a dynamic framework.
My dynamic framework contained other dynamic frameworks which made it OK
to have:
Embedded Content Contains Swift Code: YES
And instead having the other dynamic frameworks set it to No instead.
But instead of that I had to set
Always Embed Swift Standard Libraries: NO
under Build Phases.
Having this one set to YES generated the frameworks folder causing upload to ITC fail.
In the main target add:
cd "${CODESIGNING_FOLDER_PATH}"
find ./PlugIns -type d -name Frameworks | xargs rm -rf
The problem is that adding SPM packages on multiple targets of the same project will duplicate the dependencies. The frameworks on this extension are probably on the main target so this should be enough. Otherwise use the full script below on the main target, which will deduplicate the frameworks if needed by moving them to the app.
Do NOT add this to your extension target. It tries to remove the duplicated framework but it has no effect because it runs before the framework is copied to the extension:
# this has no effect if you add it to your extension target
cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"
if [[ -d "Frameworks" ]]; then
rm -fr Frameworks
fi
I ran into this problem in a project that uses Rx as a SPM package in the main target, frameworks, and extensions. If you have the same or similar problem (e.g. Firebase), you can fix it with the following script in the main target:
if ! [ "${CONFIGURATION}" == "Release" ] ; then
echo "early exit"
exit 0
fi
cd "${CODESIGNING_FOLDER_PATH}/Frameworks/"
# copy frameworks to TeamworkProjects.app/Frameworks
for framework in *; do
if [ -d "$framework" ]; then
if [ -d "${framework}/Frameworks" ]; then
echo "Moving embedded frameworks from ${framework} to ${PRODUCT_NAME}.app/Frameworks"
cp -R "${framework}/Frameworks/" .
rm -rf "${framework}/Frameworks"
fi
fi
done
# remove leftover nested frameworks
for framework in *; do
if [ -d "$framework" ]; then
if [ -d "${framework}/Frameworks" ]; then
echo "Removing embedded frameworks from ${framework} to ${PRODUCT_NAME}.app/Frameworks"
rm -rf "${framework}/Frameworks"
fi
fi
done
# Remove Frameworks from PlugIns
cd "${CODESIGNING_FOLDER_PATH}"
find ./PlugIns -type d -name Frameworks | xargs rm -rf
# codesign for Debugging on device
if [ "${CONFIGURATION}" == "Debug" ] & [ "${SDKROOT}" != *Simulator* ] ; then
echo "Code signing frameworks..."
find "${CODESIGNING_FOLDER_PATH}/Frameworks" -maxdepth 1 -name '*.framework' -print0 | while read -d $'\0' framework
do
# only sign frameworks without a signature
if ! codesign -v "${framework}"; then
codesign --force --sign "${EXPANDED_CODE_SIGN_IDENTITY}" --preserve-metadata=identifier,entitlements --timestamp=none "${framework}"
echo "Added missing signature to '${framework}'"
fi
done
fi
Most of this script came from user pewe at forums.swift.org: Swift packages in multiple targets results in duplication of library code.
I had a framework that builded with the following build settings:
Always Embed Swift Standard Libraries: YES
Allow Non-Modular includes in Framework Modules: YES
So I changed both to NO and build framework again.
Always Embed Swift Standard Libraries: NO
Allow Non-Modular includes in Framework Modules: NO
I added new build of framework to my project so It uploaded to iTunes Connect successfully.
I add a swift package, which is dynamic library, into sub-projects, and into my main project. When uploading to TestFlight, I encounter this issues too.
As the picture, I change Embed & Sign to Do Not Embed for the sub-project, and then this issue is resolved.
It keeps Embed & Sign for my main project. But in sub-projects, I change them to Do Not Embed.
I had a today extension which uses a custom framework I implemented it.
I tried all the solutions but nothing worked for me.
I needed the custom framework only in the today extension, so I linked and embedded this framework in the today extension only.
What the error is saying is:
that the bundle contains disallowed frameworks
Today extension should not embed any framework, shall only link to it.
So I removed the framework from the today extension and added it to the parent app.
Note that:
the parent app should use this framework since it's added to it, an import shall do the job.

Azure Mobile Services iOS Library fails to build with Release configuration

When archiving my iOS app the Windows Azure Mobile Services library fails to build.
The App builds fine when using Debug configuration.
While running this script:
/bin/sh -c \"/Users/user/Library/Developer/Xcode/DerivedData/myapp-bxucrfbhixkrpqfwaaovtqqpsvyd/Build/Intermediates/ArchiveIntermediates/MyApp\ (testing)/IntermediateBuildFilesPath/WindowsAzureMobileServices.build/Release-iphoneos/WindowsAzureMobileServices.build/Script-E8E37A27161FAA9600C13F00.sh\"
This turns out to be, this script form the "Build Phases" tab:
# Exit immediately on any errors
set -e
# Set some variables
OUTPUT=${BUILT_PRODUCTS_DIR}
WAMS="WindowsAzureMobileServices"
WAMS_FRAMEWORK="${WAMS}.framework"
WAMS_LIB="lib${WAMS}.a"
HEADERS="Headers"
# Create the needed directories for the framework
mkdir -p "${OUTPUT}/${WAMS_FRAMEWORK}/Versions/A"
mkdir -p "${OUTPUT}/${WAMS_FRAMEWORK}/Versions/A/Headers"
# Add the headers and lib to the framework
cp -a "${OUTPUT}/${HEADERS}/" "${OUTPUT}/${WAMS_FRAMEWORK}/Versions/A/Headers"
lipo -create "${OUTPUT}/${WAMS_LIB}" -output "${OUTPUT}/${WAMS_FRAMEWORK}/Versions/A/${WAMS}"
# Set up the links to complete the framework
ln -sf Versions/Current/Headers "${OUTPUT}/${WAMS_FRAMEWORK}/Headers"
ln -sf "Versions/Current/${WAMS}" "${OUTPUT}/${WAMS_FRAMEWORK}/${WAMS}"
ln -sf A "${OUTPUT}/${WAMS_FRAMEWORK}/Versions/Current"
It fails with this error:
cp:
/Users/user/Library/Developer/Xcode/DerivedData/MyApp-bxucrfbhixkrpqfwaaovtqqpsvyd/Build/Intermediates/ArchiveIntermediates/MyApp
(testing)/BuildProductsPath/Release-iphoneos/Headers/: No such file or
directory
I'm assuming that the error corresponds to this line:
cp -a "${OUTPUT}/${HEADERS}/" "${OUTPUT}/${WAMS_FRAMEWORK}/Versions/A/Headers"
I cannot see any differences in the build settings between Release and Debug.
Update
After some investigation I have determined that when Xcode archives a product it does not create the "headers" folder in ${BUILT_PRODUCTS_DIR}. It instead puts them in `/Build/Intermediates/ArchiveIntermediates/UninstalledProducts'. So the script fails.
Setting the "Skip Install" to NO for the Release build and then checking for the existence of the ${INSTALL_DIR} in the script will successfully build the library.
if [ -d "${INSTALL_DIR}" ]; then
cp -a "${INSTALL_DIR}/" "${OUTPUT}/${WAMS_FRAMEWORK}/Versions/A/Headers"
else
cp -a "${OUTPUT}/${HEADERS}/" "${OUTPUT}/${WAMS_FRAMEWORK}/Versions/A/Headers"
fi
However, Xcode failed to build because it can't find the headers:
fatal error: 'WindowsAzureMobileServices/WindowsAzureMobileServices.h' file not found
#import <WindowsAzureMobileServices/WindowsAzureMobileServices.h>
Update 2
Setting "Skip install" to no causes archiving issues, see this question: Compile, Build or Archive problems with Xcode 4 (and dependencies)
So I have removed the script that fails in the build phases and added "${PROJECT_DIR}/../azure-mobile-services/sdk/iOS/src" to the "User Header Search Paths" list.
This is messy and not my preferred solution.

Resources