Have you recently embarked on the journey of integrating Google Maps into your Flutter project, only to be halted by a perplexing Xcode error? If you've encountered the infamous "Building for 'iOS-simulator', but linking in object file" error, fear not! In this blog, we'll unravel the mystery behind this common hiccup in the integration of Google Maps for iOS in Flutter and provide you with a step-by-step guide to navigate through the solution.
Problem :
Error (Xcode): Building for 'iOS-simulator', but linking in object file
/Users/myName/src/project_name/ios/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/GoogleMaps
built for 'iOS'
Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)
Could not build the application for the simulator.
Error launching application on Nacpa's Simulator.
Solution :
Step 1: Open iOS Folder in Xcode
Navigate to your Flutter project directory and open the ios folder in Xcode. You can do this by running the following command in your terminal:
Step 2: Select Runner Target
In Xcode, locate the Runner project in the left sidebar and select the Runner target.
Step 3: Navigate to Build Settings
Inside the Runner target, navigate to the Build Settings tab.
Step 4: Locate Excluded Architectures
Scroll down to find the Excluded Architectures setting.
Step 5: Add arm64 for Any iOS Simulator SDK
Under Excluded Architectures, add arm64 for the Any iOS Simulator SDK. This ensures that the build process includes the necessary architecture for iOS simulator compatibility.
Step 6: Clean Build
After making this change, clean the build to ensure that the modifications take effect. You can do this by selecting Product in the top menu and then choosing Clean Build Folder. Alternatively, you can use the keyboard shortcut
Shift + Command + K.
Step 7: Run Your Flutter App
Now, you're ready to run your Flutter app again using:
flutter run
With these adjustments, your Google Maps integration should proceed without encountering the "Building for 'iOS-simulator'" error.
0 Comments