在 Swift 中使用 Fabric - Cannonball 时应用会崩溃?
App crash on using Fabric - Cannonball in Swift?
我在 运行 CannonBall 时遇到此错误:app here
'[Fabric] Info.plist 键 "Fabric" 的值必须是 NSDictionary。'
Appdelegate.swift:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
let welcome = "Welcome to Cannonball! Please onboard with the Fabric Mac app. Check the instructions in the README file."
//assert(NSBundle.mainBundle().objectForInfoDictionaryKey("Fabric") != nil, welcome)
Fabric.with([Crashlytics(), Twitter(), Digits(), MoPub()])//error here
if Twitter.sharedInstance().session() == nil && Digits.sharedInstance().session() == nil {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let signInViewController: AnyObject! = storyboard.instantiateViewControllerWithIdentifier("SignInViewController")
window?.rootViewController = signInViewController as? UIViewController
}
return true
}
我得到的建议是 "missing Fabric APIKey from your info.plist"。
但是我在 info.plist.
中找不到 Fabric 密钥
Info.plist:
将此代码添加到您的 .plist 文件中:
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>Your-key</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
<dict>
<key>KitInfo</key>
<dict>
<key>consumerKey</key>
<string>Your-consumerKey</string>
<key>consumerSecret</key>
<string>Your-consumerSecret</string>
</dict>
<key>KitName</key>
<string>Twitter</string>
</dict>
<dict>
<key>KitInfo</key>
<dict>
<key>consumerKey</key>
<string>Your-consumerKey</string>
<key>consumerSecret</key>
<string>Your-consumerSecret</string>
</dict>
<key>KitName</key>
<string>Digits</string>
</dict>
</array>
</dict>
我在 运行 CannonBall 时遇到此错误:app here
'[Fabric] Info.plist 键 "Fabric" 的值必须是 NSDictionary。'
Appdelegate.swift:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
let welcome = "Welcome to Cannonball! Please onboard with the Fabric Mac app. Check the instructions in the README file."
//assert(NSBundle.mainBundle().objectForInfoDictionaryKey("Fabric") != nil, welcome)
Fabric.with([Crashlytics(), Twitter(), Digits(), MoPub()])//error here
if Twitter.sharedInstance().session() == nil && Digits.sharedInstance().session() == nil {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let signInViewController: AnyObject! = storyboard.instantiateViewControllerWithIdentifier("SignInViewController")
window?.rootViewController = signInViewController as? UIViewController
}
return true
}
我得到的建议是 "missing Fabric APIKey from your info.plist"。 但是我在 info.plist.
中找不到 Fabric 密钥Info.plist:
将此代码添加到您的 .plist 文件中:
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>Your-key</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
<dict>
<key>KitInfo</key>
<dict>
<key>consumerKey</key>
<string>Your-consumerKey</string>
<key>consumerSecret</key>
<string>Your-consumerSecret</string>
</dict>
<key>KitName</key>
<string>Twitter</string>
</dict>
<dict>
<key>KitInfo</key>
<dict>
<key>consumerKey</key>
<string>Your-consumerKey</string>
<key>consumerSecret</key>
<string>Your-consumerSecret</string>
</dict>
<key>KitName</key>
<string>Digits</string>
</dict>
</array>
</dict>