2016-12-25 6 views
5

मैंने एक खाली एक्सकोड प्रोजेक्ट शुरू किया और मैंने जो कुछ किया वह कोकोपोड्स के माध्यम से फायरबेस फ्रेमवर्क जोड़ता था और Appdelegate और viewcontroller में आयात करता था। जब मैं FIRApp.configure() से didFinishLoadingWithOptions मुझे यह त्रुटि मिलती है। अगर मैं उस रेखा को हटा देता हूं लेकिन अभी भी ढांचे को आयात किया गया है तो यह कोई त्रुटि के साथ चलता है। यह एक खाली परियोजना पर होता है जिसमें स्टोरीबोर्ड में कुछ भी नहीं होता है और न ही viewcontroller.swift।फ़ायरबेस कारण "थ्रेड 1: सिग्नल सिगैबर्ट"

सांत्वना यह कहते हैं libC++ abi.dylib: प्रकार NSException के न आया हुआ अपवाद (11db) के साथ समाप्त

Xcode 8.2, तेज 3

import UIKit 
import Firebase 

@UIApplicationMain 
class AppDelegate: UIResponder, UIApplicationDelegate { 

var window: UIWindow? 


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
    // Override point for customization after application launch. 
FIRApp.configure() 

    return true 
} 

func applicationWillResignActive(_ application: UIApplication) { 
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 
    // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 
} 

func applicationDidEnterBackground(_ application: UIApplication) { 
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 
} 

func applicationWillEnterForeground(_ application: UIApplication) { 
    // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 
} 

func applicationDidBecomeActive(_ application: UIApplication) { 
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 
} 

func applicationWillTerminate(_ application: UIApplication) { 
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 
} 

}

Podfile

# Uncomment the next line to define a global platform for your  project 
    # platform :ios, '9.0' 

    target 'dur2' do 
     # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 
     use_frameworks! 

     # Pods for dur2 

pod 'Firebase/Core' 
pod 'Firebase/AdMob' 
pod 'Firebase/Messaging' 
pod 'Firebase/Database' 
pod 'Firebase/Invites' 
pod 'Firebase/DynamicLinks' 
pod 'Firebase/Crash' 
pod 'Firebase/RemoteConfig' 
pod 'Firebase/Auth' 
pod 'Firebase/Storage' 
pod 'SDWebImage' 

अंत

+0

आप googleplist फ़ाइल चयन किया है? – Ro4ch

+0

क्या आपने फायरबेस के लिए .plist फ़ाइल जोड़ दी थी? –

+0

हां, मैंने @ Ro4ch – Henry

उत्तर

2

आइए परीक्षण की कोशिश करें।

फ़ायरबेस वेबसाइट पर निर्देशों के बाद एक नई परियोजना बनाएं, यह सुनिश्चित करें कि आप अपनी परियोजना में GoogleService-Info.plist जोड़ लें।

कदम जहाँ आप एक फली फ़ाइल बनाने में यकीन है कि आप अपनी परियोजनाओं फ़ोल्डर में हैं बनाने के लिए और इस पाठ का उपयोग करें:

# Uncomment the next line to define a global platform for your project 
# platform :ios, '9.0' 

target 'your-project-name' do 
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 
    use_frameworks! 

    # Pods for Firesearch 
    pod ‘Firebase/Core’ 
end 

और अपने-परियोजना के नाम

के स्थान पर अपने प्रोजेक्ट के नाम कर दिया

फ़ाइल सहेजें और फिर परियोजना name.xcworkspace खोलने के लिए और इसे बनाने फिर एक

pod install 

है।

+0

ठीक है मैंने ऐसा किया और इसे अपने डिवाइस पर चलाया और कोई त्रुटि नहीं आई, मेरा फायरबेस कंसोल एक ऐप इंस्टॉल की पुष्टि करता है। इससे मैं केवल इतना सोच सकता हूं कि मैंने स्थापित अतिरिक्त फोडों में त्रुटि, कोई विचार? – Henry

+0

मैं अपने पिछले प्रोजेक्ट के साथ स्थापित अतिरिक्त फोड को कैसे हटा सकता हूं? – Henry

+0

@ हेनरी वेल, आप [स्वचालित ऐप] (https://github.com/CocoaPods/cocoapods-deintegrate) को आजमा सकते हैं जो मदद कर सकता है। इसके अलावा उन्हें मैन्युअल रूप से हटा दिया जाना चाहिए। आप अपने पॉडफ़ाइल से पॉड को हटाने का भी प्रयास कर सकते हैं, फिर पॉड इंस्टॉल फिर से चलाएं। – Jay

1

यदि आपने अब तक नहीं,

जाओ firebase में अपनी परियोजना के लिए और google.plist फ़ाइल डाउनलोड करने और अपने परियोजना और चलाने में जोड़ें।

2

Xcode 9

के लिए काम किया है, तो समाधान से कोई भी काम के लिए आप इस प्रयास करें: खोजकर्ता में

  1. बंद Xcode
  2. :

    • .xcworkspace निकालें फ़ाइल
    • पॉडफाइल निकालें।ताला फ़ाइल
    • निकालें फलियाँ फ़ोल्डर
  3. टर्मिनल में (परियोजना फ़ोल्डर में): फली स्थापित

  4. सुनिश्चित करें कि GoogleService-Info.plist अपने लक्ष्य में जोड़ा जाता है और आपके BUNDLE_ID के लिए जेनरेट किया गया।

अज्ञात कारणों से जब आप दोनों "Firebase/Admob" और "Firebase/कोर" का उपयोग फली Xcode कर सकते हैं गंदगी कार्यक्षेत्र और एक बुरा निर्माण जो रनटाइम के दौरान दुर्घटना होगा यदि आप करने की कोशिश का उत्पादन कॉल FirebaseApp.configure() या GADMobileAds.configure (withApplicationID: "APP_ID")

संबंधित मुद्दे