Build failed. /usr/src/app/platforms/android/app/res/xml/config.xml (No such file or directory)

Hi,

I’m just begining with Ionic Pro. I was working with Ionic 3.14.0 on my computer and update to Ionic 4.1.1 as Ionic Pro web site suggest me. But when I try to build my app, I get that error.

Thanks in advance
Miguel.

FAILURE: Build failed with an exception.

  • Where:
    Script ‘/usr/src/app/platforms/android/CordovaLib/cordova.gradle’ line: 168

  • What went wrong:
    A problem occurred evaluating script.

/usr/src/app/platforms/android/app/res/xml/config.xml (No such file or directory)

  • 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 3s
(node:1) UnhandledPromiseRejectionWarning: Error: /usr/src/app/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • Where:
    Script ‘/usr/src/app/platforms/android/CordovaLib/cordova.gradle’ line: 168

  • What went wrong:
    A problem occurred evaluating script.

/usr/src/app/platforms/android/app/res/xml/config.xml (No such file or directory)

  • 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 3s
at ChildProcess.whenDone (/usr/src/app/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:1) 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:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

What is your ionic info output?

Hi Sujan12,

I’m using two configurations (one with Ubuntu 16 and the other with Windows).

First time I try to build with Ionic Pro was with the Ubuntu 16 one. I had Ionic 3.14 and as I was suggested by Ionic pro I updated to Ionic 4 the latest. Then I got that error on Ionic Pro when I tried to build. In my pc, I can run server (ionic serve -c) without any problems but when try to build, then I get the same error that shows me Ionic pro.

Second time, I’d try with Windows account.
I’ve Io![error|479x346]nic 3.20.0, Cordova 8.0.0, npm 6.3.0 and Node 9.9.0
and npm outdated shows that versions of the modules (the googlemaps module is, in fact, unused):

error

With that configuration, in my pc, I can not only run the server to test on the browser but build to an .apk file without any problems. I’d make another bitbucket respository, linked from Ionic pro and try to build from Ionic pro but, as before, I get the same error.

Not what I asked.

Run ionic info in the command line of your project.

How is you local machine relevant for building in the cloud with Ionic Pro?

Ah, ok.

that’s the Ionic info output for the first one case (ubuntu 16):
info1

Ant that’s Ionic info output for the second one (Windows 7):

2

You should update Ionic CLI on Windows, Cordova CLI on Ubuntu and the Cordova Android Platform and @ionic/app-scripts in your project.

You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here: https://ionic.zone/cordova/update

I did it.

And everything seemed to be going well (ionic info test ok) … but at the end it failed again.

=>

Printing Build Environment Details*

$ ionic info
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
:heavy_check_mark: Gathering environment info - done!

Ionic:

ionic (Ionic CLI) : 4.1.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.6.0
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)

System:

NodeJS : v8.11.1 (/usr/local/bin/node)
npm : 5.10.0
OS : Linux 4.4

$ ionic info success

FAILURE: Build failed with an exception.

  • Where:
    Script ‘/usr/src/app/platforms/android/CordovaLib/cordova.gradle’ line: 168

  • What went wrong:
    A problem occurred evaluating script.

/usr/src/app/platforms/android/app/res/xml/config.xml (No such file or directory)

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

and after those updates, my local ionic doesn’t work to build

You should really try to format your posts a bit better - really hard to read,. Use the </> button for code or output.

That doesn’t really make sense.

Create a new project with ionic start and try to build that one locally or via Ionic Pro.

Sorry Sujan12… I’ll use </> button.

With a blank project with ionic start, I can build on my local machine (both ubuntu 16 and windows 7) but not in ionic pro.

I’ve tried with Git CMD just to test another posibility, but the same. Error when I try to build with Ionic pro.

that’s the output when I build my blank project with Ionic pro:

Running with gitlab-ci-multi-runner 9.1.0 (0118d89)
  on ip-10-2-1-242 (c9648220)
Using Shell executor...
Running on ip-10-2-1-242...
Cloning repository...
Cloning into '/home/gitlab-runner/builds/c9648220/3/iwmamr/blank'...
Checking out 98ab9ce2 as master...
Updating/initializing submodules...
$ run "fetch-updates"
Running Stage fetch-updates for Job: 6165534
Checking for build process updates...
$ run "build-app"
Running Stage build-app for Job: 6165534
Parsing ionic.config.json for project settings
Project Settings:
	Name: blank
	App ID: undefined
	Type: ionic-angular
$ npm install --quiet --no-optional
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.

> node-sass@4.9.0 install /usr/src/app/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.0/linux-x64-57_binding.node
Download complete
Binary saved to /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /home/gitlab-runner/.npm/node-sass/4.9.0/linux-x64-57_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall /usr/src/app/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.9.0 postinstall /usr/src/app/node_modules/node-sass
> node scripts/build.js

Binary found at /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
added 737 packages from 708 contributors in 47.58s
[+] no known vulnerabilities found [3561 packages audited]

$ npm install --quiet --no-optional success


****Printing Build Environment Details****


$ ionic info
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
✔ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)  : 4.1.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (0 plugins total)

System:

   NodeJS : v8.11.1 (/usr/local/bin/node)
   npm    : 5.10.0
   OS     : Linux 4.4

$ ionic info success
Build script detected in package.json...
$ npm run build
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.

> blank@0.0.1 build /usr/src/app
> ionic-app-scripts build

[16:08:28]  ionic-app-scripts 3.2.0 
[16:08:28]  build dev started ... 
[16:08:28]  clean started ... 
[16:08:28]  clean finished in 6 ms 
[16:08:28]  copy started ... 
[16:08:28]  deeplinks started ... 
[16:08:28]  deeplinks finished in 132 ms 
[16:08:28]  transpile started ... 
[16:08:54]  typescript: node_modules/aws-amplify/lib/PubSub/Providers/MqttOverWSProvider.d.ts, line: 1 
            Cannot find type definition file for 'paho-mqtt'. 

       L1:  import { Client } from 'paho-mqtt';
       L2:  import * as Observable from 'zen-observable';

[16:08:54]  typescript: node_modules/aws-amplify/lib/PubSub/Providers/MqttOverWSProvider.d.ts, line: 2 
            Cannot find type definition file for 'zen-observable'. 

       L1:  import { Client } from 'paho-mqtt';
       L2:  import * as Observable from 'zen-observable';
       L3:  import { AbstractPubSubProvider } from './PubSubProvider';

[16:08:54]  typescript: node_modules/aws-amplify/lib/PubSub/Providers/PubSubProvider.d.ts, line: 1 
            Cannot find type definition file for 'zen-observable'. 

       L1:  import * as Observable from 'zen-observable';
       L2:  import { PubSubProvider, ProvidertOptions } from '../types';
[16:08:54]  typescript: node_modules/aws-amplify/lib/PubSub/PubSub.d.ts, line: 1 

            Cannot find type definition file for 'zen-observable'. 

       L1:  import '../Common/Polyfills';       
       L2:  import * as Observable from 'zen-observable';

            Cannot find type definition file for 'zen-observable'. 

[16:08:54]  typescript: node_modules/aws-amplify/lib/PubSub/types/Provider.d.ts, line: 1 
       L1:  import * as Observable from 'zen-observable';
       L2:  import { ProvidertOptions } from './PubSub';

[16:08:54]  ionic-app-script task: "build" 
[16:08:54]  Error: Failed to transpile program 
Error: Failed to transpile program
    at new BuildError (/usr/src/app/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at /usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:159:20
    at new Promise ()
    at transpileWorker (/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:107:12)
    at Object.transpile (/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:64:12)
    at /usr/src/app/node_modules/@ionic/app-scripts/dist/build.js:109:82
    at 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! blank@0.0.1 build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the blank@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gitlab-runner/.npm/_logs/2018-09-05T16_08_54_370Z-debug.log
npm run build failed
Running after script...
$ run "clean-up"
Running Stage clean-up for Job: 6165534

It doesn’t make sense, but in my local machine I have Android as Cordova platform but not in Ionic pro. Thats my output on my local machine in my blank ionic project:

Your Cordova tooling seems to be out of date, which might be causing all kinds of problems.
You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here: https://ionic.zone/cordova/update