You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/05/13 19:39:36 UTC

[GitHub] [cordova-android] LaurentiuGabriel opened a new issue #735: ionic cordova build android with prod flag fails unexpectedly

LaurentiuGabriel opened a new issue #735: ionic cordova build android with prod flag fails unexpectedly
URL: https://github.com/apache/cordova-android/issues/735
 
 
   # Bug Report
   
   When running ionic cordova build android --prod on my project it fails unexpectedly with the following issue:
   typescript error 
               Unexpected value 'null' declared by the module 'AppModule in app/app.module.ts'
   The following is the complete log with --verbose flag:
   
   ionic cordova build android --prod --verbose
     ionic:lib Terminal info: { tty: true, ci: false, windows: false } +0ms
     ionic:lib CLI global options: { _: [ 'cordova', 'build', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, prod: true, project: null, '--': [] } +11ms
     ionic:lib:project Project type from config: Ionic 2/3 (ionic-angular) +0ms
     ionic:lib:project Project details: { configPath: '/media/laur/project/ionic.config.json', errors: [], context: 'app', type: 'ionic-angular' } +1ms
     ionic Context: { binPath: '/home/laur/.config/versions/node/v8.3.0/lib/node_modules/ionic/bin/ionic', libPath: '/home/laur/.config/versions/node/v8.3.0/lib/node_modules/ionic', execPath: '/media/laur/project/', version: '4.10.3' } +0ms
     ionic:lib:integrations:cordova:config Using config.xml: /media/laur/project/config.xml +0ms
     ionic:lib:telemetry Sending telemetry for command: 'ionic cordova build' [ 'android', '--prod', '--verbose', '--interactive', '--color' ] +0ms
     ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
     ionic:lib:project:ionic-angular:build Looking for ionic:build npm script. +0ms
     ionic:lib:project:ionic-angular:build Found ionic:build, but it is the default. Not running. +7ms
   > ionic-app-scripts build --prod --target cordova --platform android
   [22:09:26]  ionic-app-scripts 3.2.1 
   [22:09:26]  build prod started ... 
   [22:09:26]  clean started ... 
   [22:09:26]  clean finished in 3 ms 
   [22:09:26]  copy started ... 
   [22:09:27]  deeplinks started ... 
   [22:09:27]  deeplinks finished in 270 ms 
   [22:09:27]  ngc started ... 
   [22:09:41]  typescript error 
               Unexpected value 'null' declared by the module 'AppModule
   
   When running the same command using --release flag, it works and it generates the .apk file. 
   
   ### What is expected to happen?
   
   I expect to get the .apk file after running the command.
   
   ### What does actually happen?
   
   The .apk isn't generated as it is when using the release flag. Also, no detailed information is displayed about the issue even when using the verbose flag. I have found some info on some stackoverflow threads about using ionic serve before running this command. I tried this as well but with no luck. 
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   Here is the app.module.ts file that I use: 
   
   import { BrowserModule } from '@angular/platform-browser';
   import { ErrorHandler, NgModule } from '@angular/core';
   import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
   import { SplashScreen } from '@ionic-native/splash-screen';
   import { HttpModule, JsonpModule } from '@angular/http';
   import { StatusBar } from '@ionic-native/status-bar';
   import { MyApp } from './app.component';
   import { HomePage } from '../pages/home/home';
   import { HelpPage } from "../pages/help/help";
   import { IngredientsPage } from '../pages/ingredients/ingredients';
   import RecipesPage from '../pages/recipes/recipes';
   import { EdamamApiProvider } from '../providers/edamam-api/edamam-api';
   import { File } from '@ionic-native/file';
   import { IonicStorageModule } from '@ionic/storage';
   import { PreferencesPage } from '../pages/preferences/preferences';
   import { SQLite } from '@ionic-native/sqlite';
   import { NutritionCalculatorComponent } from '../components/nutrition-calculator/nutrition-calculator';
   import { RecipesSingleton } from '../pages/recipes/recipesSingleton';
   
   @NgModule({
     declarations: [
       MyApp,
       HomePage,
       IngredientsPage,
       RecipesPage,
       HelpPage,
       PreferencesPage,
       NutritionCalculatorComponent
     ],
     imports: [
       BrowserModule,
       IonicModule.forRoot(MyApp),
       HttpModule,
       JsonpModule,
       IonicStorageModule.forRoot()
     ],
     bootstrap: [IonicApp],
     entryComponents: [
       MyApp,
       HomePage,
       IngredientsPage,
       RecipesPage,
       HelpPage,
       PreferencesPage
     ],
     providers: [
       StatusBar,
       SplashScreen,
       {provide: ErrorHandler, useClass: IonicErrorHandler},
       EdamamApiProvider,
       File,
       {provide: ErrorHandler, useClass: IonicErrorHandler},
       SQLite,
       RecipesSingleton
     ]
   })
   export class AppModule {}
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   ionic cordova build android --prod
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   Command was performed from my Ubuntu machine v.18.04. Issue reproducible only on Android. 
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   I'm using ionic cli 4.10.3, android studio 24.4, cordova 8.0.0
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org