英文:
Undefined symbol: _OBJC_CLASS_$_GMSCameraPosition
问题
以下是您要翻译的代码部分:
我在SwiftUI中遇到了GoogleMaps SDK的一些问题。
我手动安装了SDK,因为CocoaPods在我的Mac上无法工作。
但现在我遇到了构建问题:
显示最近的消息
忽略文件/Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMapsCore.framework/GoogleMapsCore,该文件是通用的(arm64),但不包含x86_64架构:/Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMapsCore.framework/GoogleMapsCore
忽略文件/Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMapsBase.framework/GoogleMapsBase,该文件是通用的(arm64),但不包含x86_64架构:/Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMapsBase.framework/GoogleMapsBase
忽略文件/Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMaps.framework/GoogleMaps,该文件是通用的(arm64),但不包含x86_64架构:/Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMaps.framework/GoogleMaps
未定义的符号:_OBJC_CLASS_$_GMSCameraPosition
未定义的符号:_OBJC_CLASS_$_GMSMapView
未定义的符号:_OBJC_CLASS_$_GMSServices
这是我尝试的代码:
import UIKit
import GoogleMaps
import SwiftUI
struct GoogleMapsView: UIViewRepresentable {
private let zoom: Float = 15.0
func makeUIView(context: Self.Context) -> GMSMapView {
let camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.20, zoom: 6.0)
let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
return mapView
}
英文:
I'm having some issues with the GoogleMaps SDK in SwiftUI.
I manually installed the SDK, because cocoa pods don't work on my Mac.
But now I have building issues:
Showing Recent Messages
Ignoring file /Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMapsCore.framework/GoogleMapsCore, file is universal (arm64) but does not contain the x86_64 architecture: /Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMapsCore.framework/GoogleMapsCore
Ignoring file /Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMapsBase.framework/GoogleMapsBase, file is universal (arm64) but does not contain the x86_64 architecture: /Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMapsBase.framework/GoogleMapsBase
Ignoring file /Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMaps.framework/GoogleMaps, file is universal (arm64) but does not contain the x86_64 architecture: /Users/f4mdev/AndroidStudioProjects/fabTraceability/iosApp/iosApp/GoogleMaps.framework/GoogleMaps
Undefined symbol: _OBJC_CLASS_$_GMSCameraPosition
Undefined symbol: _OBJC_CLASS_$_GMSMapView
Undefined symbol: _OBJC_CLASS_$_GMSServices
This is my Code I tried:
import UIKit
import GoogleMaps
import SwiftUI
struct GoogleMapsView: UIViewRepresentable {
private let zoom: Float = 15.0
func makeUIView(context: Self.Context) -> GMSMapView {
let camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.20, zoom: 6.0)
let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
return mapView
}
答案1
得分: 0
Google 地图包不支持苹果芯片。在实际设备上运行应用程序或在 Rosetta 中运行 Xcode 应该可以正常工作。
英文:
Google Maps package doesn't support Apple Silicon. Running the app on an actual device or running xcode in rosetta should work.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论