when I build my ionic application, this error results:
ionic cordova build android --prod
[WARN] Detected locally installed Ionic CLI, but it's too old--using global CLI.
[WARN] Detected @ionic/cli-plugin-ionic-angular in your package.json.
As of CLI 3.8, it is no longer needed. You can uninstall it:
npm uninstall -D @ionic/cli-plugin-ionic-angular
Running app-scripts build: --platform android --target cordova
[19:39:52] build dev started ...
[19:39:52] clean started ...
[19:39:52] clean finished in 2 ms
[19:39:52] copy started ...
[19:39:52] transpile started ...
[19:39:54] transpile finished in 2.91 s
[19:39:54] preprocess started ...
[19:39:54] deeplinks started ...
[19:39:55] deeplinks finished in 55 ms
[19:39:55] preprocess finished in 56 ms
[19:39:55] webpack started ...
[19:39:55] copy finished in 3.11 s
[19:40:00] webpack finished in 5.09 s
[19:40:00] sass started ...
[19:40:01] sass finished in 1.05 s
[19:40:01] postprocess started ...
[19:40:01] removed unused font files
[19:40:01] postprocess finished in 5 ms
[19:40:01] lint started ...
[19:40:01] build dev finished in 9.17 s
> cordova build android
You have been opted out of telemetry. To change this, run: cordova telemetry on.
ANDROID_HOME=C:\Users\Jaylton\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_131
[19:40:03] tslint: C:/projects/restapi/src/providers/events/events.ts, line: 33
'array' is declared but never used.
L32: resolve(result.json());
L33: var array = JSON.parse(result._body);
L34: },
[19:40:03] tslint: C:/projects/restapi/src/providers/events/events.ts, line: 49
'array' is declared but never used.
L48: resolve(result.json());
L49: var array = JSON.parse(result._body);
L50: },
[19:40:03] tslint: C:/projects/restapi/src/providers/events/events.ts, line: 64
'array' is declared but never used.
L63: resolve(result.json());
L64: var array = JSON.parse(result._body);
L65: },
[19:40:03] tslint: C:/projects/restapi/src/providers/events/events.ts, line: 79
'array' is declared but never used.
L78: resolve(result.json());
L79: var array = JSON.parse(result._body);
L80: },
[19:40:03] tslint: C:/projects/restapi/src/providers/events/events.ts, line: 11 1
'array' is declared but never used.
L110: resolve(result.json());
L111: var array = JSON.parse(result._body);
L112: },
[19:40:03] tslint: C:/projects/restapi/src/pages/other-field/other-field.ts, li ne: 48
Duplicate variable: 'i'
L47: this.fields2.push(event);
L48: for (var i = 0; i < event.opcoes.length; i++) {
L49: var opcao = event.opcoes[i];
[19:40:03] tslint: C:/projects/restapi/src/pages/event-detail/event-detail.ts, line: 31
Duplicate variable: 'dd'
L31: var dd = this.event.dthr_evento;
L32: var rd = dd.split(" ");
[19:40:03] tslint: C:/projects/restapi/src/pages/event-detail/event-detail.ts, line: 32
Duplicate variable: 'rd'
L31: var dd = this.event.dthr_evento;
L32: var rd = dd.split(" ");
L33: rd = rd[0].split("-");
[19:40:03] tslint: C:/projects/restapi/src/pages/event-detail/event-detail.ts, line: 23
Property 'eventProvider' is declared but never used.
L23: owser: InAppBrowser, private toast: ToastController, private eventPr ovider: EventsProvider, public navCtrl:
L24: this.event = this.navParams.data.event[0];
[19:40:03] tslint: C:/projects/restapi/src/pages/event-list/event-list.ts, line : 98
Duplicate variable: 'arr'
L97: event.dthr_evento = arr[0].split('-').reverse().join('/');
L98: var arr = event.dt_limite_inscricao.split(' ');
L99: event.dt_limite_inscricao = arr[0].split('-').reverse().join('/');
[19:40:03] tslint: C:/projects/restapi/src/pages/event-list/event-list.ts, line : 37
'disconnectSubscription' is declared but never used.
L36: constructor(public network: Network, public navCtrl: NavController, public navParams: NavParams, private geo: Geolocation, private platform: Platfor m, private toast: ToastController, private eventProvider: EventsProvider) {
L37: let disconnectSubscription = this.network.onDisconnect().subscribe (() => {
L38: this.net = true;
[19:40:03] tslint: C:/projects/restapi/src/pages/event-list/event-list.ts, line : 40
'connectSubscription' is declared but never used.
L39: });
L40: let connectSubscription = this.network.onConnect().subscribe(() => {
L41: this.events = [];
[19:40:03] tslint: C:/projects/restapi/src/pages/event-list/event-list.ts, line : 5
'Input' is declared but never used.
L4: import { NavController, NavParams, ToastController, Platform, Conten t, Searchbar} from 'ionic-angular';
L5: import { ViewChild, Input } from '@angular/core';
L6: import { LoginPage } from '../login/login';
[19:40:03] tslint: C:/projects/restapi/src/pages/event-list/event-list.ts, line : 6
All imports are unused.
L5: import { ViewChild, Input } from '@angular/core';
L6: import { LoginPage } from '../login/login';
L7: import { EventDetailPage } from '../event-detail/event-detail';
[19:40:03] tslint: C:/projects/restapi/src/pages/event-list/event-list.ts, line : 8
All imports are unused.
L7: import { EventDetailPage } from '../event-detail/event-detail';
L8: import { SearchPipe } from '../../pipes/search/search';
L9: import { Network } from '@ionic-native/network';
[19:40:03] tslint: C:/projects/restapi/src/pages/user-edit/user-edit.ts, line: 5
All imports are unused.
L4: import { UserPerfilPage } from '../user-perfil/user-perfil';
L5: import { TabsPage } from '../tabs/tabs';
[19:40:03] tslint: C:/projects/restapi/src/pages/event-user/event-user.ts, line : 18
Property 'platform' is declared but never used.
L18: Ctrl: NavController, public navParams: NavParams, private platform: Platform, private toast: ToastController
L19: let disconnectSubscription = this.network.onDisconnect().subscri be(() => {
[19:40:03] tslint: C:/projects/restapi/src/pages/event-user/event-user.ts, line : 19
'disconnectSubscription' is declared but never used.
L18: constructor(private network: Network, public navCtrl: NavController, public navParams: NavParams, private platform: Platform, private toast: ToastCo ntroller, private eventProvider: EventsProvider) {
L19: let disconnectSubscription = this.network.onDisconnect().subscribe (() => {
L20: this.net = true;
[19:40:03] tslint: C:/projects/restapi/src/pages/event-user/event-user.ts, line : 22
'connectSubscription' is declared but never used.
L21: });
L22: let connectSubscription = this.network.onConnect().subscribe(() => {
L23: this.events = [];
[19:40:03] tslint: C:/projects/restapi/src/pages/event-user/event-user.ts, line : 3
'InfiniteScroll' is declared but never used.
L2: import { Component } from '@angular/core';
L3: import { NavController, NavParams, ToastController, InfiniteScroll, Platform } from 'ionic-angular';
L4: import { EventUserDetailPage } from '../event-user-detail/event-user -detail';
[19:40:03] tslint: C:/projects/restapi/src/pages/user-perfil/user-perfil.ts, li ne: 7
All imports are unused.
L6: import { UserEditPage } from '../user-edit/user-edit';
L7: import { UserDetailPage } from '../user-detail/user-detail';
L8: import { UsersProvider } from './../../providers/users/users';
[19:40:03] tslint: C:/projects/restapi/src/pages/results/results.ts, line: 71
Duplicate variable: 'arr'
L70: event.dthr_evento = arr[0].split('-').reverse().join('/');
L71: var arr = event.dt_limite_inscricao.split(' ');
L72: event.dt_limite_inscricao = arr[0].split('-').reverse().join('/');
[19:40:03] tslint: C:/projects/restapi/src/pages/results/results.ts, line: 29
Property 'platform' is declared but never used.
L29: Ctrl: NavController, public navParams: NavParams, private platform: Platform, private toast: ToastController
L30: let disconnectSubscription = this.network.onDisconnect().subscri be(() => {
[19:40:03] tslint: C:/projects/restapi/src/pages/results/results.ts, line: 30
'disconnectSubscription' is declared but never used.
L29: constructor(public network: Network, public navCtrl: NavController, public navParams: NavParams, private platform: Platform, private toast: ToastCon troller, private eventProvider: EventsProvider) {
L30: let disconnectSubscription = this.network.onDisconnect().subscribe (() => {
L31: this.net = true;
[19:40:03] tslint: C:/projects/restapi/src/pages/results/results.ts, line: 33
'connectSubscription' is declared but never used.
L32: });
L33: let connectSubscription = this.network.onConnect().subscribe(() => {
L34: this.results = [];
[19:40:03] tslint: C:/projects/restapi/src/pages/results/results.ts, line: 3
'InfiniteScroll' is declared but never used.
L2: import { Component } from '@angular/core';
L3: import { NavController, NavParams, ToastController, InfiniteScroll, Platform, Content, Searchbar } from 'ion
L4: import { ViewChild } from '@angular/core';
[19:40:03] tslint: C:/projects/restapi/src/pages/results/results.ts, line: 5
All imports are unused.
L4: import { ViewChild } from '@angular/core';
L5: import { LoginPage } from '../login/login';
L6: import { EventDetailPage } from '../event-detail/event-detail';
[19:40:03] tslint: C:/projects/restapi/src/pages/results/results.ts, line: 7
All imports are unused.
L6: import { EventDetailPage } from '../event-detail/event-detail';
L7: import { SearchPipe } from '../../pipes/search/search';
L8: import { Network } from '@ionic-native/network';
[19:40:03] tslint: C:/projects/restapi/src/pages/tabs/tabs.ts, line: 22
Property 'toast' is declared but never used.
L22: rtController, public navCtrl: NavController, public navParams: NavPa rams, private toast: ToastController) {
L23: if (this.navParams.data.res) {
[19:40:03] tslint: C:/projects/restapi/src/pages/login/login.ts, line: 24
'disconnectSubscription' is declared but never used.
L24: let disconnectSubscription = this.network.onDisconnect().subscribe(( ) => {
L25: this.toast.create({ message: 'Você está sem conexão com internet. Por favor, conecte seu dispositivo a uma rede.', position: 'botton', duration: 3 000 }).present();
[19:40:03] tslint: C:/projects/restapi/src/pages/load/load.ts, line: 13
Property 'loadingCtrl' is declared but never used.
L13: constructor(private loadingCtrl: LoadingController, public navCtrl : NavController, public navParams: NavPa
[19:40:03] tslint: C:/projects/restapi/src/app/app.component.ts, line: 16
Property 'fcm' is declared but never used.
L16: constructor(private fcm: FCM, platform: Platform, statusBar: Statu sBar,public push: Push, splashScreen: Sp
L17: platform.ready().then(() => {
[19:40:03] tslint: C:/projects/restapi/src/pipes/pipes.module.ts, line: 2
All imports are unused.
L1: import { NgModule } from '@angular/core';
L2: import { SearchPipe } from './search/search';
L3: @NgModule({
[19:40:03] lint finished in 2.80 s
Subproject Path: CordovaLib
google-services plugin could not detect any version for com.google.android.gms o r com.google.firebase, default version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
Configuration 'compile' in project ':' is deprecated. Use 'implementation' inste ad.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be re moved in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_3bz77l6uoddnb3s6juyfiip5u.run(C:\projects\restapi\platforms\and roid\build.gradle:142)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollec tion)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollec tion)
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
:processDebugGoogleServices
Parsing json file: C:\projects\restapi\platforms\android\google-services.json
: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
error: error reading C:\Users\Jaylton\.gradle\caches\transforms-1\files-1.1\fire base-analytics-impl-16.1.1.aar\48ca2deb4d144e3deb97bae993965054\jars\classes.jar ; zip file is empty
error: error reading C:\Users\Jaylton\.gradle\caches\transforms-1\files-1.1\fire base-analytics-impl-16.1.1.aar\48ca2deb4d144e3deb97bae993965054\jars\classes.jar ; zip file is empty
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILED
28 actionable tasks: 2 executed, 26 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Could not expand ZIP 'C:\Users\Jaylton\.gradle\caches\transforms-1\files-1.1\f irebase-analytics-impl-16.1.1.aar\48ca2deb4d144e3deb97bae993965054\jars\classes. jar'.
* 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 4s
(node:3516) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with ex it code 1 Error output:
error: error reading C:\Users\Jaylton\.gradle\caches\transforms-1\files-1.1\fire base-analytics-impl-16.1.1.aar\48ca2deb4d144e3deb97bae993965054\jars\classes.jar ; zip file is empty
error: error reading C:\Users\Jaylton\.gradle\caches\transforms-1\files-1.1\fire base-analytics-impl-16.1.1.aar\48ca2deb4d144e3deb97bae993965054\jars\classes.jar ; zip file is empty
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Could not expand ZIP 'C:\Users\Jaylton\.gradle\caches\transforms-1\files-1.1\f irebase-analytics-impl-16.1.1.aar\48ca2deb4d144e3deb97bae993965054\jars\classes. jar'.
* 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 4s
at ChildProcess.whenDone (C:\projects\restapi\platforms\android\cordova\node _modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:3516) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3516) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre cated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
How to fix?