iOS build failed after upgrading to sdk 44(x86_64-apple-ios-simulator not found)
See original GitHub issueSummary
I recently upgraded expo sdk to 44.0.4 (Thanks to @Kudo in #15749 ) And the previous error has gone lovely, however, different error occurred.
The error message is :
/Users/(userName, projectPath)/ios/Pods/Target Support Files/Pods-(projectName)/ExpoModulesProvider.swift:8:8: Could not find module 'ExpoModulesCore' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator, at: /Users/(userName)/Library/Developer/Xcode/DerivedData/(projectName)-fpsfqwuotwecxtbofsfpimvwsbrn/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule
I think that the library ExpoModulesCore is only for x86 (intel chip) environment. As might you think, I’m using M1 Mac. Is there any extra work to do if I run Expo 44.0.0 in M1? It works fine when 43.0.0. Thanks in advance.
Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
44.0.4
Environment
Expo CLI 5.0.3 environment info: System: OS: macOS 12.1 Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.1 - /usr/local/bin/node Yarn: 2.4.2 - /usr/local/bin/yarn npm: 8.1.2 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7935034 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild npmPackages: @expo/metro-config: ^0.3.0 => 0.3.0 babel-preset-expo: 9.0.1 => 9.0.1 expo: ^44.0.4 => 44.0.4 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-native-web: 0.17.1 => 0.17.1 npmGlobalPackages: expo-cli: 5.0.3 Expo Workflow: bare
Reproducible demo
my pod file is :
# require_relative '../node_modules/react-native/scripts/react_native_pods'
# require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
# require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")
$RNFirebaseAsStaticFramework = true
$RNFirebaseAnalyticsWithoutAdIdSupport=true
$FirebaseSDKVersion = '8.9.1'
platform :ios, '12.0'
pod 'Firebase/Analytics'
target '(projectName)' do
# use_unimodules!
use_expo_modules!
config = use_native_modules!
use_react_native!(:path => config[:reactNativePath], :hermes_enabled => false)
pod 'RNPhotoEditor', :path => '../node_modules/react-native-photo-editor/ios'
use_frameworks! :linkage => :static
pod 'iOSPhotoEditor', :git => '(custom repository)', :branch => 'master'
pod 'TZImagePickerController', :git => '(custom repository)', :branch => 'master'
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
# use_flipper!({ 'Flipper' => '0.74.0' })
post_install do |installer|
react_native_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name.include?('iOSPhotoEditor')
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '5'
end
end
if (target.name&.eql?('FBReactNativeSpec'))
target.build_phases.each do |build_phase|
if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
target.build_phases.move(build_phase, 0)
end
end
end
end
# flipper_post_install(installer)
end
# Follow [Flipper iOS Setup Guidelines](https://fbflipper.com/docs/getting-started/ios-native)
# This is required because iOSPhotoEditor is implemented using Swift and we have to use use_frameworks! in Podfile
$static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion',
'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Flipper-Fmt', 'Flipper-Boost-iOSX', 'Yoga', 'YogaKit',
'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native', 'EXPermissions','UMPermissionsInterface']
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library
end
end
if pod.name.start_with?('RNFB') || pod.name.start_with?('KakaoSDK')
def pod.build_type;
Pod::BuildType.static_library
end
end
if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
def pod.build_type;
# Uncomment the line corresponding to your CocoaPods version
Pod::BuildType.static_library # >= 1.9
# Pod::Target::BuildType.static_library # < 1.9
end
end
end
end
# use_flipper!
# post_install do |installer|
# flipper_post_install(installer)
# end
end
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:14 (2 by maintainers)
Top Related StackOverflow Question
I finally found the solution. When I added the following codes on Podfile, the error has gone and works charmingly.
We are still hitting this even if you wipe out the
/iosfolder on every runDid anyone achieve a solution?