Github Actions workflow throwing this error 'Could not resolve package dependencies Package.swift manifest for version 1.4.2' - xcode

I have a github-action configuration setup for an iOS App, with the following declaration in my CI.yml file:
name: BuildAndTestCI
on:
pull_request:
branches: [master]
jobs:
build-and-test:
runs-on: macos-latest
steps:
- uses: actions/checkout#v2
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_11.3.app
- name: Build and Test
run: xcodebuild clean build test -project sample/sample.xcodeproj -scheme "sample" -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPad Pro (12.9-inch) (5th generation)" ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO
But the workflow run and stop with the following error:
xcodebuild: error: Could not resolve package dependencies:
https://github.com/Juanpe/SkeletonView.git has no Package.swift manifest for version 1.4.2
The possible solutions that I've tried are:
Reset package caches
Upgrade the affected packages 'SkeletonView'
Perform a global search where 1.4.2 appears (no-where)
Build and Clean the project multiple times
Also my concerns are:
There is no package that has the version number 1.4.2 and yet the Github-Action Workflow still throws the said error every time a build process is triggered via commit.
There is absolutely no way to do a proper debugging, and I feel like I'm stuck
Below is the full logs of the Github-Action Workflow:
**Set up a job**
Current runner version: '2.284.0'
Operating System
Virtual Environment
Virtual Environment Provisioner
GITHUB_TOKEN Permissions
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout#v2' (SHA:ec3a7ce113134d7a93b817d10a8272cb61118579)
**Run actions/checkout#v2**
Run actions/checkout#v2
Syncing repository: repository/sample-ios
Getting Git version info
Deleting the contents of '/Users/runner/work/sample-ios/sample-ios'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
Determining the checkout info
Checking out the ref
/usr/local/bin/git log -1 --format='%H'
'9ebab3de7d5294064240e266cb4070a52e08c672'
**Select Xcode**
Run sudo xcode-select -switch /Applications/Xcode_11.3.app
**Build and test**
Run xcodebuild clean build test -project sample/sample.xcodeproj -scheme "sample" -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPad Pro (12.9-inch) (5th generation)" ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO
Build settings from command line:
CODE_SIGNING_REQUIRED = NO
ONLY_ACTIVE_ARCH = NO
SDKROOT = iphonesimulator13.2
Resolve Package Graph
Fetching https://github.com/Juanpe/SkeletonView.git
Fetching https://github.com/apollographql/apollo-ios.git
Fetching https://github.com/firebase/firebase-ios-sdk.git
Fetching https://github.com/getsentry/sentry-cocoa
Fetching https://github.com/intercom/intercom-ios
xcodebuild: error: Could not resolve package dependencies:
https://github.com/Juanpe/SkeletonView.git has no Package.swift manifest for version 1.4.2
Error: Process completed with exit code 74.

Related

xcodebuild resolves dependency, but can't import the package

I have a simple command line application, written in swift 5.3, which uses the ArgumentParser package from Apple.
It builds and runs just fine from within Xcode (12.4). However, if I run xcodebuild, as such:
xcodebuild -target mailfilter
It gives this error:
/Users/hacksaw/Documents/src/mailfilter/mailfilter/main.swift:10:8: error: no such module 'ArgumentParser'
import ArgumentParser
^
The relevant project info:
% xcodebuild -list
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -list
Resolve Package Graph
Resolved source packages:
swift-argument-parser: https://github.com/apple/swift-argument-parser # 0.3.2
Information about project "mailfilter":
Targets:
mailfilter
Build Configurations:
Debug
Release
If no build configuration is specified and -scheme is not passed then "Release" is used.
Schemes:
mailfilter
% xcodebuild -version
Xcode 12.4
Build version 12D4e
So, what command line ought I run for it to build correctly?
So the (still unsatisfying) answer to this is indeed that -scheme needs to be included, so this works:
xcodebuild -scheme mailfilter -target mailfilter
An article I read somewhere said something about xcodebuild having a "legacy" mode which is invoked if you don't include a -scheme argument, but didn't go into detail.
I'd love a more complete answer to this, but for now, I'm leaving it.

Setting up CI for Catalyst with `pod gen` and `xcodebuild build test`

I'd like to add Catalyst testing to our CI for testing libraries described by podspec's, but running into signing issues:
git clone git#github.com:firebase/firebase-ios-sdk.git
pod gen FirebaseCore.podspec --local-sources=./ --platforms=ios
xcodebuild build test -configuration release -workspace /Users/paulbeusterien/gh8/firebase-ios-sdk/gen/FirebaseCore/FirebaseCore.xcworkspace -scheme FirebaseCore-Unit-unit ARCHS=x86_64h VALID_ARCHS=x86_64h ONLY_ACTIVE_ARCH=NO SUPPORTS_MACCATALYST=YES -sdk macosx CODE_SIGN_IDENTITY=-
After compiling and linking, it fails with
Testing failed:
FirebaseCore-Unit-unit:
AppHost-FirebaseCore-Unit-Tests.app (88189) encountered an error (Failed to load the test bundle. (Underlying error: The bundle “FirebaseCore-Unit-unit” couldn’t be loaded because it is damaged or missing necessary resources. The bundle is damaged or missing necessary resources. dlopen_preflight(/Users/paulbeusterien/Library/Developer/Xcode/DerivedData/FirebaseCore-eyanoskvkatavqdrdwdwryhqqdsc/Build/Products/Release-maccatalyst/AppHost-FirebaseCore-Unit-Tests.app/Contents/PlugIns/FirebaseCore-Unit-unit.xctest/Contents/MacOS/FirebaseCore-Unit-unit): no suitable image found. Did find:
/Users/paulbeusterien/Library/Developer/Xcode/DerivedData/FirebaseCore-eyanoskvkatavqdrdwdwryhqqdsc/Build/Products/Release-maccatalyst/AppHost-FirebaseCore-Unit-Tests.app/Contents/PlugIns/FirebaseCore-Unit-unit.xctest/Contents/MacOS/FirebaseCore-Unit-unit: code signature in (/Users/paulbeusterien/Library/Developer/Xcode/DerivedData/FirebaseCore-eyanoskvkatavqdrdwdwryhqqdsc/Build/Products/Release-maccatalyst/AppHost-FirebaseCore-Unit-Tests.app/Contents/PlugIns/FirebaseCore-Unit-unit.xctest/Contents/MacOS/FirebaseCore-Unit-unit) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)))
Any suggestions?
I needed to add CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO.
The following command builds and runs the tests successfully:
xcodebuild test -configuration Debug -workspace /Users/paulbeusterien/gh8/firebase-ios-sdk/gen/FirebaseCore/FirebaseCore.xcworkspace -scheme FirebaseCore-Unit-unit ARCHS=x86_64h VALID_ARCHS=x86_64h ONLY_ACTIVE_ARCH=NO SUPPORTS_MACCATALYST=YES -sdk macosx CODE_SIGN_IDENTITY=- SUPPORTS_UIKITFORMAC=YES CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
This solution worked for me locally, but only partially on GitHub Actions. With GitHub Actions testspecs that include requires_app_host still failed to run tests. Details in this PR.

What am I missing with my pod install? Xcode Build fails Azure Devops Pipeline

I am using an Azure Devops Build pipeline to build my Xcode workspace. It builds fine locally as well as if I import the repo and use it in AppCenter to build.
But I want to use an external Git, thus using a Build Pipeline.
It is pretty simple in terms of steps.
1 - Get Repo (finishes this step)
2 - Pod Install (finishes this step)
3 - Install Cert/Provision Profile (finishes this step)
4 - Build
Here is the yaml for pod
steps: task: CocoaPods#0 displayName: 'pod install'
And result from the task:
Pod installation complete! There are 9 dependencies from the Podfile and 9 total pods installed.
AND HERE IS THE ERROR
▸ Running script '[CP] Check Pods Manifest.lock'
❌ /Users/vsts/agent/2.149.1/work/1/s/MyDemo/Extension Files/SortedArray.swift:10:8: no such module 'Starscream'
import Starscream
^
** 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
I have looked through the docs and I can't figure out what is going on. I've messed with the settings to no avail.
Using Xcode 10 to build.
Thanks
This error is due to the Xcode task not working out of the workspace path.
Update the xcWorkspacePath variable in your azure-pipelines.yml file from **/*.xcodeproj/project.xcworkspace to yourProjectName.xcworkspace.
- task: Xcode#5
inputs:
xcWorkspacePath: 'yourProjectName.xcworkspace'

Xamarin iOS Framework Binding

I am trying to create a binding for the WePay Framework:
https://github.com/wepay/wepay-ios
Following are the steps that I followed.
I installed CocoaPods.
I installed ObjectiveSharpie
I run this command in terminal : $ sharpie pod init ios WePay
And I get this error: Could not install CocoaPod
here is the full error message:
** Setting up CocoaPods master repo ...
(this may take a while the first time)
Setting up CocoaPods master repo
$ /usr/bin/git pull --ff-only
From https://github.com/CocoaPods/Specs
ee36ba4..8c6767d master -> origin/master
Updating ee36ba4..8c6767d
Fast-forward
Specs/BluetoothKit/0.3.0/BluetoothKit.podspec.json | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 Specs/BluetoothKit/0.3.0/BluetoothKit.podspec.json
Setup completed
** Searching for requested CocoaPods ...
** Working directory:
** - Writing Podfile ...
** - Installing CocoaPods ...
** (running pod install --no-integrate --no-repo-update)
[!] Unknown option: --no-integrate
Did you mean: --no-ansi?
Usage:
$ pod install
Downloads all dependencies defined in `Podfile` and creates an Xcode Pods
library project in `./Pods`.
The Xcode project file should be specified in your `Podfile` like this:
project 'path/to/XcodeProject.xcodeproj'
If no project is specified, then a search for an Xcode project will be
made. If more than one Xcode project is found, the command will raise an
error.
This will configure the project to reference the Pods static library, add
a build configuration file, and add a post build script to copy Pod
resources.
Options:
--repo-update Force running `pod repo update` before
install
--project-directory=/project/dir/ The path to the root of the project
directory
--silent Show nothing
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command
error: could not install CocoaPod
Well apparently the most recent CocoaPods removed the --no-integrate option that objective sharpie uses. Downgrading cocoapods to 0.39.0 should fix your issue. It worked for us.

pod lib lint fails with bitcode error

I have created custom control for tvOS (https://github.com/Ponf/FPScrollingBanner) and I'm trying to publish it in cocoapods repository. When I'm checking podspec using pod lib lint it fails with next log:
Integrating target `Pods` (`../../../../var/folders/9w/9v94b0_j4l1b_802_my5vlc00000gn/T/CocoaPods/Lint/App.xcodeproj` project)
Adding Build Phase 'Embed Pods Frameworks' to project.
Adding Build Phase 'Copy Pods Resources' to project.
Adding Build Phase 'Check Pods Manifest.lock' to project.
- Running post install hooks
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Building with xcodebuild.
xcodebuild clean build -workspace App.xcworkspace -scheme App -configuration Release CODE_SIGN_IDENTITY=- -sdk appletvsimulator
Build settings from command line:
CODE_SIGN_IDENTITY = -
SDKROOT = appletvsimulator9.1
=== CLEAN TARGET FPScrollingBanner OF PROJECT Pods WITH CONFIGURATION Release ===
Check dependencies
target 'FPScrollingBanner' has bitcode disabled (ENABLE_BITCODE = NO), but it is required for the 'appletvos' platform
** CLEAN FAILED **
The following build commands failed:
Check dependencies
(1 failure)
=== BUILD TARGET FPScrollingBanner OF PROJECT Pods WITH CONFIGURATION Release ===
Check dependencies
target 'FPScrollingBanner' has bitcode disabled (ENABLE_BITCODE = NO), but it is required for the 'appletvos' platform
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
-> FPScrollingBanner (1.0.0)
- ERROR | [tvOS] xcodebuild: Returned an unsuccessful exit code.
Pods workspace available at `/var/folders/9w/9v94b0_j4l1b_802_my5vlc00000gn/T/CocoaPods/Lint/App.xcworkspace` for inspection.
[!] FPScrollingBanner did not pass validation, due to 1 error.
/Users/filipp/projects/CocoaPods/lib/cocoapods/command/lib.rb:181:in `block in run'
/Users/filipp/projects/CocoaPods/lib/cocoapods/command/lib.rb:153:in `each'
/Users/filipp/projects/CocoaPods/lib/cocoapods/command/lib.rb:153:in `run'
/Users/filipp/.rvm/gems/ruby-2.0.0-p643/bundler/gems/CLAide-4ded02e52c34/lib/claide/command.rb:312:in `run'
/Users/filipp/projects/CocoaPods/lib/cocoapods/command.rb:48:in `run'
/Users/filipp/projects/CocoaPods/bin/pod:44:in `<main>'
So as I can see, the problem is target 'FPScrollingBanner' has bitcode disabled (ENABLE_BITCODE = NO), but it is required for the 'appletvos' platform. When I'm opening App.workspace with Xcode, it has no bitcode option at all.
Xcode version: 7.2
Cocoapods built from latest master branch with specifying latest CocoaPods Core.
I have fallback to cocoapods version 0.39.0 and bug doesn't reproduced anymore. It looks like something broken in current master branch.
Maybe you can set *.podspec file:
s.xcconfig = {
'ENABLE_BITCODE' => 'NO'
}
in my *.podspec ,add this will set the framework BITCODE disable.

Resources