xcodebuild exportArchive: no applicable devices found - ios

After upgrading to Xcode 8 with iOS 10, I get exactly this error. I am on latest El Capitan and using the following versions of ruby (I updated via rvm, same with 2.0.0 which is system version) and CFPropertyList:
Philipps-MacBook-Pro:mobile-sdk prakuschan$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
Philipps-MacBook-Pro:mobile-sdk prakuschan$ gem list CF
*** LOCAL GEMS ***
CFPropertyList (2.3.3)
The xcodebuild -exportArchive command is executed in a shell script, and after a successful archive I get the following error:
** ARCHIVE SUCCEEDED **
2016-09-22 10:02:16.460 xcodebuild[10375:8369748] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/9y/r64c9wld0jx2yf3glsrzhhr00000gn/T/AppName_2016-09-22_10-02-16.456.xcdistributionlogs'.
2016-09-22 10:02:18.228 xcodebuild[10375:8369748] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fe435f9dfb0>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
error: exportArchive: No applicable devices found.
Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
** EXPORT FAILED **
When looking into the xcdistributionlogs, the IDEDistribution.standard.log contains the following lines at the very end:
2016-09-22 08:02:18 +0000 [MT] /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with a signal 6
2016-09-22 08:02:18 +0000 [MT] ipatool JSON: (null)
I don't know if it is valuable, but this is the path to ipatool:
2016-09-22 08:02:17 +0000 [MT] Running /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool
Any help is highly appreciated. I already tried many suggestions found on google, but found no solution yet.

I was seeing the same issue. After searching through:
https://forums.developer.apple.com/thread/13446
And elsewhere for Xcode 7 similar issues. I realized this one is unique. You can fix it if you tweak the ipatool script in Xcode 8.
sudo vi /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool
And comment out this one line:
# Check the artwork idiom.
#return nil,"the device doesn't support the app's UIDeviceFamily" unless (deviceTraits.supportedIdioms & bundle.supportedIdioms).size > 0
Found via sleuthing the ipatool command in:
/var/folders/.../IDEDistribution.standard.log
You can search for these via:
$ sudo find /private/var -name "*.xcdistributionlogs"
Relevant detail / debugging steps: https://github.com/fastlane/fastlane/issues/8737

We had the same issue "No applicable devices found" after running
xcodebuild -exportArchive -archivePath ../bin/archive/GetSocialTestApp.xcarchive -exportPath ../bin/ -exportOptionsPlist ../../scripts/exportOptions.plist
Working solution: wrap xcodebuild with xcbuild-safe.sh from fastlane repo. Detailed solution described here.
As appeared, the problem was caused by rvm environment variables, xcbuild-safe.sh cleans them before executing xcodebuild.
Not working solutions that we tried:
modify ipatool script as described here
downgrade to ruby 2.0.0
install ruby gems CFPropertyList, sqlite3 that ipatool was complaining about

I was getting the Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." with my enterprise project when including a third party framework. My exportOptionsPlist file contained the compileBitcode=NO entry but the project itself still had bitcode on.
I also used the log at /var/folders/.../IDEDistribution.standard.log and found a clearer error that lead me to the solution.
More info: https://developer.apple.com/library/content/technotes/tn2432/_index.html

Copy following and add it to end of your ~/.bashrc (~/.zshrc if you are using ZSH). and quit the terminal and start it again (must).
unset RUBYLIB
unset RUBYOPT
unset BUNDLE_BIN_PATH
unset _ORIGINAL_GEM_PATH
unset BUNDLE_GEMFILE
unset GEM_HOME
unset GEM_PATH
FYI:
Since Xcode has a dependency to 2 external gems: sqlite and CFPropertyList
More information https://github.com/fastlane/fastlane/issues/6495
We have to unset those variables for rbenv, rvm and when the user uses bundler
Even if we do not use rbenv in some environments such as CircleCI,
We also need to unset GEM_HOME and GEM_PATH explicitly.
More information https://github.com/fastlane/fastlane/issues/627

That's it! Set the bitcode = no ,the error got fixed.😊

#Tom Harada answers worked for me but I wanted to find what was causing the default ipatool to break.
It was the Google Cast 3.2 SDK, which was missing an entry it the plist framework. Updating it to 3.3 solved the export issue.
Refs:
https://code.google.com/p/google-cast-sdk/issues/detail?id=954
https://github.com/fastlane/fastlane/issues/6223#issuecomment-267343853

My build script have the same problem, and I check some framework that I added. There is a framework that include a plist file(the name is the same as Info.plist). So, I delete the Info.plist file, the build script work fine.

Had a same issue with XCode 8.2.1
In my case the issue was reproducing on exporting an archive for either adhoc or appstore distribution with the following export info plist
<?xml version=1.0 encoding=UTF-8?>
<!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version=1.0>
<dict>
<key>teamID</key>
<string>TEAMID</string>
<key>method</key>
<string>ad-hoc</string> # or `app-store`
<key>uploadSymbols</key>
<true/>
<key>compileBitcode</key>
<false/>
<key>uploadBitcode</key>
<false/>
</dict>
</plist>
It turned out that one of the linked frameworks was compiled using bitcode. This was pointed out from the xcode export log:
IDEDistribution.stadard.log:
error: Failed to verify bitcode in YandexMapKit.framework/YandexMapKit:
error: Bundle only contains bitcode-marker /var/folders/zb/ftpjx10s547ddmzm_ybqdm51xdv_t7/T/IDEDistributionThinningStep.NKQ/Payload/Avito.app/Frameworks/YandexMapKit.framework/YandexMapKit (armv7)
I had to manually recompile the YandexMapKit project into iphoneos- and iphonesimulator- frameworks and merge them into a universal framework

At first, you need to check that if you have installed sqlite3 and CFPropertyList with gem on your mac.
Use these commands to review the result in your terminal:
gem list | grep sqlite3
gem list | grep CFPropertyList
if you print nothing, then you have to install them with sudo
sudo gem install sqlite3
sudo gem install CFPropertyList

Related

Flutter iOS build suddenly says "The bundle identifier of the application could not be determined."

All of a sudden my flutter app does not install on iOS. It has been working and building for a long time, and then all of a sudden I get this error...
Unable to install /Users/me/src/myapp/client/build/ios/iphonesimulator/Runner.app on F0FDB4EA-7E61-49D5-A39F-BA1C10D0CFA4. This is sometimes caused by a malformed plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Command: /usr/bin/arch -arm64e xcrun simctl install F0FDB4EA-7E61-49D5-A39F-BA1C10D0CFA4 /Users/me/src/myapp/client/build/ios/iphonesimulator/Runner.app
Error launching application on iPhone 13.
My info.plist definitely exists and has the bundle identifier specified as....
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>

":CFBundleIdentifier", Does Not Exist: ReactNative 0.58 on Mac / iOS

I am following the ReactNative tutorial for 0.58. I do everything it says to do and I am crashing after running react-native run-ios. I have seen this extremely similar SO question from 2016.
I attempted react-native upgrade and it recommended doing react-native-git-upgrade.This did nothing. Same problem.
The bit on running ./configure in the question above after cd-ing into glog did nothing. There was no configure script there. In the path NewStupidProject/node_modules/react-native/scripts there is a script called ios-configure-glog.sh. I run bash ios-configure-glog.sh and it says ios-configure-glog.sh: line 31: ./configure: No such file or directory.
I have also attempted setting Xcode to use the legacy build system. This did not fix the issue. I am restarting my laptop now to see if that makes any of these changes take effect. No luck. At the top it says:
Found Xcode project NewStupidProject.xcodeproj Building using
"xcodebuild -project NewStupidProject.xcodeproj -configuration Debug
-scheme NewStupidProject -destination id=854019D1-8EE7-4D13-87E1-385E6CAC21BE -derivedDataPath build" User
defaults from command line:
IDEDerivedDataPathOverride = /Users/me/NewStupidProject/ios/build
Prepare build
note: Using legacy build system
=== BUILD TARGET double-conversion OF PROJECT React WITH CONFIGURATION Debug ===
When I go into the home directory and run react-native --version the output is:
[NewStupidProject](master)$ react-native --version
react-native-cli: 2.0.1
react-native: 0.58.4
[NewStupidProject](master)$
My output after crashing is:
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Install\ Third\ Party /Users/me/native_react_apps/NewStupidProject/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)
Installing
build/Build/Products/Debug-iphonesimulator/NewStupidProject.app An
error was encountered processing the command
(domain=NSPOSIXErrorDomain, code=22): Failed to install the requested
application The bundle identifier of the application could not be
determined. Ensure that the application's Info.plist contains a value
for CFBundleIdentifier. Print: Entry, ":CFBundleIdentifier", Does Not
Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier
build/Build/Products/Debug-iphonesimulator/NewStupidProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Error: Command failed: /usr/libexec/PlistBuddy -c
Print:CFBundleIdentifier
build/Build/Products/Debug-iphonesimulator/NewStupidProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:637:11)
at Object.execFileSync (child_process.js:655:13)
at Promise.then (/Users/me/native_react_apps/NewStupidProject/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
How is it possible for the setup process to be this fraught with errors and this difficult?
WHY is this error message not in the Troubleshooting ReactNative setup?
HOW do I fix this? Is it possible to avoid this altogether in the future?
Other versioning info:
XCode: 10.1
Command Line Tools: 10.1
yarn: 0.27.5
watchman: 4.9.0
homebrew: 2.0.1
npm: 6.8.0
node: v11.9.0
macOS: 10.13.6
UPDATE:
I am trying to implement the solution in this issue in GitHub and I'm getting:
dyld: Library not loaded:
/usr/local/opt/readline/lib/libreadline.7.dylib Referenced from:
/usr/local/bin/awk Reason: image not found
./ios-install-third-party.sh: line 20: 24497 Broken pipe: 13
shasum -p "$cachedir/$file"
24498 Abort trap: 6 | awk -v hash="$hash" '{exit $1 != hash}' Incorrect hash: 61067502c5f9769d111ea1ee3f74e6ddf0a5f9cc
?/Users/me/.rncache/glog-0.3.5.tar.gz
UPDATE No. 2 I am trying to run the watchman watch-del-all command as recommended here to clear the cache for RN > 0.50 and the whole thing is hanging.
I tried modify the build system and it worked for me.
Detail:
Open your project workspace file in Xcode, and
File -> Workspace Settings -> Build system -> Legacy Build system

error: /.../node_modules/native-base/Fonts/rubicon-icon-font.ttf: No such file or directory

I'm having error building a fresh ios cloned repository. Days before this, it was working fine. Now I tried re-installing the native-base or removing node_modules and doing npm install again. But still having the error:
2018-05-10 12:07:07.983 xcodebuild[71799:432389] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-14095/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:757
Details: unexpected successful exit code from cancelled command <C0038:'CpResource Lato-Bold.ttf':P10>
Object: <PBXTargetBuildContext: 0x7fd2dfe53830>
Method: -createCommandInvocationRecordFromInvocation:
Thread: <NSThread: 0x7fd2df8641a0>{number = 3, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **
The following build commands failed:
CpResource /Users/sample_user/Documents/repos/mobile/node_modules/native-base/Fonts/rubicon-icon-font.ttf build/Build/Products/Debug-iphonesimulator/sampleApp.app/rubicon-icon-font.ttf
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/sampleApp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/sampleApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Here are my versions:
react-native-cli: 2.0.1
react-native: 0.47.2
"native-base": "^2.3.1",
pod version: 1.4.0
Have I missed anything?
I still got unexplainable errors after so I solved this by manually downloading rubicon-icon-font.ttf and pasted it in node_modules\native-base\Fonts\
This is fixed on master, you can find it in today's release
https://github.com/GeekyAnts/NativeBase/issues/1850
I got this error after I upgraded Native Base. The solution was to delete the missing files from XCode under Resources.

Error no mobile provisioning profile found

While using the build system instruction from https://webrtc.org/native-code/ios/ all went fine except following error
Error: no mobile provisioning profile found for
When i do xcrun security find-identity -v -p codesigning i do see my certificates, Is there anyway to fix it?
$ gn gen out/ios_64 --args='target_os="ios" target_cpu="arm64"'
Done. Made 719 targets from 110 files in 2444ms
$ ninja -C out/ios_64 AppRTCMobile
ninja: Entering directory `out/ios_64'
[2086/2100] CODE SIGNING //webrtc/sdk:r...(//build/toolchain/mac:ios_clang_arm64)
FAILED: WebRTC.framework/WebRTC WebRTC.framework/_CodeSignature/CodeResources WebRTC.framework/embedded.mobileprovision
python ../../build/config/ios/codesign.py code-sign-bundle -t=iphoneos -i=3F06B010E7BE32A3D212219D02DF440B0F20D6A3 -e=../../build/config/ios/entitlements.plist -b=obj/webrtc/sdk/WebRTC WebRTC.framework
Error: no mobile provisioning profile found for "org.webrtc.WebRTC".
ninja: build stopped: subcommand failed.
Let me tell the steps that works for me
Edit the file src/examples/objc/AppRTCMobile/ios/Info.plist and change the value com.google.AppRTCMobile with your own bundle identifier.
Edit the file src/sdk/objc/Framework/Info.plist and change the value org.webrtc.WebRTC with your own bundle identifier
I have created bundle identifiers on Xcode and after that build is successful

build alljoyn_darwin in Xcode 6.1.1 and get a No SConstruct file found error

Recently I am doing some AllJoyn development on iOS and OS X. When I run xcodebuild for alljoyn_darwin.xcodeproj using command line as below:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project alljoyn_darwin.xcodeproj -scheme alljoyn_core_ios -sdk iphoneos -configuration Debug PLATFORM_NAME=iphoneos
I got an error like this:
export variant=normal
/opt/local/bin/scons -u OS=darwin CPU=arm BR=on BINDINGS=cpp SERVICES= WS=off VARIANT=Debug --
scons: *** No SConstruct file found.
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.3.4/SCons/Script/Main.py", line 920, in _main
Command /opt/local/bin/scons failed with exit code 2
** BUILD FAILED **
The following build commands failed:
ExternalBuildToolExecution alljoyn_core_ios
(1 failure)
I really have no idea why I got this, I followed all the instruction in the official site--Build From Source and I am sure I set the correct OPENSSL_ROOT path. I installed scons using Macport and it was installed correctly. I tried double-click the alljoyn_darwin.xcodeproj from finder but I got the same error.
scons: *** No SConstruct file found.
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.3.4/SCons/Script/Main.py", line 920, in _main
Command /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/scons-2.3.4 failed with exit code 2
So I am stuck here. But the thing is I can successfully run AllChatz sample in sdk_14.12 for iOS in iphonesimulator for iPhone6. openssl version is 1.0.2 and I tried build both for alljoyn sdks 14.06 and 14.12. same error happened. I don't know if this is related. Anyone can help here? Many thanks.
The problem is that scons cant find the root-level SConstruct script, which probably doesnt help much as you can see that in the error :)
When you use the "-u", that tells scons to look up the directory structure for the root-level SConstruct script.
SCons must be executed from within the project directory structure. Look for the root-level SConstruct, and make sure you're executing scons from within the project directory structure.

Resources