【发布时间】:2020-05-11 13:18:13
【问题描述】:
我正在尝试将 Firebase(用于动态链接)集成到我当前的 Xcode iOS 项目中,但我在构建中遇到了错误问题(遵循此文档:https://firebase.google.com/docs/dynamic-links/ios/receive)。
我的 Podfile 看起来像这样:
# Uncomment the next line...
# platform :ios, '9.0'
target 'AppName1' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for AppName1
pod 'Firebase/Analytics'
pod 'Firebase/DynamicLinks'
end
target 'NotificationServiceExtension' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for NotificationServiceExtension
pod 'Firebase/Analytics'
pod 'Firebase/DynamicLinks'end
(... With more targets ...)
测试1。当我尝试编译 App 目标时,这是我得到的错误:
'FirebaseCore/FirebaseCore.h' file not found
Firebase.h
While building module 'Firebase' imported from */AppDelegate.h:1.1:
In file included from <module-includes>:1:
Could not build module 'Firebase'
AppDelegate.h
In the file included from */ViewControllerLogin.m:9:
In the file included from */ViewControllerLogin.h:10:
测试2。如果我从 NotificationServiceExtensions 中删除“pod 'Firebase/ ...”行,我会收到以下错误:
'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.
'openURL:' is unavailable: not available on iOS (App Extension)
测试1。如果我评论“use_frameworks!”使用#,我再次遇到第一个错误。
测试2。如果我评论目标 NotificationServiceExtensions 中的所有内容,我会得到:
Library not found for -lFirebaseCore
对于我再次执行“pod deintegrate”和“pod install”的每个测试,打开 PROJECT-NAME.xcworkspace,清理并构建。
我不知道还有什么可以尝试或我做错了什么......(与android的集成非常容易......)
谢谢。
【问题讨论】: