Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throwing error and returning null on Mobile phone wihtout SimCard injected #33

Open
AymenXD opened this issue May 16, 2023 · 7 comments

Comments

@AymenXD
Copy link

AymenXD commented May 16, 2023

When Trying on a phone where there is no sim card injected, the package throws this error :

PlatformException(no_carrier_name, No carrier name, java.lang.StringIndexOutOfBoundsException: length=0; index=3, null)

@onghuisheng
Copy link
Contributor

onghuisheng commented May 16, 2023

will take a look this week, may I know which commit are you using?

@AymenXD
Copy link
Author

AymenXD commented May 16, 2023

I am using the latest commit of version 2.0.8 .
Anyways good job on the plugin, You did a great one !!!!! Keep up the good work.

@onghuisheng
Copy link
Contributor

onghuisheng commented May 16, 2023

can you try replacing this line in pubspec. yaml

  carrier_info: 2.0.8

with these 2 lines:

  carrier_info: 
     git: https://github.com/Zfinix/carrier_info.git

and see if it works?

@AymenXD
Copy link
Author

AymenXD commented May 16, 2023

Still the same problem unfortunately :/
You can reproduce this error by simply removing all the Sim Cards from your Android phone and then running the plugin example.

@onghuisheng
Copy link
Contributor

onghuisheng commented May 21, 2023

Still the same problem unfortunately :/ You can reproduce this error by simply removing all the Sim Cards from your Android phone and then running the plugin example.

I'm unable to repro this issue even when using a device with no sim card inserted.

Did you ran flutter pub get or flutter pub upgrade after changing pubspec.yaml to this?

  carrier_info: 
     git: https://github.com/Zfinix/carrier_info.git

Also, may I know which Android version that you're using?

@alfaruqrizqi18
Copy link

facing same issue

@alfaruqrizqi18
Copy link

Still the same problem unfortunately :/ You can reproduce this error by simply removing all the Sim Cards from your Android phone and then running the plugin example.

I'm unable to repro this issue even when using a device with no sim card inserted.

Did you ran flutter pub get or flutter pub upgrade after changing pubspec.yaml to this?

  carrier_info: 
     git: https://github.com/Zfinix/carrier_info.git

Also, may I know which Android version that you're using?

Try this solution

  • Android 12
  • Flutter (Channel stable, 3.3.2, on Microsoft Windows [Version 10.0.19042.1165], locale en-ID)
    image

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

No branches or pull requests

3 participants