访问设备所有者应用程序Android 10的getDeviceID()?

访问设备所有者应用程序Android 10的getDeviceID()?,android,imei,device-owner,android-device-owner,Android,Imei,Device Owner,Android Device Owner,我有很多手机需要在IMEI条形码数据库中注册,并在上面安装一个公司应用程序来连接和跟踪它们。为此,我需要使用getDeviceID()访问IMEI。自从安卓10以来,它就不再那么简单了 在这个页面中,Android说如果你是设备所有者,你可以访问它: 我使用此方法使我的应用成为设备所有者应用: 当我在应用程序中使用getDeviceId()时,仍然存在以下错误: java.lang.SecurityException: getDeviceId: The user 10180 does not

我有很多手机需要在IMEI条形码数据库中注册,并在上面安装一个公司应用程序来连接和跟踪它们。为此,我需要使用getDeviceID()访问IMEI。自从安卓10以来,它就不再那么简单了

在这个页面中,Android说如果你是设备所有者,你可以访问它:

我使用此方法使我的应用成为设备所有者应用:

当我在应用程序中使用getDeviceId()时,仍然存在以下错误:

 java.lang.SecurityException: getDeviceId: The user 10180 does not meet the requirements to access device identifiers.
为什么这个方法不起作用? 您对IMEI有什么建议吗?

您需要
 java.lang.SecurityException: getDeviceId: The user 10180 does not meet the requirements to access device identifiers.