Troubleshooting

View this page for | |

To facilitate troubleshooting and debugging, you can activate the SDK logging feature.

Note: It is recommended that you enable logging only for debug builds of the integrating application.

HID Approve SDK uses the slf4j API to implement logging. As demonstrated in the sample application, logging can be configured by using an slf4j compliant logger (such as Logback).

Logback can be configured programmatically or by modifying the assets/logback.xml configuration file.

The sample logback configuration uses both a logcat appender and file appender to /sdcard/log/MobileSDKSample.log.

As this path can differ between mobile phones, it is advised that you use a programmatic configuration if logs are requested.

The file appender needs the android.permission.WRITE_EXTERNAL_STORAGE app permission to write in the external storage.

Sample Android Logback Configuration

Copy
<configuration debug='true'>
    <appender name='FILE' class='ch.qos.logback.core.rolling.RollingFileAppender'>
        <file>/sdcard/log/TrustOps.log</file>
        <append>true</append>
        <rollingPolicy class='ch.qos.logback.core.rolling.FixedWindowRollingPolicy'>
            <fileNamePattern>/sdcard/log/TrustOps.%i</fileNamePattern>
            <minIndex>1</minIndex>
            <maxIndex>5</maxIndex>
        </rollingPolicy>
        <triggeringPolicy class='ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy'>
            <maxFileSize>10MB</maxFileSize>
        </triggeringPolicy>
 
        <encoder class='ch.qos.logback.classic.encoder.PatternLayoutEncoder'>
            <pattern>%d{ISO8601} [%t] %-5p %logger %method\(%L\) - %msg%n</pattern>
        </encoder>
    </appender>
 
    <appender name='LOGCAT' class='ch.qos.logback.classic.android.LogcatAppender'>
        <tagEncoder class='ch.qos.logback.classic.encoder.PatternLayoutEncoder'>
            <pattern>%logger{0}</pattern>
        </tagEncoder>
        <encoder class='ch.qos.logback.classic.encoder.PatternLayoutEncoder'>
            <pattern>%d{HH:mm:ss.SSS} %method\(%L\) %m%n</pattern>
        </encoder>
    </appender>
 
    <root level='ALL'>
        <appender-ref ref='FILE' />
        <appender-ref ref='LOGCAT' />
    </root>
</configuration>

Error Codes

The following error codes might be returned by the SDK.

Internal Errors

Error Code Description

(0) Internal

An unexpected error occurred

(1) NotImplemented

The method is not implemented

(2) UnsupportedOperation

The operation is not supported by the object

(3) InvalidArgument

The given parameter is not valid or required

(4) KeyGenerationFailure

Unable to generate internal credential

(5) ProtectionPolicyFailure

Unable to create or locate internal protection policy

(6) SecureDataFailure

Unable to create or locate internal credential data

(7) UnsupportedVersion Container version is not supported and cannot be upgraded
(8) InvalidContainer Container identifier is invalid or does not exist

Credential Errors

Error Code Description
(100) Authentication

Authentication failed

(101) InvalidPassword

The password fails policy requirements

(102) CredentialsExpired

The credentials used to sign the transaction have expired

(103) PasswordExpired

The password has expired and requires a change of password

Thrown by retrieveTransaction and setStatus when currentAge is greater or equal than maxAge.

(104) PasswordNotYetUpdatable

The password cannot be changed yet

Thrown by change password when currentAge is less than minAge.

(105) PasswordRequired

The required password was not provided

(106) LostCredentials

The provisioning key securing the transaction has been wiped. Most probably due to an update of the device's policy.

A new provisioning operation is required.

(107) InvalidChallengeTooLong

The challenge is too long with respect to the OTP configuration

(108) InvalidChallengeBadFormat

The challenge does not have the format expected by the OTP configuration

(109) PasswordCancelled

The password event has been canceled by the user

Device Errors

Error Code Description
(200) UnsupportedDevice

The device configuration is not supported

This exception can be returned if a given device is not supported by policy or does not have the minimum required security configuration.

(201) UnsafeDevice

The device is not safe enough to store sensitive secrets

For example, starting from LOLLIPOP, provisioning operation are forbidden if the mobile is not protected by a password.

(202) FingerprintNotEnrolled Fingerprints have not been enrolled
(203) UserCancelled The user has canceled the operation
(204) FingerprintAuthenticationRequired Authentication with fingerprint is required to perform the operation
(205) UnsupportedOperationMode Mode of operation required by the server is not supported by the device
(206) GooglePlayServicesObsolete Google Play services is not up to date
(207) BiometricAuthenticationNotEnabled Enabling biometric authentication is required to perform the operation

Communication Errors

Error Code Description
(300) ServerAuthentication Authentication to the server failed
(301) ServerVersion The server protocol version is not supported by the client
(302) ServerProtocol

An unexpected failure has occurred in the implementation layer

The server sent a message not compliant with the protocol version.

(303) Remote Execution of a remote method call failed
(304) ServerUnsupportedOperation The server does not support the requested operation
(305) ServerOperationFailed The server was not able to execute the requested operation
(306) ServerCustomizationInvalid The server's mobile-app customization package is invalid or contains an invalid data

Transaction Errors

Error Code Description
(1000) TransactionExpired The transaction has expired
(1001) TransactionContainerInvalid

The transaction id refers to a container that does not exist

It might happen if the container is deleted locally without notifying the server.