Skip to content

xcodebuild pulls in wrong platform resources #8729

Closed
@rcavaltw

Description

Report

What did you do?

In a project with a multiplatform dependency (say ios and tvos) when building the ios target, tvos dependencies get pulled into the output folder and the build breaks. Building any dependency inside xcode works fine.
That started happening with xcodebuild 10.2 (and 10.2.1).
I have a dummy project reproducing the error.
I'm opening the ticket here, as I'm not sure if it is an issue with xcodebuild, fastlane or cocoapods. There are open tickets with apple and fastlane as well.

What did you expect to happen?

xcodebuild to work perfectly as it does inside xcode.

What happened instead?

Dependencies from the wrong platform gets copied into the output release folder and the build fails.

CocoaPods Environment

Stack

   CocoaPods : 1.6.1
        Ruby : ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin18]
    RubyGems : 3.0.3
        Host : Mac OS X 10.14.4 (18E226)
       Xcode : 10.2.1 (10E1001)
         Git : git version 2.21.0
Ruby lib dir : /Users/rcaval/.rbenv/versions/2.3.3/lib
Repositories : globoi - https://github.com/globoi/pods-repository @ 23df14270cb216dd6c08867436b44b5a03f87eef
               master - https://github.com/CocoaPods/Specs.git @ dce2fe14e18416ecc429d83dbf778b9612421fac
               penthera - https://github.com/penthera/Cache-and-Carry-specs.git @ 1099e1497eb656ea55045c58ac8a16cf506e25c1

Installation Source

Executable Path: /Users/rcaval/.rbenv/versions/2.3.3/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.3.1
cocoapods-try         : 1.1.0

Podfile

use_frameworks!
inhibit_all_warnings!

workspace 'Example'

def shared_pods
  pod 'Clappr', '0.11.41'
end

def ios_pods
    platform :ios, '9.3'
    shared_pods
end

target 'Example' do
    ios_pods
end

target 'ExampleTests' do
  ios_pods
end

target 'Example_tvOS' do
    platform :tvos, '10.0'
    shared_pods
end


target 'Example_tvOSTests' do
  platform :tvos, '10.0'
  shared_pods
end

Project that demonstrates the issue

https://github.com/rcavaltw/multiplatform_xcode_error

Metadata

Assignees

No one assigned

    Labels

    s1:awaiting inputWaiting for input from the original authors7:workaround availableA workaround for the issue is available

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions