diff --git a/android/app/src/main/kotlin/com/yubico/authenticator/MainActivity.kt b/android/app/src/main/kotlin/com/yubico/authenticator/MainActivity.kt index a543dfc2..47c45af9 100644 --- a/android/app/src/main/kotlin/com/yubico/authenticator/MainActivity.kt +++ b/android/app/src/main/kotlin/com/yubico/authenticator/MainActivity.kt @@ -129,10 +129,11 @@ class MainActivity : FlutterFragmentActivity() { allowScreenshots(false) - yubikit = YubiKitManager( - UsbYubiKeyManager(this), + val nfcManager = if (NfcAdapter.getDefaultAdapter(this) != null) { NfcYubiKeyManager(this, NfcStateDispatcher(nfcStateListener)) - ) + } else null + + yubikit = YubiKitManager(UsbYubiKeyManager(this), nfcManager) } override fun onNewIntent(intent: Intent) {