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
IOS Build Error: unsupported Swift architecture
and could not build module 'GoogleMapsUtils'
#4793
Comments
If you're using a M1, try on your xCode, go to Product -> Destination -> Destination Architectures -> Show Rosetta Destinations |
@LucasLFurini But this happens with the build in expo, when I run the command |
Same problem here. I'm getting this error when I try to build a dev-client with this command:
The development-simulator profile inside {
"cli": {
"version": ">= 0.34.0"
},
"build": {
"development-simulator": {
"developmentClient": true,
"distribution": "internal",
"ios": {
"simulator": true
}
},
"debug": {
"android": {
"buildType": "apk",
"image": "latest"
}
},
"production": {}
}
} Package versions: "react-native-maps": "1.7.1"
"expo": "^49.0.0"
"react-native": "0.72.3" |
Have the same without expo. "react-native-maps": "1.7.1"
P.S. My error was fixed after adding to Podfile before rn_maps_path
|
Also having build issues with RNM 1.7.1 and Expo 48. Looking into figuring out how to get the logs from xcode now. Moving RNM back to 1.3 fixed it but causes other issues with the default pins rendering. completely unhelpful:
|
Try this plugin, It may resolve. // react-native-maps-plugin.js
const fs = require("fs");
const path = require("path");
const { withDangerousMod } = require("expo/config-plugins");
const generateCode = require("@expo/config-plugins/build/utils/generateCode");
// https://github.com/react-native-maps/react-native-maps/issues/4793#issuecomment-1671269814
const googleMapsIosSiliconWorkaroundPodCode = `pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'`;
/** @type { import('expo/config-plugins').ConfigPlugin } */
const withPlugin = (expoConfig) => {
return withDangerousMod(expoConfig, [
"ios",
async (config) => {
const filePath = path.join(
config.modRequest.platformProjectRoot,
"Podfile"
);
const contents = fs.readFileSync(filePath, "utf-8");
const addCode = generateCode.mergeContents({
newSrc: googleMapsIosSiliconWorkaroundPodCode,
tag: "withGoogleMapsIOSWorkaroundPlugin",
anchor: /\s*get_default_flags\(\)/i,
src: contents,
comment: "#",
offset: 2,
});
if (!addCode.didMerge) {
console.warn(
"WARNING: Couldn't add custom plugin Podfile code from app.plugin.js to the project's ios/Podfile."
);
return config;
}
fs.writeFileSync(filePath, addCode.contents);
return config;
},
]);
};
module.exports = withPlugin; // app.json
"plugins": [
"./react-native-maps-plugin",
], As mentioned here : |
This works for me!, thanks @SohelIslamImran |
@ml242, there should be a link at the bottom of the build page to access the Xcode logs |
This worked for me too thanks @SohelIslamImran |
I got these errors: 325 |
[RUN_FASTLANE] 5 | //
Any idea? This is now the .js file I am using and get the following erorr
Now I get this: |
Thank you so much! Quick solution 🚀 |
Forcing a new version of // app.json
{
"plugins": [
[
"expo-build-properties",
{
"ios": {
"extraPods": [{ "name": "Google-Maps-iOS-Utils", "version": ">=4.2.0" }]
}
}
]
]
} |
One of my Team tell me to do this for M1 user and it works and config plugin for me also works
|
It works great) Thank you and your colleague. |
For folks who use expo sdk 50, it works without any expo plugin - you just need to use these versions:
|
i can confirm! |
Updated Workaround Adding on to @chanphiromsok's reply Was stuck on this for a few hours until I found this thread. This workaround is not specific to 💻 Machine: MacBook Pro M1
Steps
Hope this helps! 🍻 |
It helped me: npx react-native-clean-project npx expo-doctor npx expo install --fix npx expo prebuild --clean ran the command from package.json: "ios": "expo run:ios", |
not expo problem that because MacBook chip M1 building needs to use Rosetta architecture for building app |
Summary
When building the App with
"react-native": "0.72.3"
,"expo": "^49.0.3",
and"react-native-maps": "1.7.1",
, the IOS build getting fail with the following errors:Reproducible sample code
Steps to reproduce
Build the app
Expected result
Successful build
Actual result
Fail IOS build
React Native Maps Version
1.7.1
What platforms are you seeing the problem on?
iOS (Google Maps)
React Native Version
0.72.3
What version of Expo are you using?
SDK 49
Device(s)
null
Additional information
No response
The text was updated successfully, but these errors were encountered: