Closed jcmartins closed 7 years ago
Because Ionic3 upgraded to Ionic-Native 3.x you'll need to update your imports where you're using ionic-native
.
All the doco is updated, which is what I used to update where I'm using stuff like SplashScreen, StatusBar, and Device.
I have the same issue. http://imgur.com/a/ei35J My ionic info:
Cordova CLI: 6.5.0 Ionic Framework Version: 3.0.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.3.0 ios-deploy version: 1.9.1 ios-sim version: 5.0.13 OS: macOS Sierra Node Version: v7.5.0 Xcode version: Xcode 8.3 Build version 8E162
Sorry guys. It was my fault. I was using: import { InAppBrowser } from 'ionic-native'; instead of: import { InAppBrowser } from '@ionic-native/in-app-browser';
Now everything works again
Yes, when you remove the ionic-native
dependency from package.json
, you remove the package so you have to remove it from your code.
Please take a look at the following blog for updating to Ionic Native 3.x: http://blog.ionic.io/ionic-native-3-x/
See step 4 of the steps to upgrade: https://github.com/driftyco/ionic/blob/master/CHANGELOG.md#steps-to-upgrade
And an example commit that shows the changes: https://github.com/driftyco/ionic-conference-app/commit/62088
If you are having issues with Ionic Native after this please open a new issue here: https://github.com/driftyco/ionic-native/issues
Thank you! 😄
I want to work in all versions like ionic 1, 2 and 3. So what's the solution ?
Use Ionic native 2.x for Ionic 1, and Ionic native 3.x for ionic 2+ http://blog.ionic.io/ionic-native-3-x/
@Sherbadshah
Hi, I have the same kind of problem with the new Ionic 3 framework hetting SQLite:
import { SQLite } from 'ionic-native'
I get the error " cannot find module 'ionic-native'"
What can i do to get the SQLite class with Ionic 3 ?
Thanks a lot !
The module is @ionic-native/sqlite
Wilson Hobbs CEO/Founder/Developer at Canal 11th Grade at The Lovett School
Personal Information E-mail: wilsonhobbs1@gmail.com Cell: (404) 719-3252 Website: www.wilsonhobbs.com (https://www.wilsonhobbs.com) Twitter/Instagram/Facebook: @wbhob
Canal Information E-mail: wilson@getcanal.com Web: www.getcanal.com (https://www.getcanal.com/)
Twitter/Instagram/Facebook: @getcanal
On Apr 17, 2017, 3:43 PM -0400, SVANNER notifications@github.com, wrote:
Hi, I have the same kind of problem with the new Ionic 3 framework hetting SQLite:
import { SQLite } from 'ionic-native'
I get the error " cannot find module 'ionic-native'"
What can i do to get the SQLite class with Ionic 3 ?
Thanks a lot !
— You are receiving this because you commented. Reply to this email directly, view it on GitHub (https://github.com/driftyco/ionic/issues/11091#issuecomment-294569825), or mute the thread (https://github.com/notifications/unsubscribe-auth/AEPIEjyHEIQBaHMA8MPmSU5FyqthqcEAks5rw8DggaJpZM4M1sIL).
Thanks a lot ! It Workshop !
i am still facing this issue where i have commented all the plugin related code in my pages and inside my app.module.ts file i have imported and added all the plugins inside my providers array also but still i am facing this issue check this http://stackoverflow.com/questions/43759991/ionic-3-type-any-is-not-a-constructor-function-type/43760070?noredirect=1#comment74561931_43760070 where i have placed a question and details about my project
I found my solution. You need to change at app.component.ts
Remove this:
import { StatusBar, Splashscreen } from 'ionic-native';
..and add this:
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
If you recently removed the node_modules, please reinstall those native plugins again at terminal/cmd:
$ npm install --save @ionic-native/status-bar
$ npm install --save @ionic-native/splash-screen
$ npm install --save @ionic-native/core
@payen83 thanks for this.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Ionic version: (check one with "x") [ ] 1.x [] 2.x [x]3.x
I'm submitting a ... (check one with "x") [x ] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
upgrade to version 3 Expected behavior:
Error: Cannot find module "ionic-native" at g (http://localhost:8100/build/polyfills.js:3:7133) at Object. (http://localhost:8100/build/main.js:107109:7)
at webpack_require (http://localhost:8100/build/main.js:20:30)
at Object. (http://localhost:8100/build/main.js:80974:73)
at webpack_require (http://localhost:8100/build/main.js:20:30)
at Object. (http://localhost:8100/build/main.js:119490:70)
at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
at http://localhost:8100/build/main.js:66:18
at http://localhost:8100/build/main.js:69:10
Steps to reproduce:
Related code:
Other information:
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):