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

ExpoModulesProvider.swift fails to find 'ExpoModulesCore' module for target 'x86_64-apple-ios-simulator' on macOS M1 #20

Closed
adblanc opened this issue Jul 9, 2023 · 3 comments

Comments

@adblanc
Copy link
Contributor

adblanc commented Jul 9, 2023

Hi,

When building the example app on my mac m1, I get the following error :


   6 |  */
   7 | 
>  8 | import ExpoModulesCore
     |        ^ could not find module 'ExpoModulesCore' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator

I need to manually remove "arm64" in the project excluded architectures done in setExcludedArchitectures by the plugin.

Steps to reproduce :

  • yarn ios in example app
@thejoaov
Copy link

Hi,

When building the example app on my mac m1, I get the following error :


   6 |  */
   7 | 
>  8 | import ExpoModulesCore
     |        ^ could not find module 'ExpoModulesCore' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator

I need to manually remove "arm64" in the project excluded architectures done in setExcludedArchitectures by the plugin.

Steps to reproduce :

  • yarn ios in example app

Hi @adblanc, you can use this patch i made with patch-package, and rebuild your app with expo prebuild

diff --git a/node_modules/@morrowdigital/watermelondb-expo-plugin/build/withWatermelon.js b/node_modules/@morrowdigital/watermelondb-expo-plugin/build/withWatermelon.js
index 4b6fbdc..5187275 100644
--- a/node_modules/@morrowdigital/watermelondb-expo-plugin/build/withWatermelon.js
+++ b/node_modules/@morrowdigital/watermelondb-expo-plugin/build/withWatermelon.js
@@ -98,7 +98,14 @@ const withCocoaPods = (config) => {
   pod 'WatermelonDB', :path => '../node_modules/@nozbe/watermelondb'
   pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi', :modular_headers => true
   pod 'simdjson', path: '../node_modules/@nozbe/simdjson', :modular_headers => true\n\n  `;
-                await fs.writeFile(filePath, slicedContent.join(patchKey));
+                const newContent = slicedContent.join(patchKey);
+                await fs.writeFile(filePath, newContent);
+                const postPatchKey = "target_installation_result.resource_bundle_targets.each do |resource_bundle_target|";
+                const postPatchSlicedContent = newContent.split(postPatchKey);
+                postPatchSlicedContent[0] += `target_installation_result.native_target.build_configurations.each do |config|
+          config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
+      end\n      `;
+                await fs.writeFile(filePath, postPatchSlicedContent.join(postPatchKey));
             }
             else {
                 throw new Error("Please make sure you have watermelondb installed");

@gokul1099
Copy link

removing amr64 in Excluded architecture(EXCLUDED_ARCHS) fixed the issue for me

@killerchip
Copy link
Contributor

Closing as it was dealt with in version 2.3.1
#33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants