sweatco / xcode-archive-cache

XcodeArchiveCache, native targets cache for Xcode archive builds
MIT License
98 stars 8 forks source link

XCFramework/React-Native support #28

Closed zanechua closed 3 years ago

zanechua commented 3 years ago

Hey.

Looked at this repo in hopes that it would cut down build times for us but unfortunately I am unable to even build a react-native project with this.

From a clean react-native project, it seems to be complaining about the OpenSSL framework.

Reproduction

npx react-native init test

Gemfile

# Gemfile
source "https://rubygems.org"

gem "cocoapods", '1.10.1'
gem 'xcode-archive-cache', "0.0.10"

Cachefile

workspace "test" do
  configuration "release" do
    build_configuration "Release"
  end

  derived_data_path "build"

  target "test" do
    cache "libPods-test.a"
  end
end

Error:

ld: warning: directory not found for option '-F/Users/zanechua/Library/Developer/Xcode/DerivedData/test-aqmcodtwbtqbrvfcthgckclsbqam/Build/Intermediates.noindex/ArchiveIntermediates/test/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/OpenSSL'
ld: framework not found OpenSSL
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This also happens on my own project with OneSignal and there's probably another error that i saw was a linker error too. But I would say let's take things step by step.

I'm building this on an M1 Mac

Ilushkanama commented 3 years ago

Hey @zanechua, thanks for reporting this. #29 fixes the issue, and I was able to build project generated by react-native init with it. While we're resolving CI issues to merge the fix, you can install fixed version with:

gem 'xcode-archive-cache', git: 'https://github.com/sweatco/xcode-archive-cache.git', branch: 'feature/pods-xcframeworks-support'

zanechua commented 3 years ago

Thanks for getting back so quickly and fixing it.

Tried to install the gem but it seems that in the new gemspec, you're using Date.today and seems like there's a dependency missing or something?

[!] There was an error while loading `xcode-archive-cache.gemspec`: uninitialized constant Date
Did you mean?  Data. Bundler cannot continue.

 #  from /Users/zanechua/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/bundler/gems/xcode-archive-cache-9b82512038fb/xcode-archive-cache.gemspec:10
 #  -------------------------------------------
 #    spec.summary = "Native targets cache for Xcode archive builds."
 >    spec.date = Date.today
 #
 #  -------------------------------------------
zanechua commented 3 years ago

I forked your repo and replaced Date.today with Time.now in the gemspec.

Have tested your changes and can confirm everything works well! 😄

Awesome!

Ilushkanama commented 3 years ago

@zanechua thanks, I've fixed gemspec date as well. Feel free to use our repo's branch in your Gemfile.