react-native-maps: IOS Build Error: `unsupported Swift architecture` and `could not build module 'GoogleMapsUtils'`
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:
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapHeatmapManager.m
❌ (/Users/expo/workingdir/build/ios/build/Build/Products/Debug-iphonesimulator/Google-Maps-iOS-Utils/GoogleMapsUtils.framework/Headers/GoogleMapsUtils-Swift.h:310:2)
308 |
309 | #else
> 310 | #error unsupported Swift architecture
| ^ unsupported Swift architecture
311 | #endif
312 |
❌ (node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapHeatmap.h:7:9)
5 | //
6 |
> 7 | #import "GMUHeatmapTileLayer.h"
| ^ could not build module 'GoogleMapsUtils'
8 |
9 | @interface AIRGoogleMapHeatmap : UIView
10 |
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapHeatmap.m
❌ (/Users/expo/workingdir/build/ios/build/Build/Products/Debug-iphonesimulator/Google-Maps-iOS-Utils/GoogleMapsUtils.framework/Headers/GoogleMapsUtils-Swift.h:310:2)
308 |
309 | #else
> 310 | #error unsupported Swift architecture
| ^ unsupported Swift architecture
311 | #endif
312 |
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapCircleManager.m
Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'TilleliDev' from project 'TilleliDev')
Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'TilleliDev' from project 'TilleliDev')
Run script build phase '[CP-User] [RNFB] Core Configuration' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'TilleliDev' from project 'TilleliDev')
Run script build phase '[CP-User] [RNFB] Crashlytics Configuration' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'TilleliDev' from project 'TilleliDev')
Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'fmt' from project 'Pods')
Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'ReactCommon' from project 'Pods')
Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-utils' from project 'Pods')
Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-runtimescheduler' from project 'Pods')
▸ ** BUILD FAILED **
▸ The following build commands failed:
▸ CompileC /Users/expo/workingdir/build/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-google-maps.build/Objects-normal/arm64/AIRGoogleMapHeatmapManager.o /Users/expo/workingdir/build/node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapHeatmapManager.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-google-maps' from project 'Pods')
▸ (1 failure)
2023-07-12 14:32:18.575 xcodebuild[5352:16454] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
** BUILD FAILED **
The following build commands failed:
CompileC /Users/expo/workingdir/build/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-google-maps.build/Objects-normal/arm64/AIRGoogleMapHeatmapManager.o /Users/expo/workingdir/build/node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapHeatmapManager.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-google-maps' from project 'Pods')
(1 failure)
Exit status: 65
+-------------+-------------------------+
| Build environment |
+-------------+-------------------------+
| xcode_path | /Applications/Xcode.app |
| gym_version | 2.213.0 |
| sdk | iPhoneOS16.4.sdk |
+-------------+-------------------------+
Reproducible sample code
import MapView from 'react-native-maps';
export default function App() {
return (
<MapView
style={{flex: 1}}
initialRegion={{
latitude: 42,
longitude: 30,
latitudeDelta: 1,
longitudeDelta: 1,
}}
/>
);
}
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
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 4
- Comments: 20
Try this plugin, It may resolve.
As mentioned here : https://github.com/react-native-maps/react-native-maps/pull/4757#issuecomment-1604959747 https://github.com/react-native-maps/react-native-maps/blob/master/docs/installation.md#enabling-google-maps
Same problem here.
I’m getting this error when I try to build a dev-client with this command:
npx eas build --profile development-simulator --platform iosThe development-simulator profile inside
eas.json:Package versions:
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
This worked for me too thanks @SohelIslamImran
For folks who use expo sdk 50, it works without any expo plugin - you just need to use these versions:
This works for me!, thanks @SohelIslamImran
@LucasLFurini But this happens with the build in expo, when I run the command
eas build --platform ioswe get this error, in these described versions. I can’t imagine how the simulator on mac could interfere.To select the version with Rosetta you need to click here:
There will be Iphone 14 Pro (Rosetta)
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
react-native-mapsthough. It should ideally be in theexpo’s repo.💻 Machine: MacBook Pro M1 🙅 XCode Version: 15.3 (since there is a slight difference in XCode UI) 🫛 Pod Version:
1.15.2📦 Package Versions:Steps
iosfolder’s xcworkspace in XCode by running the following, replacing<your_app_name>to whatever is populate in yourios folder. This step will open up XCode at the correct project directory.Get all the possible destinations to build to by following this from Menu Bar:
Product>Destination>Show All Run DestinationsNow, you should be able to see the iOS Simulators with (Rosetta) support. Select the simulator with Rosetta for your project.
Ensure the top of XCode shows that you are building your app for that specific simulator with (Rosetta), then click on the ▶️ button to build.
In your project, run
npm startfrom the project root (notiosfolder) to check your expo server is running of course.Hope this helps! 🍻
i can confirm! expo will update doctor to recommend 1.10.0 for SDK 50
@chanphiromsok
It works great) Thank you and your colleague.
One of my Team tell me to do this for M1 user and it works and config plugin for me also works
Thank you so much! Quick solution 🚀
@ml242, there should be a link at the bottom of the build page to access the Xcode logs
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: