Zfinix / carrier_info

📱 Carrier Info gets networkType, networkGeneration, mobileCountryCode, mobileCountryCode, e.t.c from both android and iOS devices.
MIT License
34 stars 48 forks source link

Android 10 and lower exception #26

Open MoeHamdan opened 1 year ago

MoeHamdan commented 1 year ago

Hello

I am getting this error for Android 10 and lower.

java.lang.NoSuchMethodError: No virtual method getSubscriptionId()I in class Landroid/telephony/TelephonyManager; or its super classes (declaration of 'android.telephony.TelephonyManager' appears in /system/framework/framework.jar!classes2.dex).

Also why did not you set the version to 3 upon doing the breaking changes?

Thanks,

VitaliBov commented 1 year ago

+1

weter120 commented 1 year ago

+1

PepelyaevDev commented 1 year ago

+1

Madico18 commented 1 year ago

+1

abddery commented 1 year ago

+1

pitazzo commented 1 year ago

+1, any new on this? Any lower version of the plugin works on Android 10?

abdulmalekDery commented 1 year ago

No it will not be supported anymore because Android policy blocked the access to that content

Komche commented 1 year ago

I have the same issue, someone have a solution ?

onghuisheng commented 1 year ago

Hello

I am getting this error for Android 10 and lower.

java.lang.NoSuchMethodError: No virtual method getSubscriptionId()I in class Landroid/telephony/TelephonyManager; or its super classes (declaration of 'android.telephony.TelephonyManager' appears in /system/framework/framework.jar!classes2.dex).

Also why did not you set the version to 3 upon doing the breaking changes?

Thanks,

should be fixed on the latest commit in main

kirqe commented 1 year ago

@onghuisheng when do you plan to publish it to pub.dev?

@Zfinix

onghuisheng commented 1 year ago

@onghuisheng when do you plan to publish it to pub.dev?

@Zfinix

The author seems to be inactive, my pull request is also still pending.

Meanwhile you can try using my fork with the fixes by updating pubspec.yaml. More info here.

Fork link.

kirqe commented 1 year ago

Also, the values in telephonyInfo are always empty on android 10. Works for 13 though

List (1 item)
[0]:
TelephonyInfo (TelephonyInfo(networkCountryIso: , mobileCountryCode: , mobileNetworkCode: , displayName: , simState: , isoCountryCode: , cellId: CellId(cid: 0, lac: 0), phoneNumber: , carrierName: , subscriptionId: 0, networkGeneration: , radioType: , networkOperatorName: ))
carrierName: ""
cellId:
CellId (CellId(cid: 0, lac: 0))
displayName: ""
isoCountryCode:""
mobileCountryCode:""
mobileNetworkCode:""
networkCountryIso:""
networkGeneration:""
networkOperatorName:""
phoneNumber:""
radioType:""
simState:""
subscriptionId:0
hashCode:1
runtimeType:

edit: Ended up not using this package

Cannon99 commented 1 year ago

Hey guys, i have forked and adjusted that bugs and handled the library for android 6.0 and higher. I have ignored the cellId field, but the library worked for all android devices on my tests. Feel free to take a look.

https://github.com/Cannon99/carrier_info