0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Android]マイナンバーカードの読み込みでjava.lang.SecurityException: Permission Denial: Tag ( ID: XX XX XX XX ) is out of date

Last updated at Posted at 2024-01-24

はじめに

AndroidでマイナンバーカードをNFCで読み込んだときに出たエラーの対応メモ

エラー内容

Androidでマイナンバーカードを読み込んだときにこのエラーが発生しました。

e = {SecurityException@30494} "java.lang.SecurityException: Permission Denial: Tag ( ID: XX XX XX XX ) is out of date"
 backtrace = {Object[19]@30503} 
 cause = {SecurityException@30494} "java.lang.SecurityException: Permission Denial: Tag ( ID: XX XX XX XX ) is out of date"
 detailMessage = "Permission Denial: Tag ( ID: XX XX XX XX ) is out of date"
 stackTrace = {StackTraceElement[18]@30507} 
 suppressedExceptions = {Collections$EmptyList@30505}  size = 0
 shadow$_klass_ = {Class@3092} "class java.lang.SecurityException"
 shadow$_monitor_ = 0

原因

実行した端末のOSがAndroid13で実行するとエラーになる様子(他のバージョンで試してないので本当かどうか不明)
https://stackoverflow.com/questions/76428518/securityexception-permission-denial-with-android-13-when-working-with-nfc

対応

targetSDKバージョンが31だったためとりあえず34に変更したらエラーが改善されました。

さいごに

バージョンによるエラーなどはAndroidはいまだに結構あるなと思うので複数端末で実行してエラー原因を特定することが大切

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?