我试图在模拟器中运行这个项目,我遇到了一些问题并解决了它,我最终得到了以下错误,我尝试了许多方法,但我无法解决它。我如何解决这个问题,请给我一些想法,我是新的ios开发。
cpu: m1 pro
系统: macOS12.3
xcode: 13.4
本机反应: 0.62.2
以下是错误消息:
Showing Recent Errors Only
Build target tolernPowerBankApp of project demo with configuration Debug
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_OIDURLQueryComponent", referenced from:
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_GTMSessionFetcher", referenced from:
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_OIDAuthorizationRequest", referenced from:
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OIDResponseTypeCode", referenced from:
-[GIDSignIn authenticateInteractivelyWithOptions:] in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_OIDAuthState", referenced from:
objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_OIDAuthorizationService", referenced from:
objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OIDOAuthErrorResponseErrorKey", referenced from:
+[GIDAuthentication handleTokenFetchEMMError:completion:] in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
"_OBJC_CLASS_$_SKDescriptorMapper", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_GTMAppAuthFetcherAuthorization", referenced from:
_OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
(maybe you meant: _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport, _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationEMMChainedDelegate )
"_OBJC_METACLASS_$_GTMAppAuthFetcherAuthorization", referenced from:
_OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
(maybe you meant: _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport, _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationEMMChainedDelegate )
"_OBJC_CLASS_$_OIDIDToken", referenced from:
objc-class-ref in GoogleSignIn(GIDGoogleUser_2bdd4a676c033bc6ca21970e75d9159c.o)
objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_OIDServiceConfiguration", referenced from:
objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
"_OBJC_CLASS_$_FIRApp", referenced from:
objc-class-ref in AppDelegate.o
"_RCTRegisterModule", referenced from:
+[SignWithApple load] in SignWithApple.o
"_OBJC_CLASS_$_RNCPushNotificationIOS", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTConvert", referenced from:
__OBJC_$_CATEGORY_RCTConvert_$_GIDSignInButtonStyle in AppDelegate.o
__OBJC_$_CATEGORY_RCTConvert_$_GIDSignInButtonColorScheme in AppDelegate.o
"_OIDOAuthTokenErrorDomain", referenced from:
___46-[GIDAuthentication refreshTokensWithHandler:]_block_invoke in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
"_OBJC_CLASS_$_FlipperKitNetworkPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FlipperKitReactPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTViewManager", referenced from:
_OBJC_CLASS_$_SignWithApple in SignWithApple.o
"_OBJC_CLASS_$_FlipperClient", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_GTMOAuth2KeychainCompatibility", referenced from:
objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
"_OBJC_CLASS_$_RCTLinkingManager", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FKUserDefaultsPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_GTMKeychain", referenced from:
objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
"_OBJC_CLASS_$_RCTBridge", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTRootView", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_METACLASS_$_RCTViewManager", referenced from:
_OBJC_METACLASS_$_SignWithApple in SignWithApple.o
"_OBJC_CLASS_$_FlipperKitLayoutPlugin", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_SKIOSNetworkAdapter", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTBundleURLProvider", referenced from:
objc-class-ref in AppDelegate.o
"_RCTConvertEnumValue", referenced from:
+[RCTConvert(GIDSignInButtonStyle) GIDSignInButtonStyle:] in AppDelegate.o
+[RCTConvert(GIDSignInButtonColorScheme) GIDSignInButtonColorScheme:] in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build failed 2022/5/23, 14:06 140.1 seconds
这样做帮助我解决了这个问题:
修改构建设置->排除体系结构选项,添加任意iOS模拟器SDK选项,并将值设置为arm64。如图所示:
并在Podfile中添加以下代码:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
end
end
end
我遇到的这个问题似乎是由M1引起的。https://juejin.cn/post/7037037120158269448
发布于 2022-05-23 06:52:25
您可以查看这些链接,也许它们可以帮助您:
虽然帮助我的是从react上的库搜索路径中移除这些值--原生0.64.2
Xcode ->构建设置->搜索路径->库搜索路径
同时,清理项目和xcode派生的数据也会有所帮助。
发布于 2022-12-01 11:00:31
我只需要做:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
和pod安装(因为以前尝试过吊舱去整合)
重新启动地铁班德勒。
我希望这能帮到你
https://stackoverflow.com/questions/72344149
复制相似问题