krzyzanowskim / OpenSSL

OpenSSL package for SwiftPM, CocoaPod, and Carthage, multiplatform
https://swift.best
Other
922 stars 341 forks source link

building for iOS Simulator, but linking in object file built for iOS, file OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64 #103

Closed ghasemikasra39 closed 3 years ago

ghasemikasra39 commented 3 years ago

Running xcodebuild -workspace ios/detox.xcworkspace -scheme detox -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build will give this error:

ld: in /Users/kasra/Documents/detox/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/kasra/Documents/detox/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)

** BUILD FAILED **

The following build commands failed:
    Ld /Users/kasra/Documents/detox/ios/build/Build/Intermediates.noindex/detox.build/Debug-iphonesimulator/detox.build/Objects-normal/arm64/Binary/detox normal arm64
(1 failure)
detox[50261] ERROR: [cli.js] Error: Command failed: xcodebuild -workspace ios/detox.xcworkspace -scheme detox -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproducible example: https://gitlab.com/ghasemikasra39/detox

Environment

info Fetching system and libraries information...
System:
    OS: macOS 11.0.1
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 634.10 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.15.3 - ~/.nvm/versions/node/v14.15.3/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.9 - ~/.nvm/versions/node/v14.15.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6392135
    Xcode: 12.3/12C33 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_275 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.4 => 0.63.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Package.json:

{
  "name": "detox",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint .",
    "test:e2e": "detox test --configuration ios",
    "test:e2e:build": "detox build --configuration ios"
  },
  "dependencies": {
    "react": "16.13.1",
    "react-native": "0.63.4"
  },
  "devDependencies": {
    "@babel/core": "^7.12.10",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "detox": "^17.14.6",
    "eslint": "^7.16.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.64.0",
    "mocha": "^8.2.1",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native"
  }
}
krzyzanowskim commented 3 years ago

You must use outdated version, it's changed since v. 1.1.x builds

ghasemikasra39 commented 3 years ago

Dear @krzyzanowskim Detox is using OpenSSL-Universal (1.0.2.20), right ? You mean this version is outdated, correct ?

krzyzanowskim commented 3 years ago

yes, you need 1.1.x where this problem is addressed.

ghasemikasra39 commented 3 years ago

Dear @krzyzanowskim I noticed that OpenSSL-Universal is a dependency of Flipper and this package is always installed when creating any new React Native project.I tried to update OpenSSL-Universal via pod update OpenSSL-Universal, but it does not get updated. When I force the update, it regects because Flipper is dependent on 1.0.x. How can solve this issue ?

krzyzanowskim commented 3 years ago

You should reach to Flipper (or whichever project is appropriate) to update the dependency. That's how it works. You may try to add pod 'OpenSSL-Universal' , '~> 1.1.180' to your Podfile, but I'm not sure it it's will do the trick with overwriting dependency - check with Cocoapods if it's possible.