iOS build failed after upgrading to sdk 44(x86_64-apple-ios-simulator not found)

See original GitHub issue

Summary

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:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

19reactions
iKorucommented, Jan 6, 2022

I finally found the solution. When I added the following codes on Podfile, the error has gone and works charmingly.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
    end
  end
end
1reaction
fparhat-rbicommented, Jul 21, 2022

We are still hitting this even if you wipe out the /ios folder on every run

› Executing BurgerKingdev » Start Packager on http://localhost:8081

❌  (ios/Pods/Target Support Files/Pods-BurgerKingdev/ExpoModulesProvider.swift:8:8)

   6 |  */
   7 | 
>  8 | import ExpoModulesCore
     |        ^ could not find module 'ExpoModulesCore' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /Users/rbifp004/Library/Developer/Xcode/DerivedData/BurgerKingdev-dbklgwdlrkcoafdqskxieonwmlgs/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.swiftmodule
   9 | import ExpoAdapterBranch
  10 | import ExpoApplePay
  11 | import ExpoCapacitorStorage

› Compiling BurgerKingdev » noop-file.swift

❌  (ios/Pods/Target Support Files/Pods-BurgerKingdev/ExpoModulesProvider.swift:8:8)

   6 |  */
   7 | 
>  8 | import ExpoModulesCore
     |        ^ could not find module 'ExpoModulesCore' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /Users/rbifp004/Library/Developer/Xcode/DerivedData/BurgerKingdev-dbklgwdlrkcoafdqskxieonwmlgs/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.swiftmodule
   9 | import ExpoAdapterBranch
  10 | import ExpoApplePay
  11 | import ExpoCapacitorStorage

› Compiling BurgerKingdev » ExpoModulesProvider.swift

❌  (ios/Pods/Target Support Files/Pods-BurgerKingdev/ExpoModulesProvider.swift:8:8)

   6 |  */
   7 | 
>  8 | import ExpoModulesCore
     |        ^ could not find module 'ExpoModulesCore' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /Users/rbifp004/Library/Developer/Xcode/DerivedData/BurgerKingdev-dbklgwdlrkcoafdqskxieonwmlgs/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.swiftmodule
   9 | import ExpoAdapterBranch
  10 | import ExpoApplePay
  11 | import ExpoCapacitorStorage


❌  error: emit-module command failed with exit code 1 (use -v to see invocation)



› 4 error(s), and 0 warning(s)

Failed to build iOS project. "xcodebuild" exited with error code 65.

Did anyone achieve a solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo SDK 46 iOS build failed in fastlane step - Stack Overflow
The build fails At fastlane step. In Expo SDK 44, 45 everything was okay. But when I upgrade to SDK 46, I am...
Read more >
Error: Build input file cannot be found - Apple Developer
After I upgrade xcode to 12.0, now I got this error: error: Build input file cannot be found: '/Users/eee/Library/Developer/Xcode/DerivedData/Shark- ...
Read more >
Expo SDK 47. Today we're announcing the release of…
Hermes is now available in Expo Go for iOS, and Hermes inspector can now ... Create a new build of your development app...
Read more >
Error in building ReactNative videoSDK sample code (IOS ...
Description When I hit the commands 「yarn run ios」, 「yarn run android」, I get an error and cannot build.
Read more >
Firebase Apple SDK Release Notes - Google
Fixed the previous CocoaPods release incorrectly missing the ... When upgrading a project that includes one or more of these libraries, an error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found