简体   繁体   English

如何在 Apple Silicon('M1')上构建 Google Analytics SDK,使其在 Xcode 模拟器中运行?

[英]How can I build the Google Analytics SDK on Apple Silicon ('M1') so it runs in the Xcode Simulator?

I've used the Google Analytics SDK ( pod 'GoogleAnalytics' ) in my project for 8 years.我在我的项目中使用 Google Analytics SDK ( pod 'GoogleAnalytics' ) 已经 8 年了。 It has always worked, until I recently moved to a new Mac with an M1 chip.它一直有效,直到我最近换了一台带有 M1 芯片的新 Mac。 On the new MacBook Pro, I can build and run the app on a test device.在新的 MacBook Pro 上,我可以在测试设备上构建和运行应用程序。 I can also archive and distribute the app.我还可以存档和分发应用程序。 But when I try to build my app for an Xcode Simulator , it fails with this message:但是,当我尝试为 Xcode Simulator 构建我的应用程序时,它会失败并显示以下消息:

ld: in /Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIUtil.o), building for iOS Simulator, but linking in object file built for iOS, file '/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a' for architecture arm64

I'd like to keep using the Google Analytics SDK as it offers features that are missing in Firebase (which I'm also using), such as the ability to download data via an API for free.我想继续使用 Google Analytics SDK,因为它提供了 Firebase(我也在使用)中缺少的功能,例如通过 ZDB974238714CA8DE6434A7CE1D083A 免费下载数据的能力。

So is there any way to fix the build for Xcode Simulators that run on Apple Silicon?那么有什么方法可以修复在 Apple Silicon 上运行的 Xcode 模拟器的构建?

Google Analytics is shipped as a compiled binary, and support for M1 macs will have to be added by Google itself. Google Analytics 以编译后的二进制文件形式发布,对 M1 macs 的支持必须由 Google 自己添加。

Until they have done that and release an update, it's probably best if you exclude GA from your simulator builds, somewhat similar to the way described in Exclude pod when porting to mac with catalyst在他们完成此操作并发布更新之前,最好将 GA 从您的模拟器构建中排除,这有点类似于在使用催化剂移植到 mac 时排除 pod中描述的方式

Here is open issue in GitHub Firebase project regarding libGoogleAnalytics.a issue.这是 GitHub Firebase 项目中关于 libGoogleAnalytics.a 问题的未解决问题。

I want to encourage, that everyone who have this problem will open this url and post a message, that we need to solve this problem.我想鼓励每个有这个问题的人打开这个url 并发布消息,我们需要解决这个问题。

https://github.com/firebase/firebase-ios-sdk/issues/7509 https://github.com/firebase/firebase-ios-sdk/issues/7509

Gereon's answer makes sense. Gereon 的回答很有道理。 I'll wait for Google to roll out a new version of Google Analytics SDK.我将等待 Google 推出新版本的 Google Analytics SDK。 I hope they keep updating the SDK as it is such a valuable tool.我希望他们不断更新 SDK,因为它是如此有价值的工具。

And I just realized that, with the M1 Mac, I can directly build a Mac app from XCode.而且我刚刚意识到,使用 M1 Mac,我可以直接从 XCode 构建 Mac 应用程序。 That'll do.这样就行了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果不使用 rosseta,我无法使用 Apple Silicon m1 Pro 构建我的应用程序 - I can't build my app with apple silicon m1 pro without using rosseta Dynamics SDK v9.1 - M1 Apple Silicon 支持上的 iOS 模拟器 - Dynamics SDK v9.1 - iOS Simulator on M1 Apple Silicon Support 如何在 Apple Silicon (M1) 上运行 CocoaPods - How to run CocoaPods on Apple Silicon (M1) M1 Mac Xcode Build Done then Failed Flutter 项目(苹果硅) - M1 Mac Xcode Build Done then Failed Flutter Project (apple silicon) Xcode 错误“为 iOS 模拟器构建,但在为 iOS.. 构建的 dylib 中链接”来自 Apple Silicon M1 Mac - Xcode error 'building for iOS Simulator, but linking in dylib built for iOS .. for architecture arm64' from Apple Silicon M1 Mac 有没有办法在 Apple Silicon M1 上运行 Firebase? - Is there a way to run Firebase on Apple Silicon M1? 如何为 Apple Silicon arm64 模拟器构建 xcframework? - How to build an xcframework for Apple Silicon arm64 simulator? 为 Apple Silicon mac 模拟器构建 static 库 - Build static lib for Apple Silicon mac simulator Google cast SDK 在 Apple M1 Pro 芯片组中不起作用 - Google cast SDK not working in Apple M1 Pro chipset 在 Apple Silicon (M1) 上构建 React Native IOS 说 -lDoubleConversion - Building React Native IOS on Apple Silicon (M1) says -lDoubleConversion
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM