google-maps-ios-utils: GoogleMaps don't compile at Macbook with M1 chip
ld: building for iOS Simulator, but linking in object file built for iOS, file '[...]/Pods/GooglePlaces/Frameworks/GooglePlaces.framework/GooglePlaces' for architecture arm64
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 82
- Comments: 143 (11 by maintainers)
We’ll be able to share an update on this soon.
Please, for the love of god, is there any update to this? It shouldn’t take half a year to support arm64 arch.
Hey y’all, following up on my previous update. I’ve synced up with our teams handling arm64-sim arch support for generating frameworks within Google and this feature should land in the coming weeks. Once available, we will be unblocked and can resolve this issue for everyone. I anticipate this happening sometime late-Q3/early-Q4.
Hi folks, the 6.0 version of the Maps SDK shipped with an XCFramework that contains the binaries to be able to run on an M1 simulator. Note that this is currently labeled as beta but should unblock everyone here that is on an M1 machine. See this post for more info: https://cloud.google.com/blog/products/maps-platform/announcing-version-60-maps-and-places-sdks-ios
The Maps SDK for iOS does not yet contain the architecture necessary to run on the new Arm-based Mac Simulators—we are currently working on supporting this. For now, if you are using the new Arm-based Macs, you will need to develop using a physical device. This has been noted in our FAQ.
Hey @arriolac , thanks for the update. Don’t want to rush you but it’s been 13 days since your answer. Could you provide an ETA ? I’m waiting so much for this …
Thanks,
all M1 mackbooks has this issue and no fix yet? oh come on
Still not fixed Google!
Interesting what Google calls “very high priority” 🙄
Running Xcode under Rossetta fixed the issue as a temporary workaround
** This will cause a decrease in speed and performance in Xcode and simulator
@arriolac any ETA on this? Looks like it was assigned and given a P1 status quite some time ago. There’s a lot of devs with M1 machines now, including my entire team who are forced to run our project with Rosetta because this last SDK that needs updating.
I recognize that this is important to everyone on the new M1 macs, and I’ve voiced this several times and surfaced everyones feedback here to our engineering teams to add support for this. The internal tool we use for assembling a framework (which is quite different from Apple’s out-of-the box setup, so adding arm64 support is not so straightforward as it seems) is supposed to have support for generating arm64-sim archs soon which will unblock us from this work. So, progress is being made on this effort and I’ll keep you all updated.
but you have to go with two more setting.
Im having this issue as well. Any update on this? Seems to be the only blocker for getting our app running on silicon
Apologies—my original estimate of this being completed by now seemed to be a bit off. Progress is being made on this effort since our team is unblocked by the issue I previously mentioned. Unfortunately I cannot share a new timeline. We appreciate your patience.
If your error is related to your framework can not be built with arm64 then you go with that solution. I have added x86_64 framework in. Build Setting-> Add Debug Architecture -> Any iOS Simulator SDK
Above solution work for me. Closed the issue:) Good Luck Everyone!
Adding another vote to advocate for a fix to this issue. We are currently blocked from developing on M1 chipsets due to this issue.
Camon Google, you can do it!
I just got an M1 machine and I could make it work by opening Xcode using Rosetta. It works against an iOS 14.4 simulator and Google Maps appear on the app correctly. (Just posting it here, it wasn’t clear this was the workaround for now when reading other comments).
@arriolac Thanks for this update, do you have any more details on when this could be available?
Thanks!
I subscribe to the above. My project doesn’t compile on the M1 Macs because GoogleMaps is the only dependency left that hasn’t adopted the new xcframework with support for arm64 for simulator. When can we expect a working GoogleMaps release for the M1 Macs ?
I solve problem by adding “arm64” in “Excluded Architectures” for both project target and pod target.
Xcode -> Target Project -> Build Setting -> Excluded Architectures > “arm64”
Xcode -> Pod Target -> Build Setting -> Excluded Architectures > “arm64”
I have a simplest solution, just create a iOS 13.7 emulator on Xcode, runs fine. Without ROSETTA.
How was this closed? It is definitely not working on my M1 Pro on simulator, seems there’s a difference between arm64 for phone and for simulator?
building for iOS Simulator, but linking in object file built for iOS, file ‘…/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/GoogleMapsBase’ for architecture arm64
Using the latest versions: Installing GoogleMaps 6.0.1 (was 4.2.0) Installing GooglePlaces 6.0.0 (was 4.2.0)
.xcframework
crashes on an internal method when trying to show street view:If anyone is interested on SPM support https://github.com/vfn/GoogleMaps-SP/releases/tag/5.0.0-M1
That’s a fork I created from https://github.com/YAtechnologies/GoogleMaps-SP, and added support for simulator
arm64
.I had tried this solution from codegrepper.com and its work
I confirm the issue is resolved on 6.0.1.
That does not really solve the issue, I think it forces the compiler to use the x86_64 lib for simulator instead of using the proper arm64-sim lib (that is not present at the moment). So it compiles, yes, but it goes through Rosetta in the end.
I was helping @mikina set up a project depending on Google Maps today and ran
vtool
without issues on all Google Maps SDK 3.1.0 and 4.2.0 constituent frameworks. After wrapping up individual frameworks in XCFrameworks, Xcode had no issues producing a functional Simulator build that depends on the Google Maps SDK.I used the following vtool invocation:
vtool -arch arm64 -set-build-version 7 13.0 13.0 -replace -output $OBJECT_FILE_PATH $OBJECT_FILE_PATH
And here’s a screenshot of running Google Maps SDK:
This totally worked for me, iPhone Simulator 12 Pro Max! Make sure you clean the build folder before you run the build.
Google Maps is very much needed here too 😃 Sending to Google dev team a big energy beam to make M1 support a reality.
NOTE: If you can give a precise roadmap or at least a M1 support release date, please do so, that would be very helpful!
Thanks again for the hard work
Rebuilded GoogleMaps 5.0.0 and wrapped it in xcframework:
I removed the Google SDK from my app and replaced it with a few HTTP calls, the old-fashioned way… Works great. Runs on M1 with no problems and improved app performance on the iphone as well!
I found a similar solution for a third-party framework that we had on our app, by using the following Bogo’s guide and by manually creating an XCFramework instead of using
xcodebuild
.I don’t know if it works for your framework because our third-party framework only supported iOS, but this is the guide:
Let’s start with what we had:
i386
andx86_64
architectures) - Inside aniOS
folderarmv7
andarm64
architectures) - Inside aSim
folderSo, by following the guide, we should change the Mach-O header to let it run on the
arm64
for Simulator. If we try to just change it on thearm64
for iOS, while building the XCFramework by usingxcodebuild
we will get thebinaries with multiple platforms are not supported
. An XCFramework is just a folder with inside a couple of folders (one for Simulator and one for iOS) and itsplist
.The first step is removing the
armv7
architecture inside the iOS executable. We can do the following by usinglipo
:lipo -remove armv7 iOS/SDK.framework/SDK -output SDK
Next, convert the remainingarm64
architecture fromLC_VERSION_MIN_IPHONEOS
toIOSSIMULATOR
:Delete the old
SDK
executable and replace it with theSDK.reworked
one.Now that we have the Simulator
arm64
architecture, we should merge it with the other Simulator ones:i386
andx86_64
:lipo -create iOS/SDK.framework/SDK Sim/SDK.framework/SDK -output SDK
Replace theSim/SDK.framework/SDK
with the newly fat one. Delete theiOS/SDK.framework/SDK
without thearmv7
architecture and get back the original one.The final step is to manually create the XCFramework:
SDK.xcframework
ios-arm64_armv7
andios-arm64_i386_x86_64-simulator
iOS
folder into theios-arm64_armv7
folder and the framework inside theSim
folder into theios-arm64_i386_x86_64-simulator
Info.plist
file:touch Info.plist
Info.plist
file:Now you can use this XCFramework on both an iOS device and a Simulator on a Mac ARM 🎉
I’m using a local podspec like this:
Using this gist: https://gist.github.com/oblador/7cbd4d24b6792e0e8e55d5ef924bc1ef
You are not getting the point here. Sure, if you excluding architecture, using Rosetta, or solutions similar to these, it will definitely works, but not a long-term solution.
Not sure if you notice, apps that build with these ways will have some touch sensitivity issues on simulator.
Hello Google! Our team has to heavily rely on simulator usage, hence this is a major problem for us (we also ordered several macMinis with M1). We would be happy to see this problem resolved in the near future!
This is because the iOS 13.7 simulator itself is running under Rosetta, so your Apple Silicon Xcode cross-compiles and links an x86 build. Definitely a neat trick if you are in a pinch and your app is not using iOS 14 features!
I appreciate that, but even if you just had an alpha branch that would compile (and just wasn’t a full release), that would at least get our CI MacMini machine unblocked.
Hello, I tried running the new SDK version 6.0.1, but I still get the error building for iOS Simulator, but linking in object file built for iOS, file ‘/Path/Pods/GooglePlaces/Frameworks/GooglePlaces.framework/GooglePlaces’ for architecture arm64
I am using Xcode 13.2.1, iOS 13.6 and M1 MacBook
Am I doing anything wrong?
FYI, it also doesn’t work on Intel MacBooks when using expo since the default behavior of their EAS builds is to build on all possible architectures (including ARM 64). So, a quick update on this one would be much appreciated 😃
This is not a solution to the problem. Yes, in this way you can decide to run on your personal mac, but for example, we have a ci / cd mac server with an m1 processor and this solution increases the build time
honestly running it native won’t make swiftUI previews much more bearable. A slow building project will always make the previews painful.
After writing this guide I tried with the GoogleMaps framework, but it is composed of 3 frameworks:
The first one works by using the above method, for the other two don’t work because they have negative available space. I’m looking at how to add some empty space…
Hey everyone, unfortunately I can’t share any timelines on when this issue will be addressed since there are a lot of moving parts to supporting an .xcframework that contains the new arm simulator architecture. This is a very high priority for us though. The only workaround at the moment is to develop on a physical device if you are using one of the new Macbooks.
Here it is: https://developers.google.com/maps/documentation/ios-sdk/config But to save you from another disappointment, it doesn’t work well. I was able to compile it and run it under M1 without Rosetta, but the actual performance of google map in the simulator was utter garbage, like 1 frame per second. When I tried to switch it to metal renderer, it crashed immediately after launch. After all, this approach is marked as beta. Use Rosetta and be happy while it’s available. Sooner or later Apple will ditch it.
I did the following: Deleted
Pods
folder andPodfile.lock
flutter pub get
pod install
flutter run
Maybe you need to check that the rest of the toolchain is arm64 like Cocoapods, RubyGems etc. Not sure how all this works … but if you are fine running on Rosetta 👍
I tried: pod deintegrate pod cache clean --all pod install Cleared my build folder and rebuilt.
No luck with non-rosetta. But I’m content with running in Rosetta. I’m just pumped to be able to use the simulator again.
I run from a native terminal (not rosetta). Did you install the pods from scratch? I tried it now and it worked, i just had to do a manual
pod install
inside theios
folder.I’m able to run to run GoogleMaps on my M1 on a simulator. Did you try to remove and re-install the CocoaPods the arm64? Maybe this answer might help.
Solving this means being able to build on M1 without Rosetta. Apparently the archive 6.0.1-beta supports M1 but
beta
means not ready for production.Opening XCode using Rosetta seems to resolve it for me - for now.
@codeisjoy that issue should be addressed in version 6.0.1 (looks like you are still on 6.0.0). Give that a try instead.
@couderA You need to get a XCFramework instead of a regular framework. Unfortunately for now it’s available only through Carthage. Check this manual for details: https://developers.google.com/maps/documentation/places/ios-sdk/start#install-the-xcframework
Any follow-up on this issue?
@arriolac ty for the update.
Any follow up? We’re well into Q4. I see that there was a new release yesterday, but no mention of Apple Silicon support, which is disconcerting - https://developers.google.com/maps/documentation/ios-sdk/releases#2021-10-19. If there was just a release yesterday, it seems likely at minimum there won’t be Apple Silicon support for at least a month. Can we get an update? This issue has been affecting my team’s workflow for months now and it’s getting more and more frustrating.
It seems it has been fixed but I don’t want to update to confirm it 😄
https://developer.apple.com/forums/thread/681749 https://dimillian.medium.com/xcode-is-not-working-under-rosetta-anymore-on-macos-12-on-apple-silicon-b93f64a362f7 Feedback ID: FB9130594
Oh don’t get me wrong, it’s definitely faster, but it’s not “hot reload” fast like apple advertises.
try to use iOS 13.7 simulator, it works like a charm.
On Mon, Jul 26, 2021 at 4:06 PM Erlend @.***> wrote:
– Thanks, Michael Lin
a iOS 13.7 simulator is just compatible with Google Maps in cocoapods way! it works.
Any update on this? 🙏
Try this !!! https://github.com/firebase/firebase-ios-sdk/issues/7208#issuecomment-866845495
Might be a different thing but it works for this, so you can try it for this library also. and let me know if it does not work for this library.
Try to run xcode through rosetta.