Comments (6)
After analysing the app.component.ts
file, I found that it's quite outdated? Since it still requires the old Ionic 2.x ionic-native
module.
Better stay off of this outdated super template.
See Issue about not compatible with 3.0.1 #86 and the Pull requests #95 and #84
But to remove this error we need to change...
src/app/app.component.ts
import { StatusBar, Splashscreen } from '`ionic-native';
...
constructor(translate: TranslateService, platform: Platform, settings: Settings, config: Config) {
...
StatusBar.styleDefault();
Splashscreen.hide();
with
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
...
constructor(translate: TranslateService, platform: Platform, settings: Settings, config: Config, statusBar: StatusBar, splashScreen: SplashScreen) {
...
statusBar.styleDefault();
splashScreen.hide();
Then run
$ ionic plugin add cordova-plugin-camera
$ npm install --save @ionic-native/camera
$ ionic plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"
$ npm install --save @ionic-native/google-maps
src/pages/item-create/item-create.ts
import { Camera } from 'ionic-native';
...
constructor(public navCtrl: NavController, public viewCtrl: ViewController, formBuilder: FormBuilder) {
...
getPicture() {
if (Camera['installed']()) {
Camera.getPicture({
to
import { Camera } from '@ionic-native/camera';
...
constructor(public navCtrl: NavController, public viewCtrl: ViewController, formBuilder: FormBuilder, private camera: Camera) {
...
getPicture() {
if (Camera['installed']()) {
this.camera.getPicture({
src/pages/map/map.ts
Then change in the file the lines, from
import { GoogleMap, GoogleMapsLatLng } from 'ionic-native';
...
constructor(public navCtrl: NavController, public platform: Platform) {}
...
GoogleMap.isAvailable().then(() => {
const position = new GoogleMapsLatLng(43.074395, -89.381056);
to
import { GoogleMap, GoogleMaps, LatLng } from '@ionic-native/google-maps';
...
constructor(public navCtrl: NavController, public platform: Platform, private googleMaps: GoogleMaps) {}
...
this.googleMaps.isAvailable().then(() => {
const position = new LatLng(43.074395, -89.381056);
And comment out the entire content of src/app/main.prod.ts
Angular now will complain about Components error and will not render anything.
So, as I said before, better stay out from this super template, and use it only for reference for now.
from ionic-starter-super.
Hey @manuelfink, with the next release, this template uses the latest native version.
from ionic-starter-super.
Same issue here.
Noticed that the old package ionic-native
is not installed nor saved in the dependencies as in my other Ionic (old v2.x) projects.
So I tried and executed npm install ionic-native --save
, but it didn't worked either (I had to try at least).
Ended up with the following package.json (fragment):
"@ionic-native/core": "3.4.2",
"@ionic-native/splash-screen": "3.4.2",
"@ionic-native/status-bar": "3.4.2",
"@ionic/storage": "2.0.1",
"ionic-angular": "3.0.1",
"ionic-native": "^3.5.0",
from ionic-starter-super.
confirmed.
from ionic-starter-super.
Guys, I am also facing same issue
Uncaught Error: Cannot find module "ionic-native"
at Object.276 (main.js:617)
at webpack_require (bootstrap 55c373d479ee4bd0c837:54)
at Object.219 (main.ts:5)
at webpack_require (bootstrap 55c373d479ee4bd0c837:54)
at Object.196 (main.js:249)
at webpack_require (bootstrap 55c373d479ee4bd0c837:54)
at webpackJsonpCallback (bootstrap 55c373d479ee4bd0c837:25)
at main.js:1
Any Help to resolve this issue
from ionic-starter-super.
@PRINCEHR
You should post more info like the original poster (versions, OS, etc that the CLI prints). Research how to do it (hint: use ionic info
). Also try updating your global ionic CLI, and try on a new clean project.
Then either open a new ticket and/or reference this ticket.
from ionic-starter-super.
Related Issues (20)
- Warning: Can't resolve all parameters for Settings in src/providers/settings.ts: ([object Object], ?). This will become an error in Angular v5.x HOT 5
- Google Maps display a blanc screen
- Too slow to load ! White screen shows up for 10 seconds even after the splash screen. HOT 4
- Question: Use Lazy Loading For Pages HOT 3
- maps.ts and item-create.ts can't work out of the box because of missing Cordova plugins
- How to show tutorial once and skip the next one HOT 1
- User.prototype.login HOT 2
- Animal List Misses Albert Albatros HOT 2
- Broken template due to erroneous commit HOT 2
- clone HOT 3
- search is deprecated HOT 14
- Closed Issue
- ionViewDidLoad in app component doesn't get called HOT 2
- Check if source is cordova after platform.ready() HOT 3
- An Android apk couldn't be done with "ionic cordova build android --prod --release" HOT 7
- [ERROR]Using HttpParams Class has Error (ionic-starter-super/src/providers/api/api.ts)
- add function enableProdMode HOT 1
- Firefox search doesn't work HOT 11
- Send JWT HOT 6
- Cant use custom pipe globally HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-starter-super.