How to Fix ' *Pod* Does Not Support Provisioning Profiles' in Azure Devops Build Agent

How to fix ' *pod* does not support provisioning profiles' in azure devops build agent

The issue is that the newest version of Cocoapods is trying to sign the frameworks.

Add the following code to your podfile

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
end

Azure Devops macOS Pipeline fails on hosted with missing provisioning profile

Make sure you have uploaded provisioning profile & .p12 file to the pipeline library. After that you can include this at the end of your Podfile:

post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end

For more information, refer to this article

Cordova: Azure Devops Pipeline Xcode build failed: Pods-Name does not support provisioning profiles. Pods-Name does not support provisioning profiles

Cordova does not add support for iOS orientation by default, but you can get there by adding build hooks.

To make this working, I followed these steps:

Add the following to your config.xml file:

<platform name="ios">
<hook src="iosAfterPlatformAdd.js" type="after_platform_add" />
</platform>

Create a file named iosAfterPlatformAdd.js in the top-level directory and copy the below code in the file:

const fs = require("fs");
const execSync = require("child_process").execSync;
console.log('iosAfterPlatformAdd hook called');

execSync(`cd platforms/ios && pod deintegrate && cd ../../`, {
stdio: "inherit"
});

const searchString = 'use_frameworks!';
const fileName = './platforms/ios/Podfile';
const appendText = `${searchString}
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
end`;

try {
const data = fs.readFileSync(fileName, { encoding: 'utf8', flag: 'r' });
let content = data.replace(searchString, appendText);
const updatedData = fs.writeFileSync(fileName, content);
console.log('Podfile', content);
} catch (err) {
console.error(err)
}

execSync("pod install --project-directory='./platforms/ios/'", {
stdio: "inherit"
});
execSync("pod update --project-directory='./platforms/ios/'", {
stdio: "inherit"
});

From the command line, run the below commands to change the Podfile automatically:

cordova platform rm ios

cordova platform add ios

You should see the added lines in the Podfile file at this point.
then the Archive and resolved the issue.

Ionic Cordova iOS xxx does not support provisioning profiles Azure Pipelines

So after a while of testing and refactoring our code the solution was a combination of factors that I will try to share cohesively.

Azure Pipelines

The first fix to this issue was to modify our Azure pipeline step to define plist export options. The default value of Automatic just wouldn't work no matter what we tried. With this we needed to configure some other variables. Here is where we landed with this configuration:

- task: Xcode@5
displayName: 'Xcode archive'
inputs:
actions: archive
xcWorkspacePath: 'platforms/ios/**/*.xcworkspace'
archivePath: '$(buildName).xcarchive'
scheme: $(buildName)
packageApp: true
destinationTypeOption: devices
exportOptions: plist
exportOptionsPlist: '$(system.defaultworkingdirectory)/platforms/ios/exportOptions.plist'
exportPath: '$(system.defaultworkingdirectory)/platforms/ios/output/iphoneos/Release'
signingOption: manual
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
args: '$(iosCompileArgs)'

Our iosCompileArgs is passing in CODE_SIGNING_ALLOWED=No which was required as called out in the previous answers, but doesn't get you all the way.

Ionic

Next we needed to modify our Ionic build a bit. One of the items we changed was adding a build.json file to the repo. We were having issues with the development team not being assigned properly.

Our build.json looks like this:

{
"ios": {
"debug": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "XXXXXXXX",
"provisioningProfile": "XXXX-XXXX-XXXX-XXXX",
"packageType": "development",
"buildFlag": ["-allowProvisioningUpdates"]
},
"release": {
"codeSignIdentity": "iPhone Distribution",
"developmentTeam": "XXXXXXXX",
"provisioningProfile": "XXXX-XXXX-XXXX-XXXX",
"packageType": "app-store",
"buildFlag": ["-allowProvisioningUpdates"]
}
}
}

Finally we had a particular cranky package cordova-plugin-firebasex that needed to be pinned to a specific version "cordova-plugin-firebasex": "9.1.1-cli".

The command we run to build the ionic platform in a step prior to archiving is:

ionic cordova build ios $(buildEnvParam)

With the buildEnvParam being --release --device --buildConfig=build.json

Conclusion

Throughout this experience we encountered countless issues. We would open one door and get smashed in the face with another. I'm sorry there isn't a straight forward answer, but honestly we didn't have a straight forward problem. I hope this summary will help someone get over a hurdle in the future.

How to configure the Provisioning Profile for a .net6 iOS application in Azure DevOps?

I just found out that there are two tasks that replaces part of what the Xamarin.iOS task was doing.

The 1st one is the Install Apple Certificate task.

I have uploaded my signing certificate and configured a variable to hold my password:

Install Apple Certificate

The 2nd one is the Install Apple provisioning profile and this is the answer to the question. I just had to download the Provisioning profile I retrieved from the Apple Developer account and uploaded it in the Task.

Install Apple provisioning profile



Related Topics



Leave a reply



Submit