Cocoapods: pod spec lint fails to find matching XCFramework slice for a vendored library dependency

Created on 11 Nov 2020  Â·  10Comments  Â·  Source: CocoaPods/CocoaPods

Report

What did you do?

Run pod spec lint on a spec that contains a xcframework dependency.

What did you expect to happen?

The lint should have passed.

What happened instead?

The xcodebuild command failed with

error: no such module 'VerIDCore'
import VerIDCore
       ^

I also noticed this note in the pod spec lint command output:

- NOTE  | [iOS] xcodebuild:  warning: [CP] Unable to find matching .xcframework slice in 'Ver-ID-Core/VerIDCore.xcframework VerIDCore framework ios-i386_x86_64-simulator ios-arm64_armv7' for the current build architectures (arm64 i386 x86_64).

If you download the VerIDCore dependency you'll find it contains slices for armv7, arm64, i386 and x86_64.

Also worth mentioning is that I successfully integrated the VerIDCore dependency in a project. It's only if it's set as a dependency of another podspec that the podspec's lint fails.

CocoaPods Environment

Stack

   CocoaPods : 1.10.0
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
    RubyGems : 3.0.6
        Host : Mac OS X 10.15.7 (19H2)
       Xcode : 12.1 (12A7403)
         Git : git version 2.23.0
Ruby lib dir : /Users/jakub/.rvm/rubies/ruby-2.6.3/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /Users/jakub/.rvm/gems/ruby-2.6.3/bin/pod

Plugins

cocoapods-deintegrate  : 1.0.4
cocoapods-dependencies : 1.3.0
cocoapods-plugins      : 1.0.0
cocoapods-search       : 1.0.0
cocoapods-stats        : 1.1.0
cocoapods-trunk        : 1.5.0
cocoapods-try          : 1.2.0

Podfile

project 'VerIDUI.xcodeproj'
workspace 'VerIDUI.xcworkspace'

platform :ios, '10.3'
use_frameworks!

def veridcore
  pod 'Ver-ID-Core', '2.0.0-beta.04'
end

target 'VerIDUI' do
  veridcore
  pod 'RxSwift', '~> 5'
  pod 'RxCocoa', '~> 5'
end

target 'Ver-ID Sample' do
  pod 'DeviceKit', '~> 4.1'
end

target 'Thumbnails' do
  veridcore
end

target 'Preview' do
  veridcore
end

Project that demonstrates the issue

Github link

Most helpful comment

This issue is still occurring for me with v1.10.1 when trying to include BlackBerryDynamics.xcframework:

warning: [CP] Unable to find matching .xcframework slice in '.../BlackBerryDynamics.xcframework BlackBerryDynamics framework ios-x86_64-simulator ios-arm64' for the current build architectures (arm64 x86_64).

All 10 comments

Experiencing a similar issue with BugfenderSDK dependency...

Experiencing the same issue with Didomi-XCFramework dependency. Did you find any workaround?

After a closer look at the xcframework bash scripts and what they do, it seems that instead of copying the ios-x86_64-simulator slice to Products/Release-iphonesimulator in derived data, the scripts try to copy the ios-arm64 slice to Products/Release-iphoneos although while linting, -sdk iphonesimulator is used with xcodebuild.
This results in the slice not being copied at all and even if it would be, the architecture would be wrong and thus the symbols would be missing.

This issue might be related to #9525.

Experiencing the same issue with Didomi-XCFramework dependency. Did you find any workaround?

Yes. But it's so ugly that I even hesitate to call it a workaround. Details here.

Also worth mentioning is that I successfully integrated the VerIDCore dependency in a project. It's only if it's set as a dependency of another podspec that the podspec's lint fails.

I also am experiencing this exact issue. I was using Xcode 12.x command line tools and can verify the above statement. If I used the Xcode 11 command line tools I did NOT receive the error and was able to podspec lint successfully.

Just an FYI, my instance of this issue (personal private pod with BugfenderSDK as a dependency) magically went away when I updated to the latest cocoapods version (I am not sure if a BugfenderSDK change came along the way, but I don't think it did).

Not saying it's fixed everywhere, but if you haven't tried in the past 3 weeks, you might kick the tires and see if there's been any improvement.

@mharlowfod - thanks for that. I am using v1.10.1, and just solved my issue this morning.

This issue is still occurring for me with v1.10.1 when trying to include BlackBerryDynamics.xcframework:

warning: [CP] Unable to find matching .xcframework slice in '.../BlackBerryDynamics.xcframework BlackBerryDynamics framework ios-x86_64-simulator ios-arm64' for the current build architectures (arm64 x86_64).

Same issue here. I have a private pod with an xcframework dependency and the linting fails with the same.

CocoaPods 1.10.1

Same here when lint or push a pod with a binary xcframework (without i386 arch) dependency.
CocoaPods 1.10.1, it fails either on Xcode 12.4 or Xcode 11.7.
And --skip-import-validation does not help for this situation.

For now, I add --configuration=Debug for pod lib lint, it works. And install pod by specifying the source repo pod 'Name', :git => '...'.

Hope --configuration could be added to the repo push and trunk push commands. https://github.com/CocoaPods/CocoaPods/pull/10109

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tlandsmancars picture tlandsmancars  Â·  3Comments

5SMNOONMS5 picture 5SMNOONMS5  Â·  3Comments

pronebird picture pronebird  Â·  3Comments

steffendsommer picture steffendsommer  Â·  3Comments

spencerkohan picture spencerkohan  Â·  3Comments