xcode ios publish fails - ios

I have set CFBundleShortVersionString & CFBundleVersion in App_Resources/iOS/info.plist as
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleVersion</key>
<string>1.0.0.0</string>
using nativescript:
tns-ios: 2.1.0
tns --version: 2.1.0
here is the tns publish ios output:
ERROR ITMS-90057: "The bundle 'Payload/<XYZ>.app/Frameworks/NativeScript.framework' is missing plist key. The Info.plist file is missing the required key: CFBundleShortVersionString."
ERROR ITMS-90057: "The bundle 'Payload/<XYZ>.app/Frameworks/NativeScript.framework' is missing plist key. The Info.plist file is missing the required key: CFBundleShortVersionString."
For some reason it does not find the mentioned key. Any ideas?
Thanks
Update:
Open platforms/ios/Internal/NativeScript.framework/Info.plist in Xcode.
change bundle Version : 2.1.0
add bundle versions string, short : 2.1

This is a known bug in v2.1 of NativeScript; you actually need to modify the
/platforms/ios/Internal/NativeScript.framework/Info.plist
file with those two keys.
See: https://github.com/NativeScript/NativeScript/issues/2397

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>

Why won't manually built iPadOS .app install?

Rewriting and resubmitting this question after quite a bit of investigation and testing. I did not make the fact that we're trying to avoid Xcode prominent in the original question. I hope there is someone out there with knowledge of building iOS apps without Xcode.
I am only using Xcode to test. We build our one common app for MacOS (our pkg installs fine), Windows, Android, Linux etc with one simple build system. We have no need to break one build out just to use Xcode, unless there is absolutely no choice. We didn't need Xcode for our MacOS app/pkg.
I built, packaged and signed the iOS app with codesign manually using my developer account. I am able to drag and drop my saxzez-client.app onto a iPad Air 2 simulator and I see it installed there. I checked my physical iPad Air 2 and see that my provisioning profile is installed there. I connected my iPad Air 2 to my Mac Mini M1 and I dragged and dropped it onto the iPad Air 2. It fails to install.
Here is the error output I'm getting right now on the iPad Air 2 console:
default 22:55:00.406095-0500 installd com.saxzez.client:7:5:1:1:Start : Install (New)
default 22:55:00.435293-0500 SpringBoard termination assertion efficacy for com.saxzez.client (app not found) changed to 3
default 22:55:00.441904-0500 installd 0x16f553000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]: 77: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.YRAXDM/extracted/Saxzez-Client.app : 0xe8008015 (A valid provisioning profile for this executable was not found.)
and (grabbed this later)
default 23:03:39.060054-0500 securityd trustd[116]/1#11 LF=0 copy_parent_certificates Error Domain=NSOSStatusErrorDomain Code=-34018 "Client has neither application-identifier nor keychain-access-groups entitlements" UserInfo={numberOfErrorsDeep=0, NSDescription=Client has neither application-identifier nor keychain-access-groups entitlements}
default 23:03:39.060822-0500 securityd trustd[116]/1#11 LF=0 copy_parent_certificates Error Domain=NSOSStatusErrorDomain Code=-34018 "Client has neither application-identifier nor keychain-access-groups entitlements" UserInfo={numberOfErrorsDeep=0, NSDescription=Client has neither application-identifier nor keychain-access-groups entitlements}
default 23:03:39.062453-0500 trustd cert[0]: IssuerCommonName =(path)[]> 0
default 23:03:39.063467-0500 installd Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid SubjectCommonName]
Here is the codesign command usage:
codesign -f -s "Apple Development: Bob Smith (XXXXXXXXXX) " Saxzez-Client.app
My 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>CFBundleDisplayName</key>
<string>Saxzez Client</string>
<key>CFBundleIdentifier</key>
<string>com.saxzez.client</string>
<key>CFBundleVersion</key>
<string>1.0.423</string>
<key>CFBundleShortVersionString</key>
<string>1.0.423</string>
<key>CFBundleExecutable</key>
<string>Saxzez-Client</string>
<key>CFBundleIconFiles</key>
<array>
<string>our-icon</string>
</array>
<key>LSRequiresIPhoneOS</key>
<false/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
<string>metal</string>
<string>wifi</string>
</array>
<key>UIRequiresPersistentWiFi</key>
<true/>
<key>UILaunchImageFile</key>
<string>our-icon</string>
<key>CFBundleName</key>
<string>Saxzez Client</string>
</dict>
</plist>
My Saxzez-Client.app directory contains the following:
ls -R
Saxzez-Client Info.plist _CodeSignature our-icon.png embedded.mobileprovision en.lproj
./_CodeSignature:
CodeResources
./en.lproj:
InfoPlist.strings
Well, I used this tool to sign the app I built: https://dantheman827.github.io/ios-app-signer/ and my app installed perfectly! So, it has to be something to do with the codesign cert I'm using or something related. The great news is I didn't need to use Xcode :). It's late, so I'll post the actual fix uncovered by ios-app-signer tomorrow.
btw, I am building and packaging on my new Mac M1, just not using Xcode. Once I have a template for the basic .app structure, I hope to only use Xcode to testing on simulators and pushing to my iPad Air 2. Same for MacOS and Android (no Android Studio for building/packaging).
Update:
It was the entitlements.plist file that is needed by codesign. Once I got the generated entitlements.plist file from the ios-app-signer tool, I can sign from the command line, zip it up into a .ipa file and it installs perfectly on the physical iPad Air 2.

Cordova Phonegap "Export Failed" error code 70 While building ios

I am currently using Cordova Phonegap to build an application for iOS. It was working fine, but now I'm getting an error when I'm running cordova build ios in the terminal.
I'm getting the following error:
** EXPORT FAILED **
Error: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,RoastBot.xcarchive,-exportOptionsPlist,/Users/JarrodMorgan/Desktop/RoastBot/platforms/ios/exportOptions.plist,-exportPath,/Users/JarrodMorgan/Desktop/RoastBot/platforms/ios/build/device
Any help is appreciated!
This is caused by Xcode 9 expecting certain values in exportOptions.plist located in the path that is displayed in the error message. In your case it is ,/Users/JarrodMorgan/Desktop/RoastBot/platforms/ios/exportOptions.plist.
Here is how exportOptions.plist looks for me:
<?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>compileBitcode</key>
<false/>
<key>method</key>
<string>development</string>
<key>teamID</key>
<string>TEAM_ID_GOES_HERE</string>
<key>provisioningProfiles</key>
<dict>
<key>YOUR_BUNDLE_ID</key>
<string>PROVISIONIG_PROFILE_UUID_WOULD_BE_HERE</string>
</dict>
<key>signingStyle</key>
<string>manual</string>
<key>signingCertificate</key>
<string>iPhone Developer</string>
</dict>
</plist>
Double check that you have provisioningProfiles and signingStyle values in your exportOptions.plist if you don't then you probably have cordova-ios version prior to 4.5.2. This was fixed and released in cordova-ios 4.5.2 please see this PR
In order for your to resolve this error update your cordova-ios to 4.5.2 or later, drop your plugins and platforms and re-add them.
However in my case after upgrading to cordova-ios 4.5.4 I started to see following error:
ld: 270 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It turns out that that was caused by the fact that cordova built cordova-plugin-console into its core and if you have that plugin in your project than you might get the above error. Simply remove cordova-plugin-console and this error will go away. Here is what it says on console plugin's github page:
This plugin is no longer being worked on as the functionality provided
by this plugin is now included in cordova-ios 4.5.0 or greater, and
support is already built in to cordova-windows > 5.0.0. You should
remove this plugin from your applications.
Here is the link to the docs.
You can solve this problem by returning to the old PhoneGap version.
Add this to your config.xml file
<preference name="phonegap-version" value="cli-6.3.1" />

xcodebuild exportArchive: no applicable devices found

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

CFBundleShortVersionString must be a period-separated list of most three non-negative integers

When submitting my app to the app store I get this error:
Here is the relevant part from my info.plist file:
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
When I submit the app you can clearly see that there is no version 1.0.0.pre.
I use CocoaPods as well.
How do I solve this problem?
Update: Here is what I try on my project path: find . -name "*.plist" -exec grep -o -A 1 "CFBundleShortVersionString" {} \; and here is the result:
CFBundleShortVersionString
<string>1.0.6</string>
CFBundleShortVersionString
<string>1.0</string>
CFBundleShortVersionString
<string>3.3.4</string>
CFBundleShortVersionString
<string>1.5.5</string>
CFBundleShortVersionString
<string>2.0.2</string>
CFBundleShortVersionString
<string>0.7.0</string>
CFBundleShortVersionString
<string>0.0.9</string>
CFBundleShortVersionString
<string>1.2.2</string>
CFBundleShortVersionString
<string>1.6.0</string>
CFBundleShortVersionString
<string>1.7.2</string>
CFBundleShortVersionString
<string>2.0.0</string>
CFBundleShortVersionString
<string>1.3.2</string>
CFBundleShortVersionString
<string>1.4.1</string>
CFBundleShortVersionString
<string>1.0</string>
CFBundleShortVersionString
<string>0.9.1</string>
CFBundleShortVersionString
<string>0.2.3</string>
CFBundleShortVersionString
<string>1.0.0</string>
CFBundleShortVersionString
<string>3.7.3</string>
CFBundleShortVersionString
<string>0.15.0</string>
CFBundleShortVersionString
<string>1.0.0.pre</string>
CFBundleShortVersionString
<string>2.3.0</string>
CFBundleShortVersionString
<string>2.0.0</string>
CFBundleShortVersionString
<string>1.2</string>
CFBundleShortVersionString
<string>3.0.2</string>
Update 2: Doing: xcodebuild > build.log I get the following error:
2015-10-25 22:02:52.653 xcodebuild[6273:1043943] [MT] PluginLoading: Required plug-in compatibility UUID 7265231C-39B4-402C-89E1-16167C4CC990 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/VVDocumenter-Xcode.xcplugin' not present in DVTPlugInCompatibilityUUIDs
** BUILD FAILED **
Locating Version Numbers
Since you don't see the string within your project it's likely there is a bundle, frameworks or libraries associated with your project that is responsible. From the topmost directory in your project you can use find in addition to grep to look for the culprit:
find . -name "*.plist" -exec grep -iq "CFBundleShortVersionString" {} \; \
-exec grep -Him 1 "1.0.0.pre" {} \;
This may return results that might resemble something such as:
Binary file ./FooProject/Foo.framework/Info.plist matches
./FooProject/Resources/Info.plist- <string>1.0.0.pre</string>
In the event results are returned then you'll have located the reason for the "ERROR ITMS-90096 This bundle is invalid. The value for key CFBundleVersionShortString...". If the result returned is within a Framework as shown in the first result above (eg. Binary file) or another bundle/library then you will need to change the value within it's defined project (provided that it's simply a mistake in the version number). You could also create a clean up script to replace the value at build time before code signing.
1.0.0.pre
The more important thing here though is why your app was rejected and what the 1.0.0.pre version was created specifically to do. Using a version tag that purposefully makes your app get rejected was meant to prevent you from using prerelease code in a production app — it's by design. The person(s) who created that specific pod, bundle, framework, library, are telling you:
"Don't use this prerelease code in an app that you are planning to deploy to the public".
I would suggest not just simply changing the version number of the items .plist so that your app submits successfully — instead check for a stable release version meant for production.
Multiple Info.plists
Frameworks, pods, and bundles all have their own .plist and version numbers. They are not "overriding" your main applications version number but rather simply have their own (one of which obviously not valid).
Check 1:
You may want to search for "version" in the build settings. In case of weird situations I usually use this "view":
Go to the Build Settings.
On the left hand side from "Basic All" select "All"
On the left hand side from "Combined Level" select "Level"
In the search box type "version" and press return/enter
In my MacOSX test project it looks like this:
Note that there is an entry named "version name suffix". I'm not sure, whether or not this exists in an iOS project (will test later). In any case you can look through the settings which "easily" relate to "version".
Check 2:
Alternatively you could grep the project file:
grep pre MyProject.xcodeproj/project.pbxproj
Check 3:
Open a terminal and in the project directory call this:
xcodebuild clean
xcodebuild > build.log
with cocoapods likely this:
xcodebuild -workspace PRJ.xcworkspace -scheme PRJ clean
xcodebuild -workspace PRJ.xcworkspace -scheme PRJ > build.log
In build.log search for "ProcessInfoPlistFile". In my case it looks like this: (manually wrapped - actual project name changed)
ProcessInfoPlistFile build/Release-iphoneos/PRJ.app/Info.plist PRJ/Info.plist
cd /Users/fsc/prj/PRJ
export PATH="/Applications/Xcode.app/..."
builtin-infoPlistUtility /Users/fsc/prj/PRJ/PRJ/Info.plist
-genpkginfo /Users/fsc/prj/PRJ/build/Release-iphoneos/PRJ.app/PkgInfo
-expandbuildsettings -format binary -platform iphoneos
-additionalcontentfile /Users/fsc/prj/PRJ/build/PRJ.build/Release-iphoneos/PRJ.build/Main-SBPartialInfo.plist
-additionalcontentfile /Users/fsc/prj/PRJ/build/PRJ.build/Release-iphoneos/PRJ.build/LaunchScreen-PartialInfo.plist
-additionalcontentfile /Users/fsc/prj/PRJ/build/PRJ.build/Release-iphoneos/PRJ.build/assetcatalog_generated_info.plist
-o /Users/fsc/prj/PRJ/build/Release-iphoneos/PRJ.app/Info.plist
Note the -additionalcontentfile. Please check which additional files are listed and check these.
Check 4:
Look into the IPA archive to see where the "1.0.0.pre" actually is found. For that open "Window > Organizer", select your app and press "Export...". Select "Save for iOS App Store Deployment". The result will be an .ipa file. Rename it to PRJ.ipa.zip - then you can unpack it. Look for the .plist files and check their content.
One of your 3rd party pod has the version number "1.0.0.pre". Seems the error relates to it. The error doesnt say which plist, perhaps your build has more than one. Eg the pod in question creates a bundle on its own for instance.
It is most likely a CocoaPods related problem, do not change the info.plist's in your frameworks manually, do these steps:
1) Add this script at the end of your Podfile.
post_install do |installer|
app_plist = "MyApp/Info.plist"
plist_buddy = "/usr/libexec/PlistBuddy"
version = `#{plist_buddy} -c "Print CFBundleShortVersionString" #{app_plist}`
version = `echo "#{version}" | tr -d '\n'`
puts "Updating CocoaPods frameworks' version numbers to #{version}"
installer.pods_project.targets.each do |target|
`#{plist_buddy} -c "Set CFBundleShortVersionString #{version}" "Pods/Target Support Files/#{target}/Info.plist"`
end
end
2) Update the path in app_plist variable so that it matches the path to your app's .plist file.
3) Run pod install afterwards.
This script changes all Cocoapods frameworks' version numbers to match the app's plist, which is required as of 21 Oct 2015.
Pod reinstall worked for me. you can try it once.

Resources