crowdin/mobile-sdk-ios

iOS crash: #0 (null) in Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value ()

Radzievskyi opened this issue · 0 comments

Describe the bug
We got crash log in Xcode from our user. As I see log issue happened in Crowdin SDK:
#0 (null) in Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value ()

This happened in file:
CustomBundle.swift

In the Class:
FolderBundle: FolderBundleProtocol

Initializer:
init(path: String)

Line:
self.bundle = Bundle(path: folder.path)!

To Reproduce
Steps to reproduce the behavior:

  1. Crowdin SDK connected as Swift Package:

Screen Shot 2022-07-04 at 14 25 43

  1. Current version SDK is v1.4.2

  2. Our initialization of Crowdin SDK what calling from AppDelegate:

import Foundation
import CrowdinSDK

class CrowdinManager: NSObject
{
    private static let distributionHash = "our_hash
    
    class func initCrowding() {
        let crowdinProviderConfig = CrowdinProviderConfig(hashString: CrowdinManager.distributionHash,
                                                          sourceLanguage: Localization.detectLanguage())

        let crowdinSDKConfig = CrowdinSDKConfig.config().with(crowdinProviderConfig: crowdinProviderConfig)
        
        CrowdinSDK.startWithConfig(crowdinSDKConfig, completion: {})

        CrowdinSDK.currentLocalization = Localization.detectLanguage();
    }
}

Expected behavior
Crash should not happened

Screenshots
Screen-Shot-2022-07-04-at-13 44 49_me

Smartphone (please complete the following information):

  • Device: iPhone 13 Pro
  • OS: iOS 15.5 (19F77)

Additional context
Add any other context about the problem here.