odemolliens / react-native-sim-cards-manager

React Native plugin to manage Sim card(s) & eSim
MIT License
67 stars 29 forks source link

App Crash in android - Huawei - Android 7 #51

Closed SamiYousef closed 1 year ago

SamiYousef commented 1 year ago

Exception in HostObject::get for prop 'SimCardsManager': java.lang.NoClassDefFoundError: android.telephony.euicc.EuiccManager

odemolliens commented 1 year ago

EuiccManager added in API level 28

SamiYousef commented 1 year ago

Should I upgrade minSdkVersion to 28, or do you recommend other solutions to fix the crash?

beqramo commented 7 months ago

HI @odemolliens , I have same issue, what should I do if user's device API is less than 28? Or I should not call the SDK if it is less than28?

Neeal20 commented 5 months ago

Did you manage to find something working ? Application is crashing on every device Android 8 and less even with condition isEsimSupported to false

Neeal20 commented 5 months ago

Solution is :

let SimCardsManagerModule
  if ((Platform.OS === 'android' && Platform.Version >= 28)) {
     SimCardsManagerModule = require('react-native-sim-cards-manager').default
  }