grab/cocoapods-binary-cache

error: ad-hoc export app

bazuka5801 opened this issue ยท 6 comments

Building is okay, but export ipa   give me an error :(
image
Because all builded frameworks includes this flag.

My Podfile:

platform :ios, '11.0'

def is_pod_binary_cache_enabled
  ENV['IS_POD_BINARY_CACHE_ENABLED'] == 'true'
end

if is_pod_binary_cache_enabled
  plugin "cocoapods-binary-cache"
  config_cocoapods_binary_cache(
    cache_repo: {
      "default" => {
        "remote" => "git@github.com:somegit.git",
        "local" => "~/.cocoapods-binary-cache/some-release-config"
      }
    },
    
    prebuild_config: "Release",
    device_build_enabled: true,
    bitcode_enabled: true,
    excluded_pods: ["Capacitor"],
    dev_pods_enabled: true
  )
end

use_frameworks!

# workaround to avoid Xcode 10 caching of Pods that requires
# Product -> Clean Build Folder after new Cordova plugins installed
# Requires CocoaPods 1.6 or newer
install! 'cocoapods', :disable_input_output_paths => true

def capacitor_pods
  # Automatic Capacitor Pod dependencies, do not delete
  pod 'Capacitor', :path => '../../node_modules/@capacitor/ios', :binary => false
  pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios', :binary => true
  pod 'CapacitorCommunityFirebaseAnalytics', :path => '../../node_modules/@capacitor-community/firebase-analytics', :binary => true
  pod 'CordovaPluginsStatic', :path => '../capacitor-cordova-ios-plugins', :binary => true
  # Do not delete
end

target 'App' do
  capacitor_pods
  # Add your Pods here
  pod 'Firebase/Core', :binary => true
  pod 'Firebase/Auth', :binary => true
  pod 'Firebase/Analytics', :binary => true
  pod 'Firebase/Firestore', :binary => true
end


post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' # Only work from Xcode 11
    end
  end
end

Thanks for reaching out!

I would like to confirm this issue happening with device build enabled for dynamic frameworks.
About the root cause: when merging architectures of simulators & devices, the Info.plist corresponding to simulators were chosen, which should be the plist for devices instead.

We'll work on the fix and keep you posted.
Thank you

Hi @bazuka5801 The issue should be fixed in bedc1b0
Could you help check again if it works on your end with the fix? Thanks!

Hi @bazuka5801 The issue should be fixed in bedc1b0
Could you help check again if it works on your end with the fix? Thanks!

Hi! Thank you for flash fix :)
Checking in progress...
@trinhngocthuyen
Another question, I setup CI/CD it's possible to build only for devices, without for simulators? It's can reduce build time 2x

@trinhngocthuyen
UPD: Works!
Thank you for your work ๐Ÿค—
It's amazing to reduce build time on CI/CD.
image

Nice! Glad it works!

Another question, I setup CI/CD it's possible to build only for devices, without for simulators? It's can reduce build time 2x

Just to clarify the differences between using prebuilt frameworks with devices support vs. without devices support:

  • The doubling time it takes is actually the prebuild time, ie. the time to prebuild frameworks to push to the cache repo. This prebuild action is executed not that often, I guess.
  • The time to build the projects after being integrated with the given prebuilt frameworks (in the cache repo) is not much different. Under the hood, the overhead time Xcode or xcodebuild does is to strip unnecessary architectures of simulators in the fat binaries (of the prebuilt frameworks). This step is lightweight.

Anw, It's a valid request that we can specify to build only for devices. Actually, I left a TODO to specify the build types (simulator, or device, or both) ๐Ÿ˜„ https://github.com/grab/cocoapods-binary-cache/blob/master/lib/cocoapods-binary-cache/pod-rome/xcodebuild_command.rb#L41.

In our team, we use this plugin for CI jobs only, meaning build for testing, because it's a major bottleneck of our development process. For CD jobs (ex. QA builds, TestFlight builds), we still disable this plugin to minimize unexpected side effects.
I'm a little surprised that many use this plugin for AdHoc builds as well ๐Ÿ˜„ .