Cordova plugin is already installed. But gives error that, Sim plugin is not installed


#1

I added Ionic native sim plugin to newly created app. After it is installed (ionic cordova run android --device), it works fine and gives the following console log.

sim1

Then I close the app and started it again. Then it gives the following error.

sim2

I checked the plugin list of my app and it listed following.

C:\My\myApp>cordova plugin list
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.1.19 "cordova-plugin-ionic-webview"
cordova-plugin-sim 1.3.3 "SIM"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"

What is the reason? Please hep me.
There are similar problems regarding this. But they did not resolve my problem.


#2

Hi, this is just an assumption, but still

Try to execute your code in ready block

$ionicPlatform.ready(function () {
    Right here if you are using ionic 1
}):

OR in app.component.ts in ready block

platform.ready().then(() => {
    Right here if you are using ionic 3
});

I think code runs before the app is fully initialized.
Hope would help.


#3

Thanks for the help. Now it works fine.

But here are some information missing than gives in previous results. (my English is bad. if you did’t understand ask me.) Here is the screen shot of new result object. Missing field are highlighted.

sim3


#4

Are you using ios emulator to get this result?


#5

No. I’m using android.


#6

I have never used this plugin before…
Listen, open the plugin page https://github.com/pbakondy/cordova-plugin-sim and look for Android Quirks section. It says it might be due you our API levels. I wish I can tell more.


#7

Also, I recommend not to use emulators but plug your phone via usb.
For ionic 3 I run ionic cordova run android --livereload --consolelogs to test what is going on.


#8

Thanks for your kind cooperation.

But I got the highlighted results in the previous build. I didn’t change any thing and just add the code into

platform.ready().then(() => {
    Right here if you are using ionic 3
});

Now I didn’t get the result. It’s OK. I’ll try it more.