diff --git a/src/setup_payload/java/src/chip/setuppayload/SetupPayloadParser.java b/src/setup_payload/java/src/chip/setuppayload/SetupPayloadParser.java index 89601ac18a3cdc..1f035253c27d4a 100644 --- a/src/setup_payload/java/src/chip/setuppayload/SetupPayloadParser.java +++ b/src/setup_payload/java/src/chip/setuppayload/SetupPayloadParser.java @@ -1,8 +1,13 @@ package chip.setuppayload; +import java.util.logging.Level; +import java.util.logging.Logger; + /** Parser for scanned QR code or manual entry code. */ public class SetupPayloadParser { + private static final Logger LOGGER = Logger.getLogger(SetupPayloadParser.class.getSimpleName()); + /** * Returns {@link SetupPayload} parsed from the QR code string. If an invalid element is included * in the QRCode Parse result, SetupPayloadException occurs. Refer to {@link SetupPayload} for the @@ -69,7 +74,11 @@ private native SetupPayload fetchPayloadFromManualEntryCode( throws InvalidEntryCodeFormatException, SetupPayloadException; static { - System.loadLibrary("SetupPayloadParser"); + try { + System.loadLibrary("SetupPayloadParser"); + } catch (UnsatisfiedLinkError e) { + LOGGER.log(Level.SEVERE, "Cannot load library.", e); + } } public static class UnrecognizedQrCodeException extends Exception {