leavez / cocoapods-binary

integrate pods in form of prebuilt frameworks conveniently, reducing compile time
MIT License
1.3k stars 207 forks source link

Creating XCFramework of a library that uses binary pod FAILS! #156

Open iadcialim opened 2 years ago

iadcialim commented 2 years ago

Hi! I want to check with you guys if this is a known issue/limitation of this tool

Podfile

# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'

use_frameworks!
# https://github.com/leavez/cocoapods-binary
plugin 'cocoapods-binary'
keep_source_code_for_prebuilt_frameworks!

target 'FruitBasket' do

  pod 'RxSwift', :binary => true

end

Then I have this agreggate target that creates the xcframework of my library

# ios devices
xcodebuild archive \
    -workspace FruitBasket.xcworkspace \
    -scheme FruitBasket \
    -archivePath "./build/ios.xcarchive" \
    -sdk iphoneos \
    SKIP_INSTALL=NO

# ios simulator
xcodebuild archive \
    -workspace FruitBasket.xcworkspace \
    -scheme FruitBasket \
    -archivePath "./build/ios_sim.xcarchive" \
    -sdk iphonesimulator \
    SKIP_INSTALL=NO

# --------------
# XC Framework
# --------------
xcodebuild -create-xcframework \
    -framework "./build/ios.xcarchive/Products/Library/Frameworks/FruitBasket.framework" \
    -framework "./build/ios_sim.xcarchive/Products/Library/Frameworks/FruitBasket.framework" \
    -output "./build/FruitBasket.xcframework"

Upon running of the script, it will throw this error

module 'RxSwift' was created for incompatible target arm64-apple-ios9.0:.../FruitBasket-aggregated-target/Pods/RxSwift/RxSwift.framework/Modules/RxSwift.swiftmodule/arm64.swiftmodule

Without making it a binary pod is working fine

Env CocoaPods : 1.11.2 Xcode : 13.2.1 (13C100) cocoapods-binary : 0.4.4

Sample Project Cocoapods-binary-xcframework.zip