应用程序崩溃,因为"It appears that 'PubNub' is not a valid Fabric Kit"



让我说我正在使用CocoaPods来管理我的框架。我不确定这是否真的很重要,但是我认为您可能知道以防万一。我还在iOS 10.x上使用最新版本的Xcode(不是beta(运行。


我的应用程序在Fabric.with([Crashlytics.self, PubNub.self])上崩溃,并带有以下错误:

由于未被发现的例外" fabexception",终止应用程序,原因是:'[Fabric]看来" PubNub"不是有效的织物套件。请确保仅将面料套件传递给[织物:]。'

我已经更新了我的PodFile,清洁了我的项目,在新的安装上运行,在物理和虚拟设备上运行,我甚至卸载了pod 'PubNub'并重新安装了它。到目前为止,似乎没有任何工作,因此任何帮助将不胜感激。

我的AppDelegate看起来像这样:

import Fabric
import Crashlytics
import PubNub
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    /* Fabric (Answers) Debug */
    Fabric.sharedSDK().debug = true
    /* Fabric Setup */
    Fabric.with([Crashlytics.self, PubNub.self])
    return true
}

我的PodFile看起来像这样:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.1'
target 'AppName' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!
    # Fabric #
    pod 'Fabric'
    pod 'Crashlytics', '~>  3.8'
    # PubNub #
    pod 'PubNub/Fabric'
    target 'AppNameTests' do
        inherit! :search_paths
        # Pods for testing
    end
    target 'AppNameUITests' do
        inherit! :search_paths
        # Pods for testing
    end
end

我的Info.plist代码:

<key>Fabric</key>
<dict>
    <key>APIKey</key>
    <string>##############################</string>
    <key>Kits</key>
    <array>
        <dict>
            <key>KitInfo</key>
            <dict/>
            <key>KitName</key>
            <string>Crashlytics</string>
        </dict>
        <dict>
            <key>KitInfo</key>
            <dict>
                <key>publish-key</key>
                <string>##############################</string>
                <key>secret-key</key>
                <string>##############################</string>
                <key>subscribe-key</key>
                <string>##############################</string>
            </dict>
            <key>KitName</key>
            <string>PubNub</string>
        </dict>
    </array>
</dict>

我是面料上的工程师。我尝试复制您上面描述的问题,但不能这样做。一个新鲜的Swift项目和PubNub/Fabric Cocoapod似乎可以使用。我唯一的怀疑是,您以某种方式在项目中使用了PubNub的非顽强构建。如果我还能做任何其他事情来提供帮助,请随时接触!

最新更新