TheCocoaProject / cordova-plugin-nativestorage

Cordova plugin: Native storage of variables in Android, iOS and Windows
http://thecocoaproject.github.io/
Apache License 2.0
292 stars 106 forks source link

Class not found error when using NativeStorage.getItem or setItem #131

Open webnoob opened 5 years ago

webnoob commented 5 years ago

Hi,

Using the following code:

      NativeStorage.getItem('counter', r => {
        console.log('RES: ' + r)
      }, e => {
        console.log('ERROR: ' + e.code)
      })

I always get ERROR: Class not found. What could cause this?

Note: I've seen the other post on this issue and re-build didn't resolve it. I'm running the app in cordova dev mode on an android emulator running version 8.0 of android and 2.3.2 of this plugin.

benag commented 5 years ago

did you solve this?

webnoob commented 5 years ago

No...

alokrajiv commented 5 years ago

Just to confirm, you are running this after the deviceready event yes?

webnoob commented 5 years ago

Correct, yes.

GillesC commented 5 years ago

Could you also provide the 'source' and 'exception' as per NativeStorageError?

syntheticgoo commented 5 years ago

Resolved for me with platform remove -> platform add (like almost everything in Ionic).

rolinger commented 5 years ago

I started getting this error this week too - on both of my two test phones. I will remove/add platform and report back