danielsogl / awesome-cordova-plugins

Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support.
https://danielsogl.gitbook.io/awesome-cordova-plugins/
Other
2.41k stars 2.43k forks source link

Ionic SecureStorage: Running on Android Uncaught Syntax Error "_native: Can't resolve all parameters..." #1300

Closed amymarsh4work closed 7 years ago

amymarsh4work commented 7 years ago

After moving to ionic-native 3 core and reinstalling the SecureStorage plugin, I'm getting the following error (below). The project won't even load onto the phone. Things I've tried that didn't help:

I could repro the problem in all cases. I'm out of ideas now, so I'm reporting it.

package.json "dependencies": { "@angular/common": "2.4.8", "@angular/compiler": "2.4.8", "@angular/compiler-cli": "2.4.8", "@angular/core": "2.4.8", "@angular/forms": "2.4.8", "@angular/http": "2.4.8", "@angular/platform-browser": "2.4.8", "@angular/platform-browser-dynamic": "2.4.8", "@angular/platform-server": "2.4.8", "@ionic-native/core": "3.3.0", "@ionic-native/secure-storage": "3.3.0", "@ionic-native/splash-screen": "3.3.0", "@ionic-native/status-bar": "3.3.0", "@ionic/storage": "2.0.0", "ionic-angular": "2.3.0", "ionicons": "3.0.0", "rxjs": "5.0.1", "sw-toolbox": "3.4.0", "zone.js": "0.7.2" }

Ionic Info: Cordova CLI: 6.1.1 Ionic Framework Version: 2.3.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.1.4 ios-deploy version: 1.8.6 ios-sim version: 5.0.8 OS: OS X El Capitan Node Version: v6.9.1 Xcode version: Xcode 7.3 Build version 7D175

Error: Uncaught Syntax Error > _nativeError: Can't resolve all parameters for SecureStorageObject: (?). at v (file:///android_asset/www/build/polyfills.js:3:4864) at SyntaxError.BaseError [as constructor] (file:///android_asset/www/build/main.js:136720:27) at new SyntaxError (file:///android_asset/www/build/main.js:12515:16) at CompileMetadataResolver._getDependenciesMetadata (file:///android_asset/www/build/main.js:27393:31) at CompileMetadataResolver._getTypeMetadata (file:///android_asset/www/build/main.js:27268:26) at CompileMetadataResolver._getInjectableMetadata (file:///android_asset/www/build/main.js:27256:21) at CompileMetadataResolver.getProviderMetadata (file:///android_asset/www/build/main.js:27498:40) at file:///android_asset/www/build/main.js:27456:49 at Array.forEach (native) at CompileMetadataResolver._getProvidersMetadata (file:///android_asset/www/build/main.js:27423:19) at CompileMetadataResolver.getNgModuleMetadata (file:///android_asset/www/build/main.js:27107:50) at JitCompiler._loadModules (file:///android_asset/www/build/main.js:73859:64) at JitCompiler._compileModuleAndComponents (file:///android_asset/www/build/main.js:73819:52) at JitCompiler.compileModuleAsync (file:///androidasset/www/build/main.js:73785:21) at PlatformRef._bootstrapModuleWithZone (file:///android_asset/www/build/main.js:53628:25)

ihadeed commented 7 years ago

You only need to inject SecureStorage. You shouldn't inject SecureStorageObject.

amymarsh4work commented 7 years ago

Ibby, Thanks for your prompt reply. I removed SecureStorageObject from the providers array and it worked fine. :)