在应用程序中使用Firebase和Today Extension不起作用 [英] Using Firebase in the App and Today Extension doesn't work

查看:453
本文介绍了在应用程序中使用Firebase和Today Extension不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用了Firebase,我通过 pod 使用了它,并且所有内容都正常工作。然后我们添加Today Extensions (2扩展)到我们的应用程序,我们也需要使用Firebase,所以我把它添加到 podfile 像这样:

  use_frameworks! 
project'projectName.xcodeproj'

target'appName'do
$ b $ pod'Firebase / Core'

post_install do | installer |
installer.pods_project.targets.each do | target |
target.build_configurations.each do | config |
config.build_settings ['SWIFT_VERSION'] ='3.0'
结束
结束
结束
$ b $结束

目标' todayExtension1_Name'do

pod'Firebase / Core'

end

target'todayExtension2_Name'do

pod'Firebase / Core'

end

我为todayExtensions创建了两个应用程序,并正确实施.plist文件,并成功构建应用程序。



但是当我尝试运行应用程序时,


$ b


dyld:找不到符号:_OBJC_CLASS _ $ _ GTMLogLevelFilter
引用自:/ Users / rawanal-omari / Library / Developer / CoreSimulator /Devices/33A7DC45-EFD9-4245-8989-7C6B4194481F/data/Containers/Bundle/Application/84C060C2-A4AE-4AF3-8804-ADA8CFBCABB3/appName.app/appName
预计位置:/ Users / rawanal-omari /图书馆/开发商/ CoreSimulator /设备/ 33A7DC45-EFD9-4245-8989-7C6B4194481F /数据/ CON tainers / Bundle / Application / 84C060C2-A4AE-4AF3-8804-ADA8CFBCABB3 / appName.app / Frameworks / GoogleToolboxForMac.framework / GoogleToolboxForMac $ b $ in / Users / rawanal-omari / Library / Developer / CoreSimulator / Devices / 33A7DC45-EFD9 -4245-8989-7C6B4194481F / data / Containers / Bundle / Application / 84C060C2-A4AE-4AF3-8804-ADA8CFBCABB3 / appName.app / appName



有没有人遇到这样的问题?

解决方案

不知道通过pod来定位扩展是否足够,
但需要以下步骤



第1步。进入您的Firebase控制台。



第2步。点击您正在处理的项目。





第三步。在项目中,点击Add another app



第4步。选择iOS,然后输入您的TODAY EXTENSION
的BUNDLE ID

第5步。完成向导并下载生成的GoogleService-Info.plist文件。将plist文件添加到您的今日扩展的根文件夹中



从这里您可以尝试通过窗格向您的扩展添加Firebase。


I'm using Firebase in My App, I used it via pod and everything was work correctly,

Then we Add Today Extensions (2 extensions) to our app, and also we need to use Firebase in it, so I added it to podfile like this:

use_frameworks!
 project ‘projectName.xcodeproj'

  target ‘appName’ do

        pod 'Firebase/Core'

  post_install do |installer|
installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '3.0'
    end
end
end

end

target ‘todayExtension1_Name’ do

pod 'Firebase/Core'

end 

 target ‘todayExtension2_Name’ do

pod 'Firebase/Core'

end

and I create two apps for the todayExtensions, and implement the .plist files correctly and the app build successfully.

but when I try to run the app, I got this runtime exception:

dyld: Symbol not found: _OBJC_CLASS_$_GTMLogLevelFilter Referenced from: /Users/rawanal-omari/Library/Developer/CoreSimulator/Devices/33A7DC45-EFD9-4245-8989-7C6B4194481F/data/Containers/Bundle/Application/84C060C2-A4AE-4AF3-8804-ADA8CFBCABB3/appName.app/appName Expected in: /Users/rawanal-omari/Library/Developer/CoreSimulator/Devices/33A7DC45-EFD9-4245-8989-7C6B4194481F/data/Containers/Bundle/Application/84C060C2-A4AE-4AF3-8804-ADA8CFBCABB3/appName.app/Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac in /Users/rawanal-omari/Library/Developer/CoreSimulator/Devices/33A7DC45-EFD9-4245-8989-7C6B4194481F/data/Containers/Bundle/Application/84C060C2-A4AE-4AF3-8804-ADA8CFBCABB3/appName.app/appName

Did anyone face problem like this?

解决方案

Not sure if targeting the extensions via pods is enough, But the following steps are needed

Step 1. Go to your firebase console.

Step 2. Click on the project you are working on.

Step 3. Within the project, click on "Add another app"

Step 4. Select iOS and then enter the BUNDLE ID of your TODAY EXTENSION

Step 5. Complete the wizard and download the generated GoogleService-Info.plist file. Add the plist file to your Today Extension's root folder

From here you can try adding firebase via pods to your extensions.

这篇关于在应用程序中使用Firebase和Today Extension不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆