question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ionic 4 build with flag prod

See original GitHub issue

Bug Report

Ionic version:

[x] 4.10.3

Current behavior: My project use ion-tabs and some ionic-native. It build Ok untill I build with flag prod: ionic cordova build android --prod. I run in my android device and it log bug ERROR Error: StaticInjectorError[t -> o]: StaticInjectorError(Platform: core)[t -> o]: NullInjectorError: No provider for o!

Steps to reproduce: Create fresh ionic tabs project $ ionic start myApp tabs --type=angular

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.10.3 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.1.0
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.4.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, resources
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 6 other plugins)

System:

   Android SDK Tools : 26.1.1 (/home/user/sdk-tools-linux-4333796)
   NodeJS            : v8.10.0 (/usr/bin/node)
   npm               : 6.8.0
   OS                : Linux 4.15

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
phamconganhcommented, Mar 9, 2019

@liamdebeasi, Thanks for your help, this issue has been resolved

1reaction
liamdebeasicommented, Mar 8, 2019

Hi @phamconganh,

You need to add all of the Ionic Native plugins you use in your app to your app.module.ts file. This includes @ionic-native/network, @ionic-native/geolocation, and @ionic-native/diagnostic.

Can you add those and then verify whether or not you are still seeing this issue?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does --prod flag do exactly? - Ionic Forum
--prod flag minimizes and optimizes your entire project to a single file depending on type. It also ignores plugins/imports which you have ...
Read more >
Ionic build: difference between --prod and --release flags?
Prod optimizes the code, Release makes it build in a different way so the app can be released to the stores. You have...
Read more >
ionic 4 build with flag prod · Issue #17707 - GitHub
My project use ion-tabs and some ionic-native. It build Ok untill I build with flag prod: ionic cordova build android --prod.
Read more >
Building an Ionic app using ConfigCat's Feature Flags
Having set our root page, we need to take care of the navigation for the other pages. This can be done using push...
Read more >
Improving Ionic app launch times - Mastering Ionic
By default ALL Ionic application builds are now non-AoT (since ... After adding the —prod flag (notice that it's TWO hyphens NOT one?)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found