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

No such module 'ExpoModulesCore' #17511

Closed
fondue-tech opened this issue May 14, 2022 · 57 comments
Closed

No such module 'ExpoModulesCore' #17511

fondue-tech opened this issue May 14, 2022 · 57 comments
Labels
incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues SDK 45

Comments

@fondue-tech
Copy link

Summary

I decided to use
https://docs.expo.dev/versions/latest/sdk/securestore/

I have installed expo modules with :
npx install-expo-modules@latest

Everything went well.
When trying to run IOS app I get multiple errors, one of those errors:

/ios/Pods/Target Support Files/Pods-VanBruggen/ExpoModulesProvider.swift:8:8: No such module 'ExpoModulesCore'

The app works well on android.
What I checked:

  • I tried to follow manual installation and check if all code has been applied properly and it did.
  • Reinistalling node modules
  • Removing Pods and Podfile.lock and reinstalling with pod install
  • Restarting laptop.

I have noticed that my IOS deployment target had to be changed to 12 from 11.

Any ideas? Thank you.

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)

No response

Environment

expo-env-info 1.0.3 environment info:
System:
OS: macOS 11.5.2
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.19.1 - ~/.nvm/versions/node/v14.19.1/bin/node
Yarn: 1.22.15 - /usr/local/bin/yarn
npm: 6.14.16 - ~/.nvm/versions/node/v14.19.1/bin/npm
Watchman: 2021.09.27.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7678000
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
npmPackages:
expo: ^45.0.0 => 45.0.4
react: 17.0.2 => 17.0.2
react-native: 0.68.1 => 0.68.1
Expo Workflow: bare

Reproducible demo

Not sure what I should provide.
This issue appeared after installing expo modules based on https://docs.expo.dev/bare/installing-expo-modules/#usage

@fondue-tech fondue-tech added the needs validation Issue needs to be validated label May 14, 2022
@briantanabe
Copy link

Dunno if this is a similar or unrelated issue, but I'm catching the same warning No such module 'ExpoModulesCore' in XCode; however, when I send it to the EAS build service, it simply says error: Build input file cannot be found: '/Users/expo/workingdir/build/ios/Pods/Target Support Files/Pods-PROJECTNAME/ExpoModulesProvider.swift... I'm not using SecureStore, but I did just try and migrate from a single app to app variants for development builds. Build log here: https://expo.dev/accounts/btanabe/projects/microcosmos/builds/5d030120-4b09-4704-aa92-19efa830d974

@byCedric
Copy link
Member

Hi @fondue-tech! A repro where this issue happens would be perfect for us, with that we can investigate what exactly is going on. Without it, I can ask you a few commands to run to see if that fixes it.

  • $ expo doctor --fix-dependencies
    → should fix possible incorrect dependency versions
  • $ yarn why expo-modules-core (or npm list expo-modules-core)
    → should list the missing dependencies
  • $ npx rimraf node_modules + $ yarn|npm install
    → recreate node_modules to fix possible corrupted folders
  • $ npx rimraf ios + $ expo prebuild -p ios
    → recreate the native /ios files, might solve some issues there too (make sure you committed everything to be able to revert the changes)

If you can share the output/result of these commands, that would help.

@samjusaitis
Copy link

samjusaitis commented May 17, 2022

I also am having this issue with an Expo SDK 44 project. I could compile with expo run:ios fine on an Intel Mac, but I was getting the No such module 'ExpoModulesCore' error when trying to compile on an M1 MacBook.

Tried all those steps you listed @byCedric, with no luck.

This workaround fixed it for me.

Oddly, I have a separate Expo SDK 44 project that compiles fine on the M1 MacBook without the workaround above 🤷🏻‍♂️

@byCedric byCedric added SDK 45 and removed needs validation Issue needs to be validated labels May 23, 2022
@tsapeta
Copy link
Member

tsapeta commented May 23, 2022

Hey @fondue-tech 👋 Looks like you're using Xcode 13.0 — could you check out if the same issue appears in the latest version 13.4?

@alexlukelevy
Copy link

I resolved this by following this SO post: https://stackoverflow.com/questions/72259985/expo-react-native-ios-build-failure-at-noop-file-swift

An old version of expo-modules-autolinking was being resolved by npm peer dependencies. I fixed it by manually adding the version I required to my dependencies "expo-modules-autolinking": "^0.8.1",.

@tsapeta
Copy link
Member

tsapeta commented May 26, 2022

Adding expo-modules-autolinking to project's dependencies is not recommended, it may cause even more dependency conflicts. This and expo-modules-core are intended to be delivered only by the expo package. Could you run yarn why expo-modules-autolinking to see what's installing the old version?

If you want to force using a specific version, I'd suggest using yarn resolutions instead.

@thedevdavid
Copy link

Hey @fondue-tech 👋 Looks like you're using Xcode 13.0 — could you check out if the same issue appears in the latest version 13.4?

Yes, it is.

@dev-sda1
Copy link

dev-sda1 commented Jun 18, 2022

Can confirm this issue is also seemingly present in the XCode 14.0 beta (M1 Pro)

image

@dev-sda1
Copy link

dev-sda1 commented Jun 21, 2022

New error i'm now getting along with the ExpoModulesCore not found error:

Could not find module 'ExpoModulesCore' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, at: /Users/james/Library/Developer/Xcode/DerivedData/Project-evnqhrglejjisufkxktwpnzwhrct/Index/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.swiftmodule

Screenshot 2022-06-21 at 20 38 55

Workarounds such as modifying podfile and changing release target have unfortunately not worked. Building this project on my x86 Hackintosh however runs without issues.

@dev-sda1
Copy link

dev-sda1 commented Jun 21, 2022

Providing another update - managed to get a successful build after forcing Xcode to run under Rosetta on my M1 Machine.
Note that when I did this, builds took significantly longer and certain features like the Simulator and running on Device seem a bit hit and miss (wouldn't work first time, restarting xcode fixed it for now.

Goto your Applications folder, right click your Xcode install and select "Get Info", then check "Open using Rosetta". Close and open your .xcworkspace file as usual and builds should succeed normally.

image

image

@briantanabe
Copy link

Just to leave my two cents on how I fixed my error, which seems different from @dev-sda1 but was similar to @fondue-tech when I first came across this issue. I started running into this problem when using build variants in bare.

I fixed it by going to "Build phases" and making sure the path to ExpoModulesProvider.swift was correct and unique (and actually verifying on my file system the file path was correct).

@brentvatne brentvatne added the incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues label Jun 28, 2022
@expo-bot
Copy link
Collaborator

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

Common concerns

"I've only been able to reproduce it in private, proprietary code"

You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.

"I didn't have time to create one"

That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.

"You can reproduce it by yourself by creating a project and following these steps"

This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.

@Soft-Gurus
Copy link

Soft-Gurus commented Sep 2, 2022

New error i'm now getting along with the ExpoModulesCore not found error:

Could not find module 'ExpoModulesCore' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, at: /Users/james/Library/Developer/Xcode/DerivedData/Project-evnqhrglejjisufkxktwpnzwhrct/Index/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.swiftmodule

Screenshot 2022-06-21 at 20 38 55

Workarounds such as modifying podfile and changing release target have unfortunately not worked. Building this project on my x86 Hackintosh however runs without issues.

Same issue here on M1 Mac Pro.
Expo 45.0.0
Bare worklow
XCode 13.4.1

This didn't work for me.
The only solution that worked was setting the Rosetta. But it was at the cost of performance. Is there any proper solution for this other than this workaround?

@tsapeta
Copy link
Member

tsapeta commented Sep 2, 2022

Hi @Soft-Gurus, can you try adding this to post_install hook in the podfile?

expo/ios/Podfile

Lines 65 to 66 in 65a981d

# Fix building failures on M1
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'

@BalogunofAfrica
Copy link

BalogunofAfrica commented Sep 2, 2022

@tsapeta I did this and I am getting:

[!] An error occurred while processing the post-install hook of the Podfile.

undefined method `build_settings' for {:reactNativePath=>"../node_modules/react-native"}:Hash

@tsapeta
Copy link
Member

tsapeta commented Sep 2, 2022

It needs to be added in the appropriate place in post_install hook, like here

post_install do |installer|
  installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
    target_installation_result.native_target.build_configurations.each do |config|
      # Fix building failures on M1
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
    end
  end
end

@BalogunofAfrica
Copy link

@tsapeta Corrected it, still getting the error:

error: no such module 'ExpoModulesCore'

@Soft-Gurus
Copy link

Soft-Gurus commented Sep 4, 2022

>     target_installation_result.native_target.build_configurations.each do |config|
>       # Fix building failures on M1
>       config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
>     end
>   end

This is my podfile after doing your fixes

post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
      target_installation_result.native_target.build_configurations.each do |config|
        # Fix building failures on M1
        config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
      end
    end
  end

  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end

And I got these two errors

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'EXUpdates' from project 'Pods')
    export DEVELOPER_DIR\=/Applications/Xcode.app/Contents/Developer
    export SDKROOT\=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name EXUpdates -Onone -whole-module-optimization -enforce-exclusivity\=checked @/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/Objects-normal/x86_64/EXUpdates.SwiftFileList -DDEBUG -D COCOAPODS -Xcc -fmodule-map-file\=/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Products/Debug-iphonesimulator/ASN1Decoder/ASN1Decoder.modulemap -Xcc -fmodule-map-file\=/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Products/Debug-iphonesimulator/EASClient/EASClient.modulemap -Xcc -fmodule-map-file\=/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.modulemap -Xcc -fmodule-map-file\=/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/EXManifests/EXManifests.modulemap -Xcc -fmodule-map-file\=/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/EXStructuredHeaders/EXStructuredHeaders.modulemap -Xcc -fmodule-map-file\=/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/EXUpdatesInterface/EXUpdatesInterface.modulemap -Xcc -fmodule-map-file\=/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/React-Core/React/React-Core.modulemap -Xcc -fmodule-map-file\=/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap -Xcc -fmodule-map-file\=/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/yoga/Yoga.modulemap -import-underlying-module -Xcc -fmodule-map-file\=/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/EXUpdates/EXUpdates.modulemap -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk -target x86_64-apple-ios12.0-simulator -g -module-cache-path /Users/shajeeh/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -enable-testing -index-store-path /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Index/DataStore -swift-version 5 -I /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Products/Debug-iphonesimulator/EXUpdates -I /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Products/Debug-iphonesimulator/ASN1Decoder -I /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Products/Debug-iphonesimulator/EASClient -I /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Products/Debug-iphonesimulator/ExpoModulesCore -F /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Products/Debug-iphonesimulator/EXUpdates -c -num-threads 10 -output-file-map /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/Objects-normal/x86_64/EXUpdates-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/Objects-normal/x86_64/EXUpdates.swiftmodule -Xcc -I/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/EXUpdates-generated-files.hmap -Xcc -I/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/EXUpdates-own-target-headers.hmap -Xcc -I/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/EXUpdates-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/EXUpdates-project-headers.hmap -Xcc -I/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Products/Debug-iphonesimulator/EXUpdates/include -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Private -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Private/EXUpdates -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/DoubleConversion -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/ExpoModulesCore -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/RCT-Folly -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/React-Core -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/React-callinvoker -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/React-cxxreact -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/React-jsi -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/React-jsinspector -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/React-logger -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/React-perflogger -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/React-runtimeexecutor -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/ReactCommon -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/Yoga -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/fmt -Xcc -I/Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods/Headers/Public/glog -Xcc -I/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/DerivedSources-normal/x86_64 -Xcc -I/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/DerivedSources/x86_64 -Xcc -I/Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG\=1 -Xcc -DDEBUG\=1 -Xcc -DCOCOAPODS\=1 -emit-objc-header -emit-objc-header-path /Users/shajeeh/Library/Developer/Xcode/DerivedData/MattoConsumer-bisxlkjluxegiodbirgrddduaidw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXUpdates.build/Objects-normal/x86_64/EXUpdates-Swift.h -working-directory /Users/shajeeh/upwork/lubo/Matto-Consumer/ios/Pods

remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
Command CompileSwiftSources failed with a nonzero exit code

And the second error was in a new target (created for showing images in push notification)

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_FIRMessaging", referenced from:
      objc-class-ref in NotificationService.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@Soft-Gurus
Copy link

Also, I just realised that I have this code snippet in my podfile.

__apply_Xcode_12_5_M1_post_install_workaround(installer)

I have now shifted to xCode 13, I wonder If I still need this

@dev-sda1
Copy link

dev-sda1 commented Sep 4, 2022

Also, I just realised that I have this code snippet in my podfile.

__apply_Xcode_12_5_M1_post_install_workaround(installer)

I have now shifted to xCode 13, I wonder If I still need this

Unfortunately commenting this snippet out didn't change anything for me (Also on XCode 14 Beta). However I can 99% of the time get it to build on my physical device by opening the .xcworkspace file in xcode

@dev-sda1
Copy link

Issue seems to have reappeared with the Stable build of XCode 14 Released yesterday

@stepek
Copy link

stepek commented Sep 22, 2022

have the same issue on XCode 14 and m1 ;/

@BalogunofAfrica
Copy link

BalogunofAfrica commented Sep 22, 2022

@tsapeta Corrected it, still getting the error:

error: no such module 'ExpoModulesCore'

I was able to fix for my use case, hope this would help anyone else in a similar situation:

I had three build schemes for different environments and build settings. This error was occurring in two of those schemes, but not in the third.

Since the two schemes shared similar settings with the third, I reset both of them using the third as template and applied the additional settings that existed on them. This fixed the error for my use case.

Some weird observations I have noticed trying to debug the issue:

  • This error is usually caused by changes to project.pbxproj
  • If you set project.pbxproj to it's last state before you encountered this error (regardless of new pod packages), you wouldn't get the error again
  • Not sure why this happens

@papidb
Copy link

papidb commented Oct 24, 2022

Hi, is there any progress on this issue? @BalogunofAfrica

@jmoseley
Copy link

I am also experiencing this, would love to hear if there is any progress.

@Danny7fold
Copy link

did you guys find any solution for xcode 13.4.1

@avsdoffice
Copy link

It needs to be added in the appropriate place in post_install hook, like here

post_install do |installer|
  installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
    target_installation_result.native_target.build_configurations.each do |config|
      # Fix building failures on M1
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
    end
  end
end

Can confirm this fixed the issue for me - Mac Studio w/M1 Max CPU + Xcode 14.2

@PaitoAnderson
Copy link

I had this issue with M1 + Xcode 14.2, and after trying all solutions what worked for me was just building with Xcode directly instead of CLI.

@t0ma5h
Copy link

t0ma5h commented Jan 19, 2023

I had this issue with M1 + Xcode 14.2, and after trying all solutions what worked for me was just building with Xcode directly instead of CLI.

Had the same issue as well, but running through Xcode directly didn't help. Removing EXCLUDED_ARCHS from project.pbxproj did though, then just built it through Xcode as well. Weird stuff. Also this thread helped : facebook/react-native#32704

@tobobo
Copy link

tobobo commented Jan 30, 2023

@tsapeta Corrected it, still getting the error:

error: no such module 'ExpoModulesCore'

I was able to fix for my use case, hope this would help anyone else in a similar situation:

I had three build schemes for different environments and build settings. This error was occurring in two of those schemes, but not in the third.

Since the two schemes shared similar settings with the third, I reset both of them using the third as template and applied the additional settings that existed on them. This fixed the error for my use case.

Some weird observations I have noticed trying to debug the issue:

  • This error is usually caused by changes to project.pbxproj
  • If you set project.pbxproj to it's last state before you encountered this error (regardless of new pod packages), you wouldn't get the error again
  • Not sure why this happens

I was also getting this error after adding additional build schemes to my bare expo project. Turns out I had missed the step of the instructions where I was modifying the target block in my Podfile. Now it works. https://docs.expo.dev/build-reference/variants/#ios

@come25136
Copy link

come25136 commented Mar 2, 2023

MacBook Air M2 2022
macOS: 13.0.1 (22A400)
Xcode: 14.1 (14B47b) (Universal)
Expo: 48.0.4

After creating the project, expo install @rnmapbox/maps, i removed arm64 from Excluded Architectures in Xcode and expo run:ios succeeds!
(@rnmapbox/maps is what I put in for my use. There is no direct relationship.)

If it helps anyone :)

facebook/react-native#32704 (comment)

@jaimebiernaski
Copy link

Thanks @come25136, removing the arm64 from Excluded Architecture worked like a charm!

@pohsiu
Copy link

pohsiu commented Mar 18, 2023

Same issues

xcode 14.2 with m1 chip

-> none of these solution works for me

@rafakwolf
Copy link

same as @pohsiu ... xcode 14.2 -- M2 processor

@rafakwolf
Copy link

@pohsiu I managed to make it work, not sure whether it`ll solve for everyone, but I just removed expo-updates ... and everything start working after that.

@pohsiu
Copy link

pohsiu commented Mar 28, 2023

@rafakwolf, thx ! I will take a shot

@pohsiu
Copy link

pohsiu commented Mar 29, 2023

Hi @rafakwolf , would you mind to share what exactly expo-updates you remove?, I didn't see anything related to that

@rafakwolf
Copy link

@pohsiu I was using the package expo-updates, so maybe you're not using it.
Also I realized yesterday that after installing other expo packages like expo-auth-session, expo-webbrowser, expo-random ... the problem came back :|
I'm gonna attempt to reproduce the issue in a small example app, honestly, I think this issue should be reopened.

@pohsiu
Copy link

pohsiu commented Mar 29, 2023

I see, I agree with you, I didn't use any of it above you have mentioned

Here is my deps

  "dependencies": {
    "@expo-google-fonts/exo": "^0.2.3",
    "@expo/vector-icons": "^13.0.0",
    "@gorhom/bottom-sheet": "^4",
    "@react-native-async-storage/async-storage": "1.17.11",
    "@react-native-firebase/app": "^17.3.2",
    "@react-native-firebase/auth": "^17.3.2",
    "@react-native-firebase/database": "^17.3.2",
    "@react-native-google-signin/google-signin": "^9.0.2",
    "@react-native-masked-view/masked-view": "0.2.8",
    "@react-navigation/bottom-tabs": "^6.5.7",
    "@react-navigation/native": "^6.1.6",
    "@react-navigation/native-stack": "^6.9.12",
    "@rneui/base": "^4.0.0-rc.7",
    "@rneui/themed": "^4.0.0-rc.7",
    "@tanstack/react-query": "^4.28.0",
    "abort-controller": "^3.0.0",
    "axios": "^1.3.4",
    "dayjs": "^1.11.7",
    "expo": "~48.0.9",
    "expo-build-properties": "~0.5.1",
    "expo-constants": "~14.2.1",
    "expo-dev-client": "~2.1.5",
    "expo-font": "~11.1.1",
    "expo-linear-gradient": "~12.1.2",
    "expo-linking": "~4.0.1",
    "expo-location": "^15.1.1",
    "expo-router": "^1.2.2",
    "expo-splash-screen": "~0.18.1",
    "expo-status-bar": "~1.4.4",
    "jotai": "^2.0.3",
    "react": "18.2.0",
    "react-native": "0.71.4",
    "react-native-date-picker": "^4.2.9",
    "react-native-geocoding": "^0.5.0",
    "react-native-gesture-handler": "~2.9.0",
    "react-native-google-places-autocomplete": "^2.5.1",
    "react-native-maps": "^1.4.0",
    "react-native-reanimated": "~2.14.4",
    "react-native-redash": "^18.1.0",
    "react-native-safe-area-context": "4.5.0",
    "react-native-screens": "3.18.0",
    "react-native-share": "^8.2.1",
    "react-native-svg": "^13.8.0",
    "react-native-view-shot": "3.5.0"
  },

@rafakwolf
Copy link

@pohsiu I'm going to try that ...
I'll create a brand new expo project, run npx expo prebuild then install those packages and compare the diference between my project and the new one, any other ideas? :D

@DavidAPears
Copy link

Same issue here on M1 Mac Pro 🥲

Expo 48.0.0
Bare worklow
XCode Version 14.2

It's a doozy this one huh?

@MohammadKurjieh
Copy link

I was facing the same error on mac m1. I was able to resolve it by updating the SUPPORTED_PLATFORMS to include the simulator.
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";

It also worked without adding anything to the EXCLUDED_ARCHS.

@The-Lone-Druid
Copy link

I guess this issue isn't resolved, I'm getting the same error though.

@AndrewTotsky
Copy link

AndrewTotsky commented Jun 28, 2023

M1 Mac mini
Xcode Version 14.3 (14E222b)

Works for me:
Product-> Destination -> Destination Architectures -> Show Rosetta Destinations

@Red3nzo
Copy link

Red3nzo commented Jun 28, 2023

Getting same issue, really disappointing to see this issue still occurring for silicon based macs

@sravis02
Copy link

same issue for me

@phamhieu1412
Copy link

same issue

"expo": "^47.0.0",
"expo-local-authentication": "~13.0.2",
"expo-modules-core": "^1.2.6",
"install-expo-modules": "^0.5.1",
"react": "18.1.0",
"react-native": "0.70.5",

i archive via xcode is done, but when i use terminal "xcodebuild -project ..." has error "error: no such module 'ExpoModulesCore' "
when i install expo into RN i used -> npx install-expo-modules@latest
tkss

@JacobDel
Copy link

can the issue be reopened please ..

@majirosstefan
Copy link

majirosstefan commented Aug 18, 2023

I created project from Expo, than ejected.

"react-native": "0.68.2",
"expo": "~45.0.0",

I am using XCode version 14.2 on M1 Pro Mac with Nodejs 16. I did not need to modify EXCLUDED_ARCHS build setting.

In the Podfile I needed to disable

# __apply_Xcode_12_5_M1_post_install_workaround(installer).

and the build is working now (the only change I think was that commenting that one line in Podfile).

@tyrauber
Copy link

This issue, no such module 'ExpoModulesCore', popped up for me with Xcode v14.3.1, Expo SDK 49.0.6, and the expo-dev-client, when trying to build for the iOS simulator with $ expo run:ios -d. [Running expo prebuild and opening the workspace in Xcode and remove Excluded Architecture (somehow arm64 was selected) as shown here resolved the issue for me.

@flexbox
Copy link
Contributor

flexbox commented Nov 13, 2023

I landed on this because of a similar issue.
Here is how I made it work.

  • Xcode version 15.0.1 (15A507)
  • Expo SDK 49
  1. Wipe everything related to iOS and make sure there is no build artifacts cache.
npx react-native-clean-project
  1. Fix expected package versions
npx expo-doctor
npx expo install --fix
  1. Clean native dependencies
npx expo prebuild --clean
  1. Open Xcode, and hit the play button ▶️ (always use .xcworkspace with cocoapods)
open ios/YOURPORJECTNAME.xcworkspace

✅ Build Succeeded

@lukasbals
Copy link

Thanks @flexbox. For me, it was also required to select a Rosetta version of the simulator by selecting "Product" > "Destinations" > "Destination Architectures" > "Show Rosetta Destinations" in XCode before building.

@jirehnimes
Copy link

jirehnimes commented Mar 10, 2024

Issue persists on my end.

  • Expo SDK 49
  • Node 20.9
  • Xcode 15
  • Intel i5
  • macOS Sonoma 14.3.1

npm run ios - working
Xcode build and archive - working
xcodebuild - failed

I need to make it working using xcodebuild also for CICD.

Error when using xcodebuild command:

The following build commands failed:
	SwiftCompile normal arm64 Compiling\ ExpoModulesProvider.swift /Users/<user>/Dev/<projectname>/ios/Pods/Target\ Support\ Files/Pods-<projectname>/ExpoModulesProvider.swift (in target '<projectname>' from project '<projectname>')
	SwiftCompile normal arm64 /Users/<user>/Dev/<projectname>/ios/Pods/Target\ Support\ Files/Pods-<projectname>/ExpoModulesProvider.swift (in target '<projectname>' from project '<projectname>')
	SwiftCompile normal arm64 Compiling\ noop-file.swift /Users/<user>/Dev/<projectname>/ios/<projectname>/noop-file.swift (in target '<projectname>' from project '<projectname>')
	SwiftCompile normal arm64 /Users/<user>/Dev/<projectname>/ios/<projectname>/noop-file.swift (in target '<projectname>' from project '<projectname>')

@jirehnimes
Copy link

jirehnimes commented Mar 10, 2024

I landed on this because of a similar issue. Here is how I made it work.

  • Xcode version 15.0.1 (15A507)
  • Expo SDK 49
  1. Wipe everything related to iOS and make sure there is no build artifacts cache.
npx react-native-clean-project
  1. Fix expected package versions
npx expo-doctor
npx expo install --fix
  1. Clean native dependencies
npx expo prebuild --clean
  1. Open Xcode, and hit the play button ▶️ (always use .xcworkspace with cocoapods)
open ios/YOURPORJECTNAME.xcworkspace

✅ Build Succeeded

@flexbox Have you tried this using xcodebuild command?

@Chimpaya
Copy link

A year ago, when upgrading to expo SDK 48, I had this exact issue and fixed it by applying this fix here

post_install do |installer|
// other steps
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end

Now I'm upgrading from 48 to 50 and the issue return. Ended up removing that code from the podfile and it works. Hope this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues SDK 45
Projects
None yet
Development

No branches or pull requests