Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/crystal-reports/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode 仅在存档时发生iOS swift编译错误_Xcode_Smooch_Swift2.3 - Fatal编程技术网

Xcode 仅在存档时发生iOS swift编译错误

Xcode 仅在存档时发生iOS swift编译错误,xcode,smooch,swift2.3,Xcode,Smooch,Swift2.3,我得到以下错误 AppDelegate.swift:152:30:“(appToken:String!)->SKTSettings”不是 可转换为“(appToken:String!)->SKTSettings!' AppDelegate.swift:167:23:'(writeKey:String!)-> SEGAnalyticsConfiguration“不能转换为”(writeKey:String!)->SEGAnalyticsConfiguration!' 冒犯的台词 让smoochSe

我得到以下错误

AppDelegate.swift:152:30:“(appToken:String!)->SKTSettings”不是 可转换为“(appToken:String!)->SKTSettings!'

AppDelegate.swift:167:23:'(writeKey:String!)-> SEGAnalyticsConfiguration“不能转换为”(writeKey:String!)->SEGAnalyticsConfiguration!'

冒犯的台词

让smoochSettings=SKTSettings(appToken:“xxxxx”) let config=SEGAnalyticsConfiguration(写入键:“xxxx”)

任何线索,我都不明白

关于代码的更多上下文

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    setupToast()

    //setup rollbar
    let rollbarConfig: RollbarConfiguration = RollbarConfiguration()

    #if RELEASE
        rollbarConfig.environment = "production"
    #elseif ADHOC
        rollbarConfig.environment = "adhoc"
    #else
        rollbarConfig.environment = "development"
    #endif

    Rollbar.initWithAccessToken("xxx", configuration: rollbarConfig, enableCrashReporter: false)

    AFNetworkReachabilityManager.sharedManager().startMonitoring()
    AFNetworkReachabilityManager.sharedManager().setReachabilityStatusChangeBlock { status in
        switch status {
        case .NotReachable:
            self.SHOW_ERROR("La connexion internet semble interrompue", completion: nil)
            break
        default:
            CRToastManager.dismissAllNotifications(true)
            break
        }
    }

    ParseManager.initParse()
    LBStripeManager.initStripe()
    loadAppearances()
    //FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
    PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
    FBSDKProfile.enableUpdatesOnAccessTokenChange(true)

    GMSServices.provideAPIKey("xxx")
    GMSPlacesClient.provideAPIKey("xxx")
    NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(AppDelegate.loadAppearances), name: "switchUserType", object: nil)
    let branch = Branch.getInstance()
    branch.initSessionWithLaunchOptions(launchOptions, andRegisterDeepLinkHandler: { params, error in

        if params["fromUserId"] != nil {
            let senderId = params["fromUserId"]!
            SEGAnalytics.sharedAnalytics().track("Refferal", properties: ["branchFromUser": senderId])
        }

        if params["adId"] != nil {
            let adId = params["adId"] as! String
            NSNotificationCenter.defaultCenter().postNotificationName("adCreated", object: nil)
            AdManager.sharedInstance.showAdToBabysitterFromRemoteNotification(adId, presentingController: self.window!.rootViewController!)
        }

        if (error == nil) {
            DeepLinkManager.handleDeepLinkWithParams(params)
            DeepLinkManager.sharedInstance.alreadyGotANetworkError = false
        } else if !DeepLinkManager.sharedInstance.alreadyGotANetworkError && DeepLinkManager.sharedInstance.isLoadingDataFromBranchServer {
            DeepLinkManager.sharedInstance.alreadyGotANetworkError = true
            UIWindow.topViewController().hideHUD(false)
            var errorMessage = PFConfig.stringForKey("inviteNoInternetAlertMessage")
            if errorMessage.isEmpty {
                errorMessage = "Vous n'êtes actuellement pas connecté à Internet. Le parrainage reprendra automatiquement dès qu'Internet sera disponible."
            }
            UIWindow.topViewController().showAlert(message: errorMessage)
        }
    })

    initSiren()

    // fabric
    Crashlytics().debugMode = false
    Fabric.with([Crashlytics.self])
    logUserInFabric()

    // smooch
    let smoochSettings = SKTSettings(appToken: "xxxxx")

    smoochSettings.userId = PFUser.currentUser()?.objectId
    Smooch.initWithSettings(smoochSettings)

    // intercom
    Intercom.setApiKey("xxx", forAppId: "xxxx")
    AppDelegate.phoneForCurrentUser()

    if needToSendSmoochLastOpenTag() {
        SKTUser.currentUser().addProperties(["DELTA_USAGE": "true"])
    }

    NSUserDefaults.standardUserDefaults().setObject(NSDate().timeIntervalSince1970, forKey: "LastOpen")


    var config = SEGAnalyticsConfiguration(writeKey: "xxx")
    #if RELEASE
    config.flushAt = 15
    #else
    config.flushAt = 1
    #endif
    SEGAnalytics.setupWithConfiguration(config)

    return true
}

更新将SDK更新为5.0.1版将解决此问题

如前所述,在更新到XCode 8后,Swift编译器无法正确确定值是否为可选值。将nullability说明符添加到Smooch头文件应该可以解决此问题。带有nullability说明符的生成正在进行中,应该很快发布