carrier_info icon indicating copy to clipboard operation
carrier_info copied to clipboard

Android 10 and lower exception

Open MoeHamdan opened this issue 2 years ago • 13 comments

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,

MoeHamdan avatar Jan 03 '23 12:01 MoeHamdan

+1

VitaliBov avatar Jan 26 '23 11:01 VitaliBov

+1

weter120 avatar Jan 26 '23 11:01 weter120

+1

PepelyaevDev avatar Jan 26 '23 11:01 PepelyaevDev

+1

Madico18 avatar Jan 26 '23 13:01 Madico18

+1

abddery avatar Jan 26 '23 18:01 abddery

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

pitazzo avatar Feb 17 '23 08:02 pitazzo

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

abdulmalekDery avatar Feb 17 '23 13:02 abdulmalekDery

I have the same issue, someone have a solution ?

Komche avatar Mar 18 '23 07:03 Komche

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

onghuisheng avatar Mar 31 '23 17:03 onghuisheng

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

@Zfinix

kirqe avatar Sep 01 '23 15:09 kirqe

@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.

onghuisheng avatar Sep 01 '23 17:09 onghuisheng

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

kirqe avatar Sep 06 '23 10:09 kirqe

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

Cannon99 avatar Oct 24 '23 00:10 Cannon99