Need help?

Please type a word or phrase into the box below to search all our FAQ and support articles.

iOS: Terminating app due to uncaught exception 'MBInvalidLicenseKeyException' Android: AndroidRuntime: FATAL EXCEPTION

Follow

Terminating app due to fatal exception or E/AndroidRuntime: FATAL EXCEPTION: main indicates that you didn't correctly set up the license key, license file or you are using the license key that doesn't have included recognizer set in your project.

Solution:


Firstly, make sure that you have entered the license key in the right SDK. To more precise, only one license key can be used for only one SDK. For example, a license key for BlinkCard can not be implemented in the BlinkID SDK. Also, the license keys are platform-specific, meaning that you can not implement a license for iOS in an Android project.

Secondly, try seeing if you correctly implemented your license key that can be acquired from the Dashboard.

Lastly, check if you have the right to the recognizers that you’ve implemented in your project. Rights for using certain recognizers are discussed with the KAM (Key Account Manager) in the process of creating a contract. 

If you are using a trial key, this will not be an issue since all recognizers are enabled.

Once you have confirmed that the key is correct and you have the right to use the wanted recognizers, you can implement the license in the following way:

IOS:

You can set the method which passes the license key as a String: 

MBMicroblinkSDK.shared().setLicenseKey("your-license-key")

You can also set the method which uses the license key in form of the .mblic or .text file which you obtained from the Dashboard:

MBMicroblinkSDK.shared().setLicenseResource("blinkid-license", withExtension: "txt", inSubdirectory: "", for: Bundle.main)

Just make sure that the file that contains the license key is included in your project in Targets - Build phase - Copy bundle resources.

Also to note, the license keys must be in the viewDidLoad() method on the ViewController where the scanning process is initialized.

 

 

ANDROID:

Download your license file and put it in your application's assets folder. Make sure to set the license key before using any other classes from the SDK, otherwise you will get a runtime exception.


We recommend that you extend the Android Application class and set the license in onCreate callback like this:

public class MyApplication extends Application {

    @Override

  public void onCreate() {

        MicroblinkSDK.setLicenseFile("path/to/license/file/within/assets/dir", this);

    }

}

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments