Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

app forcefully closed with this error on os version < 21 #2

Open
karan101292 opened this issue Sep 19, 2017 · 3 comments
Open

app forcefully closed with this error on os version < 21 #2

karan101292 opened this issue Sep 19, 2017 · 3 comments

Comments

@karan101292
Copy link

app forcefully closed with this error on os version < 21

com.facebook.react.common.JavascriptException: C++ Exception in 'NativeModules': java.lang.NoSuchMethodError: android.telephony.TelephonyManager.getPhoneCount

react native - v44

@pocesar
Copy link
Owner

pocesar commented Sep 19, 2017

although TelephonyManager is available since API 1, that call doesn't exists in the current code. try doing a cd android && ./gradlew clean and unlinking and re-linking the library

SubscriptionManager on the other hand need at least API 22 level

@karan101292
Copy link
Author

Yes SubscriptionManager needs API 22. so in that case, this module will not work in phones with API less than 22. or is there any workaround?

@pocesar
Copy link
Owner

pocesar commented Sep 19, 2017

you can use TelephonyManager.getLine1Number but the person needs to have set his own number on the phone in "phone identity" and most people don't

best (sure) way is to ask the person for his number then read from SMS

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