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

[SOLVED] 0.61.5 to 0.62.2 upgrade error: OpenSSL-Universal ENABLE_BITCODE #28824

Closed
ezranbayantemur opened this issue May 4, 2020 · 35 comments
Closed
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Resolution: Locked This issue was locked by the bot. Type: Upgrade Issue Issues reported from upgrade issue form

Comments

@ezranbayantemur
Copy link

ezranbayantemur commented May 4, 2020

After updating 0.61.5 to 0.62.2 with Upgrade Helper, ENABLE_BITCODE error drives me crazy. Looks like it happens because of switching to OpenSSL-Universal (1.0.2.19) from openssl-ios-bitcode. Not any problem while creating fresh project but it happens on upgrading to 0.62.2.

It happens only debug mode on real iOS device

Trying to run on debug mode it gives error message on below.
ld: '... project path .../ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(bio_lib.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
It tried pod cache clear openssl-ios-bitcode by #27565 (comment) but it couldn't find openssl-ios-bitcode pod.

Any idea about it?

Pods

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

def add_flipper_pods!(versions = {})
  versions['Flipper'] ||= '~> 0.33.1'
  versions['DoubleConversion'] ||= '1.1.7'
  versions['Flipper-Folly'] ||= '~> 2.1'
  versions['Flipper-Glog'] ||= '0.3.6'
  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
	  versions['Flipper-RSocket'] ||= '~> 1.0'
	
	  pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'
	
	  # List all transitive dependencies for FlipperKit pods
	  # to avoid them being linked in Release builds
	  pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
	  pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
	  pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
	  pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
	  pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
	  pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
	  pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
	  pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
	end
	
	# Post Install processing for Flipper
	def flipper_post_install(installer)
	  installer.pods_project.targets.each do |target|
	    if target.name == 'YogaKit'
	      target.build_configurations.each do |config|
	        config.build_settings['SWIFT_VERSION'] = '4.1'
	      end
	    end
	  end
	end

target 'dashboardMobile' do
  # Pods for dashboardMobile
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
  pod 'RNCharts', :path => '../node_modules/react-native-charts-wrapper'
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  
  
  use_native_modules!

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  add_flipper_pods!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'OneSignalNotificationServiceExtension' do
  pod 'OneSignal', '>= 2.9.3', '< 3.0'
end

Info

System:
    OS: macOS 10.15.4
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
    Memory: 896.27 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 13.11.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.13.7 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.8.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 23, 25, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-28 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5900203
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_222 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found

SOLVED

Changing bitcode settings "No" for Debug mode solved the problem.
Screen Shot 2020-05-05 at 00 41 28

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. and removed Needs: Triage 🔍 labels May 4, 2020
@github-actions
Copy link

github-actions bot commented May 4, 2020

⚠️ Missing Environment Information
ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

@ezranbayantemur
Copy link
Author

⚠️ Missing Environment Information
ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

Bad bot. I already share info!

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels May 4, 2020
@ezranbayantemur ezranbayantemur changed the title 0.61.5 to 0.62.2 upgrade error: OpenSSL-Universal ENABLE_BITCODE [SOLVED] 0.61.5 to 0.62.2 upgrade error: OpenSSL-Universal ENABLE_BITCODE May 4, 2020
@rickhanlonii
Copy link
Member

Just noting that the solution was added to the bottom of the description, thanks for tracking it down @ezranbayantemur!

@Benzer1406
Copy link

For changing the debug to No, triggered 14 other issues. Didn't solve my problem. I am stuck because I have this issue. Seems as if it's not ready for React Native 0.62.2

@ezranbayantemur
Copy link
Author

For changing the debug to No, triggered 14 other issues. Didn't solve my problem. I am stuck because I have this issue. Seems as if it's not ready for React Native 0.62.2

What kind of issues?

@unfrgivn
Copy link

unfrgivn commented May 18, 2020

Removing because I think I posted in wrong repo, moved comment to https://github.com/facebook/flipper/issues/485

@juliancorrea
Copy link

For changing the debug to No, triggered 14 other issues. Didn't solve my problem. I am stuck because I have this issue. Seems as if it's not ready for React Native 0.62.2

In my case, there was a OneSignal extension, so, you must change that config there too.

@philywu
Copy link

philywu commented Aug 18, 2020

For changing the debug to No, triggered 14 other issues. Didn't solve my problem. I am stuck because I have this issue. Seems as if it's not ready for React Native 0.62.2

Same issue to me. another 16 other issues comes when set the debug to No

@philywu
Copy link

philywu commented Aug 19, 2020

remove flipper works for me, although it's not a perfect solution....
facebook/flipper#1326

@zaptrem
Copy link

zaptrem commented Aug 28, 2020

Did this ever get fixed? I would prefer not to rip out flipper nor disable bitcode (isn't it a requirement for submitting to the App Store?)

@peltax
Copy link

peltax commented Sep 7, 2020

You can disable bitcode for debug build only, though this is not optimal solution.
Why was this closed?

@crutchcorn
Copy link

Definitely agree with others. I'd rather not remove flipper or disable bitcode. This issue should be re-opened

@fweffort
Copy link

Why is it closed?

@ezranbayantemur
Copy link
Author

I've found a solution for it but looks like it's works only for me. So I'm re-opening it for you guys.

@justinjoyn
Copy link

Running into this after I updated Xcode to v12.

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

On "react-native": "0.62.2"

@harinduliyanage
Copy link

@sunil-sadasivan
Copy link

I'm seeing the same linker error as @justinjoyn after upgrading xcode to 12.0.

On 0.63.1

@syrakozz
Copy link

removing flipper solve the problem,

@kot-ezhva
Copy link

Any solutions?
On "react-native" 0.63.2 same error (Xcode 12)
Disabling bitcode not resolved this problem, i get more errors (26) 😕

@ankur-1989
Copy link

Same error while upgrading from 0.62.2 to 0.63 on Xcode 11.7

@snamstorm
Copy link

Am also experiencing this error

Upgraded from RN 61.4 to 63.3 and also upgraded to xCode 12.0.1

ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(bio_lib.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@danielchan303
Copy link

danielchan303 commented Oct 8, 2020

use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
comment out these lines in Podfile, solve this error for me.

@hakkikonu
Copy link

hakkikonu commented Oct 11, 2020

comment out these lines

use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
end

then

pod install in your ios folder

then clean project
then build and run

@safaiyeh safaiyeh added the Type: Upgrade Issue Issues reported from upgrade issue form label Oct 14, 2020
@github-actions
Copy link

Do you need help upgrading to a newer React Native version? Visit the Upgrade Support repository or use the upgrade helper to see the changes that need to be made to upgrade your app.

@castalonirenz
Copy link

im experiencing this too. i already tried remove node_modules then npm install then pod install then build error still exist

@cyb3rsalih
Copy link

cyb3rsalih commented Oct 27, 2020

It occurs after upgrade the macOS Mojave to maOS Catalina. (xCode 11 to xCode 12) I move the whole project file and just try to build.
Got this error:

in /Users/myuser/Desktop/myproject/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/myuser/Desktop/myproject/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)
  • In debug mode it was OK.

I removed the pod.lock file and pod install
It update the OpenSSL package then I clean the build
and finally try to get release build...

And failed.

Please help!!

@thertzelle
Copy link

I'm also running into this issue today. The issue shouldn't be closed or marked SOLVED

@MhamedRamadan10
Copy link

The solution just downgrade OpenSSL version to 1.0.2.18 it will working fine
but when i try this **pod 'OpenSSL-Universal', '~>1.0.2.18'** i getting this error [!] Unknown command: OpenSSL-Universal,``

@mihaislobozeanu
Copy link

Hi guys,
You can find the solution here.

@gilador
Copy link

gilador commented Nov 11, 2020

this might be useful

@jedashford
Copy link

jedashford commented Nov 21, 2020

There are a few solutions you can try, but the problem is with the pod OpenSSL-Universal 1.0.2.19 in a dependency somewhere.

I'd suggest:

  1. Remove podfile.lock
  2. Remove Pods folder
  3. run pod install

Most likely the dependency has been update in the new pods pulled down from the above. (I think it might be flipper that updates that had the wrong dependency in the past which is why people fix it by disabling flipper)

You can also set the openssl dependency manually in the Podfile:
pod 'OpenSSL-Universal', '~>1.0.2.20'

Then run pod install again.

Either works, but the first suggestion, if works, lets the openssl dependency auto upgrade in the future.

Here is the full discussion at openssl land: krzyzanowskim/OpenSSL#65

@ahtisham09
Copy link

ahtisham09 commented Jan 21, 2021

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

Info

System:
OS: macOS 11.1
CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Memory: 233.55 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 8.17.0 - ~/.nvm/versions/node/v8.17.0/bin/node
Yarn: Not Found
npm: 6.13.4 - ~/.nvm/versions/node/v8.17.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /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: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7042882
Xcode: 12.3/12C33 - /usr/bin/xcodebuild
Languages:
Java: Not Found
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

I am facing this issue after updating Xcode 11 to Xcode 12

@Hektar90
Copy link

Hektar90 commented Feb 26, 2021

For me following works:

in the podfile add:

Bildschirmfoto 2021-02-26 um 15 41 36

In Xcode under build settings

Bildschirmfoto 2021-02-26 um 15 39 13

source: https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios

@CptFabulouso
Copy link

Since it seems Flipper related, updating Flipper (currently 0.79.1) and making changes to Podfile according to Flipper manual helped me - with those changes you can specify the correct Flipper version.
I am running on RN 0.62 and I didn't have to do anything else (except I also deleted Pods and Podfile.lock, but that might not be needed).

@mealCode
Copy link

The solution just downgrade OpenSSL version to 1.0.2.18 it will working fine
but when i try this **pod 'OpenSSL-Universal', '~>1.0.2.18'** i getting this error [!] Unknown command: OpenSSL-Universal,``

-->

in case anyone encounter this issue in the future, there were suggestion to delete Flipper or change version to use_flipper!({ 'Flipper-Folly' => '2.3.0' })

but in my case [!] CocoaPods could not find compatible versions for pod "Flipper-Folly":

what you can do instead is use the latest version as of writing use_flipper!({ 'Flipper-Folly' => '2.5' }) the error above with OpenSSL should work.

@facebook facebook locked as resolved and limited conversation to collaborators Oct 14, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Resolution: Locked This issue was locked by the bot. Type: Upgrade Issue Issues reported from upgrade issue form
Projects
None yet
Development

No branches or pull requests