infinitered / ignite-bowser

Bowser is now re-integrated into Ignite CLI! Head to https://github.com/infinitered/ignite to check it out.
https://infinite.red/ignite
MIT License
615 stars 140 forks source link

Newly generated app: detox build does not work #377

Closed jksaunders closed 3 years ago

jksaunders commented 3 years ago

What's going on?

npm run ios and npm run android work perfectly, as does running through XCode.

However, the iOS detox build command does not work out of the box, resulting in the following errors:

ld: in /TestDetox/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/joshuasaunders/projects/trivvy/TestDetox/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I also tried installing the latest version of detox (has iOS 14 support) but no luck there!


Steps to reproduce

ignite doctor results:

USER_NAME:TestDetox joshuasaunders$ ignite doctor
System
  platform           darwin                                                       
  arch               x64                                                          
  cpu                8 cores      Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz       
  directory          TestDetox    /Users/USER_NAME/projects/TestDetox 

JavaScript
  node               12.12.0      /usr/local/bin/node 
  npm                6.13.4       /usr/local/bin/npm  
  yarn               -            not installed       

Ignite
  ignite-cli           3.5.1                                                                                                        /usr/local/bin/ignite                        
  ignite src           build                                                                                                        /usr/local/lib/node_modules/ignite-cli/build 
  navigation           react-navigation                                                                                                                                          
  generators           {"component":"ignite-bowser","model":"ignite-bowser","navigator":"ignite-bowser","screen":"ignite-bowser"}                                                
  createdWith          3.5.1                                                                                                                                                     
  boilerplate          ignite-bowser                                                                                                                                             
  boilerplateVersion   5.4.0                                                                                                                                                     

Android
  java               11.0.5       /usr/bin/java                             
  android home       -            /Users/USER_NAME/Library/Android/sdk 

iOS
  xcode              12.0       
  cocoapods          1.9.1        /Users/USER_NAME/.rvm/rubies/ruby-2.7.0/bin/pod
xyclos commented 3 years ago

I finally got mine to work by specifying -destination in the build command.

In my case name=iPhone11

xcodebuild -workspace ios/example.xcworkspace -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -destination 'name=iPhone 11'
jksaunders commented 3 years ago

@xyclos Wow! That's all it took to fix this (and potentially the upgrade of detox to latest to support iOS 14). Thank you! I'll open a PR for this.