When i upload my app to app store, i've had a problem:
Unable to validate your application:
The path '/var/folders/hm/.../MyApp.ipa' does not contain a file
I have another error:
Couldn't find platform family in Info.plist CFBundleSupportedPlatforms or Mach-O LC_VERSION_MIN for sfnt2woff
I've added:
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
in my plist file but it doesn't work.
Any solution?
Thanks !
Have the same problem. Just delete some .bundle resource from "Bundle Resources" in Build Phases in Xcode project. See here:
Setting "Enable bit code" to NO worked for me
Also:
Clean build folder
rm -rf ~/Library/Developer/Xcode/DerivedData
Restart xcode.
If you do not wish to rebuild, you can untick theses checkbox:
I've found a solution. In my application, a library called "ionicons" has been used. I just simply remove the sfnt2woff file in lib/ionicons/builder/scripts/ and the validation works.
For me, I was asked for permission to access something in my Keychain. I mistakenly clicked 'deny'. Once I re-archived the app again and granted it the permission, it works.
For the benefit of others like me: I had a similar problem with an old version of sparkle that didn't include the info.plist in the framework.
Check all your frameworks; They now also need an info.plist with these settings.
Related
In my iOS apps, i have a script (a build phase actually) that upgrades the target's Info.plist CFBundleVersion to a number related to the git commit count. I've been using for a while and it works for me, never a problem.
On Xcode 14, something has changed and the script keeps working (i mean the .plist file is correctly updated) but applications no longer shows the correct build number and it's missing on Archive too.
I'll add some screenshot (of a blank new project, so no settings have been altered in times).
This is Target's General Tab in Xcode 14
This is Target's Info Tab
This is Info.plist file correctly updated by Build Phase Script
In previous Xcode versions, on Target's General Tab i used to have the build number synced with the one in .plist file and it was also synced when Archiving builds.
Now, if i try to archive the build, it goes out as 1.0(1).
Am I missing something or am I doing something wrong?
Hope you can understand my English.
Thanks for your help.
I use xcconfig for set version and build in Xcode.
In Base.xcconfig set
MARKETING_VERSION = 22.47.0
CURRENT_PROJECT_VERSION = 221125.1437
Pay attention if you using CocoaPods you should create Release and Debug xcconfig with content
Debug.xcconfig
#include "../Pods/Target Support Files/Pods-{SET_PROJECT_HERE}/Pods-{SET_PROJECT_HERE}.debug.xcconfig"
#include "Base.xcconfig"
Release.xcconfig
#include "../Pods/Target Support Files/Pods-{SET_PROJECT_HERE}/Pods-{SET_PROJECT_HERE}.release.xcconfig"
#include "Base.xcconfig"
Set values in info.plist
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
Hope its help
I'm new to DevOps so please go easy on me if I've missed something basic :)
I’m using the following in Azure Pipelines: Hosted MacOS with an Xcode Build Agent (Xcode Version 5.142.0)
I've just started trying to set up a pipeline for an Xcode based project which uses multiple provisioning profiles. In my scenario I have profiles for the following in my app:
Intents
ItentsUI
Widget
App
I've followed the instructions for setting up certs and provisioning profiles here (although my project uses automatic signing):
https://learn.microsoft.com/en-us/azure/devops/pipelines/apps/mobile/app-signing?view=vsts&tabs=apple-install-during-build
These are being installed correctly to a hosted build agent (no errors) and the build is proceeding perfectly until signing.
During signing it seems that the none of the targets can find their provisioning profiles (both when using 'manual' and 'automatic' assignment).
Here's what is run in the logs:
[command]/usr/bin/xcodebuild -workspace /Users/vsts/agent/2.142.1/work/1/s/*MYAPP**.xcworkspace -scheme **MYAPP** archive -sdk iphoneos -configuration Release -archivePath /Users/vsts/agent/2.142.1/work/1/s/**MYAPP** CODE_SIGN_STYLE=Manual PROVISIONING_PROFILE= PROVISIONING_PROFILE_SPECIFIER= | /usr/local/bin/xcpretty --no-color
Then later when it comes to archiving the following occurs for each scheme:
error: "xxx Today Widget" requires a provisioning profile with the Push Notifications and App Groups features. Select a provisioning profile for the "Release" build configuration in the project editor. (in target 'xxx Today Widget')
A few questions:
Is there an updated guide anyone can point me to? This seems like a common use case and I'm obviously missing something.
Alternatively is there a way to force which profile gets used for which scheme when archiving and signing multiple schemes in the same build?
Is automatic signing an option in pipelines?
For completeness I've seen what looks like a somewhat similar issue here: https://github.com/Microsoft/azure-pipelines-tasks/issues/964 but it's been closed for more than two years.
Here's how we got building an iOS app with multiple provisioning profiles to work in Azure DevOps.
Ensure you have the Apple App Store Azure DevOps extension written by Microsoft installed in your account.
Install all of the provisioning profiles that are needed using multiple Install Apple Provisioning Profile tasks
Add the Xcode build task and configure it with your workspace/project settings
Set the "Signing style" to "Automatic signing" and provide your team ID in the "Team ID" field under the "Signing & provisioning" section
Create a .plist file, configure it similar to the following, and put it somewhere (your code repository, secure files, etc). This example is of a watch app, but could be any scenario where multiple provisioning profiles are necessary. You can find a provisioning profile's UUID by opening it in a text editor and looking for the "UUID" key.
<?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>provisioningProfiles</key>
<dict>
<key>YOUR_BUNDLE_ID.watchkitapp.watchkitextension</key>
<string>UUID_OF_ASSOCIATED_PROVISIONING_PROFILE</string>
<key>YOUR_BUNDLE_ID.watchkitapp</key>
<string>UUID_OF_ASSOCIATED_PROVISIONING_PROFILE</string>
<key>YOUR_BUNDLE_ID</key>
<string>UUID_OF_ASSOCIATED_PROVISIONING_PROFILE</string>
</dict>
<key>signingCertificate</key>
<string>iOS Distribution</string>
<key>signingStyle</key>
<string>manual</string>
<key>method</key>
<string>app-store</string>
<key>teamID</key>
<string>YOUR_TEAM_ID</string>
</dict>
</plist>
Under the "Package options" section, specify "Plist" in the "Export options" field and provide a path to the .plist you created in the "Export options plist" field
Make sure to correctly target your Project's .xcworkspace file instead of letting it default to <Project Name>.xcodeproj/project.xcworkspace. This haunted me for two days while testing.
Example:
- task: Xcode#5
inputs:
sdk: '$(sdk)'
scheme: '$(scheme)'
configuration: '$(configuration)'
xcWorkspacePath: '**/<Project Name>.xcworkspace' # Make sure this line is here
xcodeVersion: 'default' # Options: default, 10, 9, 8, specifyPath
exportPath: '$(agent.buildDirectory)/output/$(sdk)/$(configuration)'
it turns out after closer inspection the development certificate I had been using was the wrong one (there were a few on my Mac). I swapped this for the appropriate version and the issues went away.
I can now successfully build, archive and sign.
Hopefully this helps someone.
Andrew
I added it manually in app.iOS.csproj file in tag and in the main solution file. Now it is showing and I am successfully able to archive my project and iPA file is made. But the problem is that I am unable to install my app on device when installing through diawi.
I solved the problem by adding "aps-environment" key with value as
"production" in Entitlements.plist in my iOS project
Previously there was "development" as value. I changed it to "production"
I want to be able to run Xamarin.Forms from source so I can set breakpoints etc in it. I want to do this primarily so I can see how things get called so I can better understand how it works in response to my use of it in my app. I don't want to do it in the final app, I'd just like to swap out the source version for the nuget package in the end. During development though I would like to see how it runs things to better understand how I can manipulate/override/implement different details.
So far I am close to getting it to compile with my project, but I get 2 build issues realated to Xamarin.Forms.Conrols.Issues I think they are just unit tests, but it stops the build.
/Users/username/github/Xamarin/Xamarin.Forms/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39636.xaml: Error: Object reference not set to an instance of an object (Xamarin.Forms.Controls)
And
/Users/username/github/Xamarin/Xamarin.Forms/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/PlatformSpecifics_iOSTranslucentNavBarX.xaml: Error: Object reference not set to an instance of an object (Xamarin.Forms.Controls)
Maybe there is a better way to run it from source and have it integrate with a project and I am just missing it?
These are the projects I have added to my project in a Solution Folder:
Maybe I am on the right path, maybe not. Currently I am only targeting iOS I have an Android project but I am not concerned with that at the moment, just trying to limit it to running on iOS. If that's an issue I can definitely change it. It shouldn't care about the Android parts if I am building for iOS only. Maybe it does?
... LATER ...
Ok tinkering some more I got it down to these packages:
When I right click on the solution folder and select: "Build Xamarin.Forms" the build succeeds. It only fails now with the following error when I try to build my app's Form's project:
/Users/username/github/Xamarin/MyProject/App.xaml.cs(13,13): Error CS0103: The name 'InitializeComponent' does not exist in the current context (CS0103) (MyProject)
I get 51 errors whenever it references anything inside Xamarin.Forms or when it's trying to access a x:Name in some XAML from the code behind.
Intellisense sees the method as well, in this case InitializeComponent so at least that seems to know about it.
Ok, I got it. Here's how I did it:
Clone the Xamarin.Formsrepo from github:
https://github.com/xamarin/Xamarin.Forms
The following applies to Xamarin.Forms 2.3.4.247
cd into the newly cloned repo and checkout that tag corresponding to Xamarin Forms v2.3.4.247:
$ git clone git#github.com:xamarin/Xamarin.Forms.git
$ cd Xamarin.Forms
$ git checkout 2.3.4-2
Add these projects into your project. I placed them in a new solution folder within the project in Visual Studio Mac. I was only concerned with iOS. It would be similar for Android, just adding those specific libs. To figure how the dependencies I just opened the Xamarin.Forms.sln file and check each project's references.
Xamarin.Forms.Platform
Xamarin.Forms.Core
Xamarin.Forms.Platform.iOS
Xamarin.Forms.Xaml
Xamarin.Forms.Build.Tasks
Xamarin.Forms.Xaml.Xamlc
Xamarin.Forms.Xaml.Xamlg
Next, update packages for Xamarin.Forms.Build.Tasks (Mono.Cecil is missing when you import this project. It has a little warning icon by it in the packages list UI)
Now cd to your project folder and copy the .nu* files from the Xamarin.Forms Repo:
$ ls -1
Xamarin.Forms
YourProject
$ cd YourProject
$ cp -r ../Xamarin.Forms/.nu* ./
Afterwards, in the following to csprojfiles (The forms project and the platform project):
YourProject/YourProject/YourProject.csproj
YourProject/iOS/SourceTest.iOS.csproj
file add the following <Import> at the bottom before </Project>:
<Import Project="..\.nuspec\Xamarin.Forms.targets" Condition="Exists('..\.nuspec\Xamarin.Forms.targets')" />
Note this is referencing the files we copied above.
Finally it's time to add the references in Visual Studio to both projects.
Forms Project
Platform Project
That's it. It should compile now and you can add breakpoints into Xamarin.Forms and see how things run. Be sure you added that <Import> node above to ALL csproj files using Xamarin.Forms. From the looks of it, It's responsible for triggering XamlC to process the XAML. When you install Xamarin.Forms from Nuget, it adds this for you. Also be sure you have copied the *.nu files mentioned above to the root of your solution directory.
Remember, once you are done tinkering and you decide to install the Nuget Xamarin.Forms package, you may need to undo some of the changes you made above. For example, check the csproj files to be sure the <Import> is only from the package install.
In case you get compiler errors, check the Xamarin project references. Here are the individual Xamarin related inter-project dependencies that I used to generate the project reference list above.
Xamarin.Forms.Core
References
Xamarin.Forms.Platform
Xamarin.Forms.Platform
References
None
Xamarin.Forms.Platform.iOS
References
Xamarin.Forms.Core
Xamarin.Forms.Xaml
References
Xamarin.Forms.Core
Xamarin.Forms.Xaml.Xamlc
References
Xamarin.Forms.Build.Tasks
Xamarin.Forms.Xaml.Xamlg
References
Xamarin.Forms.Build.Tasks
Xamarin.Forms.Build.Tasks
References
Xamarin.Forms.Core
Xamarin.Forms.Xaml
In addition to AJ Venturella's answer, you also need in 2022:
...
<Import Project="..\..\.nuspec\Xamarin.Forms.targets" />
<Import Project="..\..\.nuspec\Xamarin.Forms.props" />
<Import Project="..\..\.nuspec\Xamarin.Forms.DefaultItems.targets" />
<Import Project="..\..\.nuspec\Xamarin.Forms.DefaultItems.props" />
</Project>
Open .nuspec\Xamarin.Forms.nuspec and check the content that targets "build". It's what's above.
How do you generate an Info.plist in Xcode because I am getting the following error when I build my project?
error: could not read data from '../dists/xcode/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.
What should I do?
Thanks!
Sounds like your Info.plist file is merely lost.
Search through your project to see if there is any file with the name "Info.plist", or has "Info.plist" as part of the name (e.g. "TopNotchCoderProjectInfo.plist").
Once you find it, you can either reset your project settings to use the correct Info.plist file -- the path to this specific file can be entered into the Project settings:
Also, make certain the plist file exists in the list of files and folders in your project (and that it isn't "red", which is Xcode's way of telling you it's missing).