Azure CI pipeline build error while building Xcode project - xcode

I am trying to set up a CI pipeline using Azure DevOps and i am getting an error as follows while running the pipeline in the xcode section:
'FirebaseCore/FirebaseCore.h' file not found
#import <FirebaseCore/FirebaseCore.h>
'FirebaseCore/FirebaseCore.h' file not found
#import <FirebaseCore/FirebaseCore.h>
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
##[error]Error: /usr/bin/xcodebuild failed with return code: 65
Finishing: Xcode
A small part of my podfile is as follows:
#Firebase
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'FirebaseInstanceID', '~> 4.3'
And my azure-pipelines.yml file looks like this:
pool:
vmImage: 'macos-latest'
steps:
- task: CocoaPods#0
inputs:
forceRepoUpdate: true
projectDirectory: '$(system.defaultWorkingDirectory)'
displayName: 'pod install using the CocoaPods task with a forced repo update and a custom project directory'
- task: Xcode#5
inputs:
actions: 'build'
scheme: ''
sdk: 'iphoneos'
configuration: 'Release'
xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace'
xcodeVersion: 'default' # Options: 8, 9, 10, default, specifyPath
I was been trying to get it solved by trying many fixes, but nothing helped. And now i don't know what to do. I would be really satisfied if anyone helps me out in this.

Related

AWS Amplify Build Error - Mismatched Brackets Found In The Schema

End Desire:
To build my AWS Amplify project in the dev environment, using full-stack CI/CD. So for example, pushing my changes to Code Commit will build the backend resources.
Build Logs:
2023-01-06T06:19:26.457Z [INFO]: [33mNote: It is recommended to run this command from the root of your app directory[39m
2023-01-06T06:19:27.797Z [WARNING]: - Initializing your environment: dev
2023-01-06T06:19:29.164Z [WARNING]: - Building resource api/project
2023-01-06T06:19:33.756Z [WARNING]: - Building resource auth/project
2023-01-06T06:19:33.902Z [WARNING]: - Building resource storage/project
2023-01-06T06:19:33.939Z [WARNING]: ✔ Initialized provider successfully.
2023-01-06T06:19:34.452Z [WARNING]: ✖ There was an error initializing your environment.
2023-01-06T06:19:34.453Z [INFO]: 🛑 Syntax Error: mismatched brackets found in the schema. Unexpected ) at line 239 in the schema.
2023-01-06T06:19:34.453Z [INFO]: Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
buildspec.yml:
version: 0.1
frontend:
phases:
preBuild:
commands:
- npm i
build:
commands:
- npm run build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
Checks:
I have checked the graphql.schema for errors.
I have removed the testing section in the buildspec.
I have added amplify push --simple as recommended here
I've ran npm run build on my local CLI successfully
In the AWS Amplify console, under build settings, the AWS CLI version was "latest". Changing the AWS CLI version to 10.4.0 fixed the issue.
View AWS CLI Versioning here: https://www.npmjs.com/package/#aws-amplify/cli?activeTab=versions
Rather than going to 10.4.0, go back a couple versions from the latest AWS CLI version at the time.

Azure Devops: Add capability to xcode build for push notifications

I'm running an azure pipeline to build my .ipa file for iOS Deployment.
Everything is working fine except one detail.
When I'm uploading my app to testflight and run it I got the following message in OneSignal:
Other Apns 3000 Error
Error 3000 returned from
APNs. Ensure "Push Notifications" in Xcode under "Project Target" -> Capabilities are enabled.
Check the device log in Xcode for more details.
Unfortunately I have not found anything how to enable the capability for push notifications in the pipeline.
My provisioning profile has the capability for push notifications enabled. But this seems not to work. I also have background mode "Remote Notifications" enabled in my info.plist file. This is also not helping.
Here is a part of my pipeline:
steps:
- task: InstallAppleCertificate#2
displayName: 'Install an Apple certificate'
inputs:
certSecureFile: '*****.p12'
setUpPartitionIdACLForPrivateKey: false
steps:
- task: InstallAppleProvisioningProfile#1
displayName: 'Install an Apple provisioning profile'
inputs:
provisioningProfileLocation: sourceRepository
provProfileSourceRepository: 'path/path/Profile_*****.mobileprovision'
steps:
- task: Xcode#5
displayName: 'Xcode clean build'
inputs:
actions: 'clean build'
xcWorkspacePath: path/path/App.xcworkspace
scheme: App
packageApp: true
signingOption: manual
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
args: '-allowProvisioningUpdates'
workingDirectory: '$(System.DefaultWorkingDirectory)/ios'
Appended you can find some screenshots:
Provisioning Profile
OneSignal Error

App Center Test task: uitest (Xamarin UI Test) DevOps AppCenterTest#1

I try to test a Xamarin App, works on localhost, doesn't seems to work on Azure DevOps.
Error Android:
Preparing tests... failed.
Error: Failed to prepare UI Test artifacts using command "test-cloud.exe prepare" with error message:
There was an unknown error preparing test artifacts, please try again. If you can't work out how to fix this issue, please contact support.
- task: AppCenterTest#1
displayName: 'App Test Android'
inputs:
appFile: '$(System.DefaultWorkingDirectory)/app.apk'
artifactsDirectory: '$(Build.ArtifactStagingDirectory)'
uitestToolsDir: '$(System.DefaultWorkingDirectory)'
frameworkOption: uitest
serverEndpoint: 'androidEndPoint'
appSlug: 'MyOrg/Android'
uiTestBuildDirectory: '$(System.DefaultWorkingDirectory)'
debug: true
enablePrepare: true
devices: bc141325
userDefinedLocale: 'de_DE'
series: 'master'
Error iOs:
Response status code: 400
Body: {"message":"The .ipa file does not seem to be linked with Calabash framework."}
Starting test run... failed.
Error: The .ipa file does not seem to be linked with Calabash framework.
- task: AppCenterTest#1
displayName: 'App Test Mac'
inputs:
appFile: '$(System.DefaultWorkingDirectory)/iosapp.ipa'
artifactsDirectory: '$(Build.ArtifactStagingDirectory)/AppCenterTest'
frameworkOption: uitest
serverEndpoint: 'iosappEndPoint'
uitestToolsDir: '$(System.DefaultWorkingDirectory)'
appSlug: 'MyOrg/iosapp'
devices: 'MyOrg/test'
enablePrepare: true
userDefinedLocale: 'de_DE'
showDebugOutput: true
uiTestBuildDirectory: '$(System.DefaultWorkingDirectory)'
series: 'master'
Why Calabash?
I also installed this and running on a macOS-latest host:
- task: NodeTool#0
inputs:
versionSpec: '16.14.2'
- task: Bash#3
displayName: 'npm install -g appcenter-cli'
inputs:
targetType: 'inline'
script: |
npm i -D webpack#latest
npm install -g appcenter-cli
workingDirectory: '$(System.DefaultWorkingDirectory)'

Azure pipeline fails on building Kotlin Multiplatform shared framework usinig embedAndSignAppleFrameworkForXcode and fastlane

I'm working on a Kotlin Multiplatform project which is building fine locally but I can't get it to work on an Azure DevOps pipeline.
Some good things to know:
not using Cocoapods
using the embedAndSignAppleFrameworkForXcode gradlew command in Build Phases
all commands using fastlane work for multiple developers locally
we use custom configurations like: ProjectADebug/ProjectARelease but we defined KOTLIN_FRAMEWORK_BUILD_TYPE for all of them
I'm trying to get an Azure DevOps pipeline to build and upload to App Store Connect using fastlane. We are using match for signing, that works great. Archiving fails and it looks like it's failing on building the shared KMM framework.
Anybody with the same problems that could help me out? Or some tips how I can view those gym logs on the Azure VM because I assume there it says what actually went wrong instead of this general error.
▸ Running script 'Build Kotlin Common'
▸ Copying /Users/runner/Library/Developer/Xcode/DerivedData/Project-ffubndppzitzbxhibjgeavrhnzpw/Build/Intermediates.noindex/ArchiveIntermediates/Project/BuildProductsPath/ProjectRelease-iphoneos/Airship_AirshipCore.bundle
▸ Copying /Users/runner/Library/Developer/Xcode/DerivedData/Project-ffubndppzitzbxhibjgeavrhnzpw/Build/Intermediates.noindex/ArchiveIntermediates/Project/BuildProductsPath/Project Release-iphoneos/Airship_AirshipAutomation.bundle
** ARCHIVE FAILED **
The following build commands failed:
PhaseScriptExecution Build\ Kotlin\ Common /Users/runner/Library/Developer/Xcode/DerivedData/Project-ffubndppzitzbxhibjgeavrhnzpw/Build/Intermediates.noindex/ArchiveIntermediates/Project/IntermediateBuildFilesPath/Project.build/ProjectRelease-iphoneos/Project.build/Script-2F4970EC27CD16A000E32F91.sh (in target 'Project' from project 'Project')
(1 failure)
ERROR [2022-05-10 13:04:32.36]: Exit status: 65
ERROR [2022-05-10 13:04:32.53]: ⬆️ Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
WARN [2022-05-10 13:04:32.53]: 📋 For the complete and more detailed error log, check the full log at:
WARN [2022-05-10 13:04:32.53]: 📋 /Users/runner/Library/Logs/gym/Project-Project.log
This is the the lane in Fastfile:
lane :azure_beta do |options|
label = options[:label].capitalize
git_url = "someURL"
match(
type: "appstore",
readonly: true,
git_url: git_url,
keychain_name: ENV["MATCH_KEYCHAIN_NAME"],
keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"],
verbose: true
)
build_app(
project: "../Project/Project.xcodeproj",
configuration: "#{label}Release",
scheme: label
)
# fails on the build_app step...
changelog = changelog_from_git_commits(
pretty: "- (%ae) %s",
date_format: "short",
merge_commit_filtering: "exclude_merges"
)
upload_to_testflight(
changelog: changelog,
app_identifier: label == "Project" ? idsProjectA : idsProjectB,
skip_waiting_for_build_processing: true
)
version_number = get_version_number(
xcodeproj: "../Project/Project.xcodeproj",
target: "Project", #Hardcoded because we have multiple targets, label is specificed in build_app configuration
configuration: "#{label}Release"
)
add_git_tag(
includes_lane: false,
prefix: "ios-#{label.downcase}-#{version_number}-",
build_number: number_of_commits
)
delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"])
end
And this is my pipeline YAML:
pool:
vmImage: 'macos-latest'
variables:
- group: fastlane
jobs:
- job: testflight
steps:
- task: Bash#3
displayName: fastlane update
inputs:
targetType: 'inline'
script: |
gem update fastlane
fastlane --version
- task: JavaToolInstaller#0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: Bash#3
displayName: 'Update Dependencies'
inputs:
targetType: 'inline'
script: HOMEBREW_NO_AUTO_UPDATE=1 brew bundle
- task: Bash#3
displayName: "Set build properties"
inputs:
targetType: 'inline'
script: |
echo "sdk.dir=/Users/runner/Library/Android/sdk"
echo "INCLUDE_MOCKER=false" >> local.properties
echo "INCLUDE_ANDROID=false" >> local.properties
echo "INCLUDE_TESTER=false" >> local.properties
echo "APP_LABEL=$(APP_LABEL)" >> local.properties
env:
APP_LABEL: $(APP_LABEL)
- task: Gradle#2
displayName: 'Clean label common'
inputs:
workingDirectory: ''
tasks: "common:cleanLabel"
env:
APP_LABEL: $(APP_LABEL)
- task: Bash#3
displayName: fastlane ios
env:
MATCH_PASSWORD: $(MATCH_PASSWORD)
FASTLANE_PASSWORD: $(FASTLANE_PASSWORD)
FASTLANE_SESSION: $(FASTLANE_SESSION)
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: $(FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD)
inputs:
targetType: 'inline'
script: |
sudo xcode-select -s /Applications/Xcode_13.2.app
cd ios/Project
fastlane azure_beta label:Project app_identifier:project.bundle.id itc_team_id:itc.team.id team_id:team.id git_match_branch:master username:me#myself.com
As it turned out there was an error in building the common KMM layer, I would have found it when doing a clean checkout probably but I found out by using a self-hosted agent on Azure Devops so I could navigate to the /Users/runner/Library/Logs/gym/Project-Project.log as Pylyp Dukhov suggested.

CircleCI API behaving differently from github commit trigger?

I'm running the cypress-example-kitchen sink app on CircleCI.
This is my yaml config script:
version: 2.1
orbs:
cypress: cypress-io/cypress#1.0.1
workflows:
build:
jobs:
- cypress/install:
build: 'npm run build'
- cypress/run:
requires:
- cypress/install
start: 'npm start'
This kicks off and passes just fine when I make a commit to my fork of the repo above.
However, when I try to execute a CircleCI build programmatically, using
curl -X POST https://circleci.com/api/v1.1/project/github/Atticus29/cypress-example-kitchensink?circle-token=myApiToken, the build fails and the jobs dashboard on CircleCI tells me that something is wrong with my config file:
6 schema violations found required key [jobs] not found workflows:
5 schema violations found
workflows: minimum size: [2], found: 1
workflows: build: jobs: 4 schema violations found
workflows: build: jobs: 0: 0 subschemas matched instead of one
workflows: build: jobs: 0: expected type: String, found: Mapping
workflows: build: jobs: 0: install: extraneous key [build] is not permitted
workflows: build: jobs: 1: 0 subschemas matched instead of one
workflows: build: jobs: 1: expected type: String, found: Mapping
workflows: build: jobs: 1: run: extraneous key [start] is not permitted
And that something went wrong with my build:
Build-agent version 0.1.1216-48f80d08 (2018-12-07T16:01:40+0000)
Configuration errors: 2 errors occurred:
Configuration version 2.1 requires the "Enable Build Processing" project setting. Enable Build Processing under Project Settings ->
Advanced Settings. In order to retrigger build processing, you must
push a new commit.
Cannot find a job named build to run in the jobs: section of your configuration file. If you expected a workflow to run, check your
config contains a top-level key called 'workflows:'
I can confirm that Enable Build Processing is on.
None of these were problems when I ran the build in the usual way. Any advice?
Circle CI for some reason keeps on assuming that the projects are not set up for v2.0 despite config.yml being called the right thing and living in the right place in the repo. After a few commits, this issue seems to go away?
I ended up running a build programmatically with the following script:
#!/bin/bash
PERSONAL_TOKEN=myPersonalTokenHere
MOST_RECENT_BUILD=`curl -s "https://circleci.com/api/v1.1/recent-builds?circle-token=$PERSONAL_TOKEN&limit=1"| grep 'build_num'|grep -o '\d.'|sed 's/,//g'|sort -r -n|head -n1`
curl -X POST "https://circleci.com/api/v1.1/project/github/holmbergius/wildMeCypress/$MOST_RECENT_BUILD/retry?circle-token=$PERSONAL_TOKEN"

Resources