Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: ad-hoc export app #25

Closed
bazuka5801 opened this issue Oct 6, 2020 · 6 comments
Closed

error: ad-hoc export app #25

bazuka5801 opened this issue Oct 6, 2020 · 6 comments

Comments

@bazuka5801
Copy link

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
@trinhngocthuyen
Copy link
Contributor

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

@trinhngocthuyen
Copy link
Contributor

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

@bazuka5801
Copy link
Author

bazuka5801 commented Oct 7, 2020

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

@bazuka5801
Copy link
Author

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

@trinhngocthuyen
Copy link
Contributor

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.

@trinhngocthuyen
Copy link
Contributor

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 😄 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants