Skip to content

Error : ionic cordova build android #15903

@baljeetkalsi

Description

@baljeetkalsi

C:\IonicApp\LIMSApp>ionic cordova build android

ionic-app-scripts build --target cordova --platform android
[11:06:48] ionic-app-scripts 3.2.0
[11:06:48] build dev started ...
[11:06:49] clean started ...
[11:06:49] clean finished in 25 ms
[11:06:49] copy started ...
[11:06:49] copy finished in 573 ms
[11:06:49] deeplinks started ...
[11:06:49] deeplinks finished in 180 ms
[11:06:49] transpile started ...
[11:07:02] transpile finished in 12.61 s
[11:07:02] preprocess started ...
[11:07:02] preprocess finished in 1 ms
[11:07:02] webpack started ...
[11:07:10] webpack finished in 8.43 s
[11:07:10] sass started ...
[11:07:18] sass finished in 7.73 s
[11:07:18] postprocess started ...
[11:07:18] postprocess finished in 28 ms
[11:07:18] lint started ...
[11:07:18] build dev finished in 29.66 s
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/services/lims.services.ts, line: 2
'Http' is declared but never used.

   L1:  import { Injectable } from '@angular/core';

[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/services/lims.services.ts, line: 2
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/services/misc.ts, line: 14
L2: import { Http, Response, Headers } from '@angular/http';
L3: import 'rxjs/Rx';

        'Response' is declared but never used.

   L1:  import { Injectable } from '@angular/core';
   L2:  import { Http, Response, Headers } from '@angular/http';
   L3:  import 'rxjs/Rx';

        'disconnectSubscription' is declared but never used.

  L13:  // watch network for a disconnect
  L14:  let disconnectSubscription = this.network.onDisconnect().subscribe(() => {
  L15:      console.log('network was disconnected :-(');

[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/services/misc.ts, line: 18
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/components/esa-control/esa-control.ts, line: 62
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/components/esa-control/esa-control.ts, line: 70
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/components/esa-control/esa-control.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/components/esa-control/esa-control.ts, line: 9
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/components/esa-control/esa-control.ts, line: 9
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/recentlyAddedList/recentlyAddedList.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/branchSelection/branchSelection.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/branchSelection/branchSelection.ts, line: 9
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/branchSelection/branchSelection.ts, line: 10
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/branchSelection/branchSelection.ts, line: 11
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/branchSelection/branchSelection.ts, line: 12
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/login/login.ts, line: 65
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/login/login.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/login/login.ts, line: 2
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/login/login.ts, line: 11
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/app/app.module.ts, line: 25
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/app/app.module.ts, line: 34
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/asphalt/asphalt.ts, line: 192
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/asphalt/asphalt.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/asphalt/asphalt.ts, line: 8

        'connectSubscription' is declared but never used.

  L18:              let connectSubscription = this.network.onConnect().subscribe(() => {
  L19:                  console.log('network connected!');

        'projectNumberBlur' is declared but never used.

  L62:      private projectNumberBlur(projectNumber: string) {
  L63:          if (this.assignmentID == 0 || this.assignmentID == undefined || this.assignmentID == null) {

        'esaData' is declared but never used.

  L69:  this.loading('Fetching project Data..');
  L70:  let esaData = this.limsService.getESAData(projectNumber).subscribe((data) => {
  L71:      this.loader.dismiss();

        'OnInit' is declared but never used.

   L1:  import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

        'CompleterService' is declared but never used.

   L8:  //Autocomplete textbox
   L9:  import { CompleterService, CompleterData, CompleterItem } from 'ng2-completer';

        'CompleterData' is declared but never used.

   L8:  //Autocomplete textbox
   L9:  import { CompleterService, CompleterData, CompleterItem } from 'ng2-completer';

        'OnInit' is declared but never used.

   L1:  import { Component, OnInit } from '@angular/core';
   L2:  import { NavController, NavParams } from 'ionic-angular';

        'OnInit' is declared but never used.

   L1:  import { Component, OnInit } from '@angular/core';
   L2:  import { NavController, LoadingController } from 'ionic-angular';

        All imports on this line are unused.

   L9:  import { ESA } from '../../shared/models/esa';
  L10:  import { Supplier } from '../../shared/models/Supplier';

        All imports on this line are unused.

   L9:  import { ESA } from '../../shared/models/esa';
  L10:  import { Supplier } from '../../shared/models/Supplier';
  L11:  import { AggregateSupplier } from '../../shared/models/AggregateSupplier';

        All imports on this line are unused.

  L10:  import { Supplier } from '../../shared/models/Supplier';
  L11:  import { AggregateSupplier } from '../../shared/models/AggregateSupplier';
  L12:  import { Plant } from '../../shared/models/Plant';

        All imports on this line are unused.

  L11:  import { AggregateSupplier } from '../../shared/models/AggregateSupplier';
  L12:  import { Plant } from '../../shared/models/Plant';

        'a' is declared but never used.

  L65:      let a = this.nativeStorage.getItem('userName').then(data => {
  L66:        if (data) {

        'OnInit' is declared but never used.

   L1:  import { Component, OnInit } from '@angular/core';
   L2:  import { FormBuilder, Validators } from '@angular/forms';

        'FormBuilder' is declared but never used.

   L1:  import { Component, OnInit } from '@angular/core';
   L2:  import { FormBuilder, Validators } from '@angular/forms';
   L3:  import { NavController, NavParams, LoadingController, ToastController, Platform } from 'ionic-angular';

        All imports on this line are unused.

  L11:  import { BranchSelectionPage } from '../../pages/branchSelection/branchSelection';
  L12:  import { HomePage } from '../../pages/home/home';

        'CameraOptions' is declared but never used.

  L24:  import { Network } from '@ionic-native/network';
  L25:  import { Camera, CameraOptions } from '@ionic-native/camera';

        All imports on this line are unused.

  L33:  import { Misc } from '../shared/services/misc';
  L34:  import {loud }  from 'loud-rejection/register';

        'labnumber' is declared but never used.

 L192:            let labnumber = this.limsService.saveCarddata(this.carddata).subscribe(data => {
 L193:              if (data["_body"] != 44 && data["_body"] != 22 && data["_body"] != 11) {

        'OnInit' is declared but never used.

   L1:  import { Component, OnInit, ViewChild } from '@angular/core';
   L2:  import { Platform, LoadingController, NavParams } from 'ionic-angular';

        All imports on this line are unused.

   L8:  import { EsaControl } from '../../components/esa-control/esa-control';
   L9:  import { PictureControl } from '../../components/picture-control/picture-control';

        All imports on this line are unused.

   L8:  import { EsaControl } from '../../components/esa-control/esa-control';
   L9:  import { PictureControl } from '../../components/picture-control/picture-control';
  L10:  import { Database } from '../../shared/database/limsDB.services';

        'labnumber' is declared but never used.

 L191:            let labnumber = this.limsService.saveCarddata(this.carddata).subscribe(data => {
 L192:              if (data["_body"] != 44 && data["_body"] != 22 && data["_body"] != 11) {

        'OnInit' is declared but never used.

   L1:  import { Component, OnInit, ViewChild } from '@angular/core';
   L2:  import { Platform, LoadingController, NavParams } from 'ionic-angular';

        All imports on this line are unused.

  L14:  import { EsaControl } from '../../components/esa-control/esa-control';
  L15:  import { PictureControl } from '../../components/picture-control/picture-control';

        All imports on this line are unused.

  L14:  import { EsaControl } from '../../components/esa-control/esa-control';
  L15:  import { PictureControl } from '../../components/picture-control/picture-control';
  L16:  import { Database } from '../../shared/database/limsDB.services';

        'labnumber' is declared but never used.

 L180:            let labnumber = this.limsService.saveCarddata(this.carddata).subscribe(data => {
 L181:              if (data["_body"] != 44 && data["_body"] != 22 && data["_body"] != 11) {

        'OnInit' is declared but never used.

   L1:  import { Component, OnInit, ViewChild } from '@angular/core';
   L2:  import { Platform, LoadingController, NavParams } from 'ionic-angular';

        All imports on this line are unused.

  L13:  import { EsaControl } from '../../components/esa-control/esa-control';
  L14:  import { PictureControl } from '../../components/picture-control/picture-control';

        All imports on this line are unused.

  L13:  import { EsaControl } from '../../components/esa-control/esa-control';
  L14:  import { PictureControl } from '../../components/picture-control/picture-control';
  L15:  import { Database } from '../../shared/database/limsDB.services';

        'dateNow' is declared but never used.

 L143:          let dateNow = new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' +
 L144:          this.mouldtype = 'Plastic';

        'labnumber' is declared but never used.

 L280:                      let labnumber = this.limsService.saveCarddata(this.carddata).subscribe(data => {
 L281:                          if (data["_body"] != 44 && data["_body"] != 22 && data["_body"] != 11) {

        'OnInit' is declared but never used.

   L1:  import { Component, OnInit, Input, ViewChild } from '@angular/core';

        'Input' is declared but never used.

[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/asphalt/asphalt.ts, line: 9
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/aggregates/aggregates.ts, line: 191
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/aggregates/aggregates.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/aggregates/aggregates.ts, line: 14
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/aggregates/aggregates.ts, line: 15
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/soil/soil.ts, line: 180
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/soil/soil.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/soil/soil.ts, line: 13
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/soil/soil.ts, line: 14
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/concreteEntry/concreteEntry.ts, line: 143
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/concreteEntry/concreteEntry.ts, line: 280
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/concreteEntry/concreteEntry.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/concreteEntry/concreteEntry.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/concreteEntry/concreteEntry.ts, line: 8
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/concreteEntry/concreteEntry.ts, line: 15
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/pages/concreteEntry/concreteEntry.ts, line: 16
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/database/limsDB.services.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/database/limsDB.services.ts, line: 1
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/database/limsDB.services.ts, line: 3
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/database/limsDB.services.ts, line: 5
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/database/limsDB.services.ts, line: 7
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/database/limsDB.services.ts, line: 8
[11:07:22] tslint: C:/IonicApp/LIMSApp/src/shared/database/limsDB.services.ts, line: 9
L1: import { Component, OnInit, Input, ViewChild } from '@angular/core';

        All imports on this line are unused.

   L7:  import { Carddata } from '../../shared/models/carddata';
   L8:  import { ESA } from '../../shared/models/esa';
   L9:  import { EMITOR } from '../../shared/models/esaEmitor';

        All imports on this line are unused.

  L15:  import { EsaControl } from '../../components/esa-control/esa-control';
  L16:  import { PictureControl } from '../../components/picture-control/picture-control';

        All imports on this line are unused.

  L15:  import { EsaControl } from '../../components/esa-control/esa-control';
  L16:  import { PictureControl } from '../../components/picture-control/picture-control';

        'Component' is declared but never used.

   L1:  import { Component, OnInit,Injectable } from '@angular/core';
   L2:  import 'rxjs/Rx';

        'OnInit' is declared but never used.

   L1:  import { Component, OnInit,Injectable } from '@angular/core';
   L2:  import 'rxjs/Rx';

        All imports on this line are unused.

   L2:  import 'rxjs/Rx';
   L3:  import { Observable } from 'rxjs/Rx';

        All imports on this line are unused.

   L5:  import { ESA } from '../../shared/models/esa';
   L6:  import { Carddata } from '../../shared/models/carddata';

        All imports on this line are unused.

   L6:  import { Carddata } from '../../shared/models/carddata';
   L7:  import { Supplier } from '../../shared/models/Supplier';
   L8:  import { AggregateSupplier } from '../../shared/models/AggregateSupplier';

        All imports on this line are unused.

   L7:  import { Supplier } from '../../shared/models/Supplier';
   L8:  import { AggregateSupplier } from '../../shared/models/AggregateSupplier';
   L9:  import { Plant } from '../../shared/models/Plant';

        All imports on this line are unused.

   L8:  import { AggregateSupplier } from '../../shared/models/AggregateSupplier';
   L9:  import { Plant } from '../../shared/models/Plant';
  L10:  import { SQLite, SQLiteObject } from '@ionic-native/sqlite';

[11:07:22] lint finished in 4.31 s

cordova build android
ANDROID_HOME=C:\Users\User\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111
Subproject Path: CordovaLib
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_37gjnchx8d34xfpky3sjwuytk.run(C:\IonicApp\LIMSApp\platforms\android\build.gradle:141)
Configuration 'compile' in project ':' is deprecated. Use 'implementation' instead.
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
:preBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:compileDebugAidl UP-TO-DATE
:CordovaLib:packageDebugRenderscript NO-SOURCE
:compileDebugRenderscript UP-TO-DATE
:checkDebugManifest UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:prepareLintJar UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:createDebugCompatibleScreenManifests UP-TO-DATE
:processDebugManifest UP-TO-DATE
:splitsDiscoveryTaskDebug UP-TO-DATE
:CordovaLib:platformAttrExtractor UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:prepareLintJar UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:javaPreCompileDebug UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes NO-SOURCE
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
:javaPreCompileDebug UP-TO-DATE
:compileDebugJavaWithJavac UP-TO-DATE
:compileDebugNdk NO-SOURCE
:compileDebugSources UP-TO-DATE
:mergeDebugShaders UP-TO-DATE
:compileDebugShaders UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:transformClassesWithDexBuilderForDebug UP-TO-DATE
:transformDexArchiveWithExternalLibsDexMergerForDebug UP-TO-DATE
Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;

com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
:transformDexArchiveWithDexMergerForDebug FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':transformDexArchiveWithDexMergerForDebug'.

com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 2s
36 actionable tasks: 1 executed, 35 up-to-date
cmd: Command failed with exit code 1 Error output:
Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;

com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':transformDexArchiveWithDexMergerForDebug'.

com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 2s
[ERROR] An error occurred while running subprocess cordova.

    cordova build android exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

C:\IonicApp\LIMSApp>ionic info
√ Gathering environment info - done!

Ionic:

ionic (Ionic CLI) : 4.2.1 (C:\Users\User\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.1.1
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.1.1 (cordova-lib@8.1.0)
Cordova Platforms : not available
Cordova Plugins : not available

System:

NodeJS : v8.12.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 7

Please I need help on this cannot run my ionic app in android

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions