Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Error when trying to get sim info on new Android device #98

Open
3 of 12 tasks
AndrewBargan opened this issue Jul 11, 2022 · 1 comment
Open
3 of 12 tasks

Error when trying to get sim info on new Android device #98

AndrewBargan opened this issue Jul 11, 2022 · 1 comment

Comments

@AndrewBargan
Copy link

AndrewBargan commented Jul 11, 2022

Expected behaviour

I'm using Ionic 5 and I want to get a real device phone number

Actual behaviour

I'm getting an error when trying to retrieve sim data

E/PluginManager: Uncaught exception from plugin
java.lang.SecurityException: getDataNetworkTypeForSubscriber
at android.os.Parcel.createExceptionOrNull(Parcel.java:2437)
at android.os.Parcel.createException(Parcel.java:2421)
at android.os.Parcel.readException(Parcel.java:2404)
at android.os.Parcel.readException(Parcel.java:2346)
at com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(ITelephony.java:9300)
at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3550)
at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3514)
at com.pbakondy.Sim.execute(Sim.java:157)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
at com.getcapacitor.MessageHandler.callCordovaPluginMethod(MessageHandler.java:123)
at com.getcapacitor.MessageHandler.postMessage(MessageHandler.java:61)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:186)
at android.os.Looper.loop(Looper.java:313)
at android.os.HandlerThread.run(HandlerThread.java:67)

  • iOS device
  • iOS simulator
  • Android device
  • Android emulator

I am using

  • cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Example: Samsung G980F (API 31)

To reproduce you can use https://github.com/AndrewBargan/cordova-plugin-sim-problem

To install on an real device use the following commands

npm i
ionic build
ionic cap run android --external

Look for error in Chrome console attached to the device or in the Android Studio Logcat console

@EYALIN
Copy link

EYALIN commented Apr 12, 2023

@AndrewBargan this has been fixed at my forked repo ( can see #99)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants