building for iOS Simulator, but linking in object file built for iOS
Asked Answered
O

5

21

Before I integrated Google Places in my app, I had no problem running it on simulators, but now I can run my app only on physical devices. I tried excluding arm64, like it was suggested in many answers, but no luck. Full error below:

building for iOS Simulator, but linking in object file built for iOS, file '/Users/davitmuradyan/Documents/DigiSoft/trip-share-ios/TripShare/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/GoogleMapsBase' for architecture arm64

Olds answered 14/11, 2021 at 11:31 Comment(1)
If you try to run the simulator on an M1 machine, you need to expect tools to assume that simulator = x86 and get confused unfortunately.Ziagos
C
44

This will do for now

  1. Find Xcode in your Applications folder.
  2. Select the app, and then press Command-I (or right-click/use the File menu and select Get Info.). This will open an Info window with details about the app.
  3. In the Info window, look for a checkbox labeled, “Open using Rosetta”. Check the box. here:
  4. Close the Info window.
  5. If you’re already running the app, quit and relaunch.
Callipash answered 16/11, 2021 at 8:26 Comment(0)
H
6

For M1 chips, "Open using Rosetta" might work.

But after updating to Sonoma 14.0 (15.0 for XCode), "Open using Rosetta" cannot be found in "Get Info" window.

Alternatively, try:
Xcode -> Product (in the menu bar) -> Destination -> Destination Architectures -> check 'Show Rosetta Destination'

After that, devices in the build list should be able to have '(Rosetta)' in the end , e.g. iPhone 15 (Rosetta)

And the project should be able to run on these Rosetta simulators.

Holman answered 19/10, 2023 at 3:15 Comment(2)
For Xcode 15, this is the only solution that worksIcehouse
I don't have a "Destination Architectures" option in Xcode 15.3. I had to click "Show All Run Destinations", then it showed an option to run each simulator using Rosetta.Bidding
B
5

Solution 1: go to build settings > excluded architectures , add arm64 to debug and release

Solution 2: go to Xcode preferences > locations and then delete the derived data file and clean the project and run

Solution 3:delete that framework

Solution 4:use the package installation instead of pod

Boonie answered 14/11, 2021 at 16:6 Comment(0)
O
2

x86_64 architecture is needed for running the project in the simulator.

arm64 architecture is needed for running the project on a Real device.

You can use the below command to to check whether the Google Place SDK contains x86_64:

lipo -info /Users/XXXXXXXXX/XXXXXXXXXXXX/GooglePlace.framework/GooglePlace

Drag and Drop the SDK File and check.

In case you were added the Google place SDK as static. Please use it through the Pod file.

Orpine answered 15/11, 2021 at 11:56 Comment(0)
V
-3

Be careful with excluding architecture - there can be case when it will break the app (best example RNBackgroundFetch - will not work with excluding arm64).

Launching using Rosetta is working perfectly (Applications -> RClick XCode -> Get info -> Check 'Using Rosetta'

Vanvanadate answered 6/2, 2023 at 13:56 Comment(1)
The first part of the answer should be a comment on the original question (it's not an answer itself), and the second part is a duplicate of the accepted answer but in a less clear (and less visual) way.Motorcade

© 2022 - 2024 — McMap. All rights reserved.