ionic-framework: Build tools trying to access the incorrect path for the Android Manifest

Ionic version: (check one with “x”) (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [x] 3.x [ ] 4.x

I’m submitting a … (check one with “x”) [x] bug report [ ] feature request

Current behavior:

$ ionic cordova build android
Running app-scripts build: --platform android --target cordova
[00:25:36]  build dev started ...
[00:25:36]  clean started ...
[00:25:36]  clean finished in 3 ms
[00:25:36]  copy started ...
[00:25:36]  deeplinks started ...
[00:25:36]  deeplinks finished in 65 ms
[00:25:36]  transpile started ...
[00:25:40]  transpile finished in 3.83 s
[00:25:40]  preprocess started ...
[00:25:40]  preprocess finished in 1 ms
[00:25:40]  webpack started ...
[00:25:40]  copy finished in 4.17 s
[00:25:47]  webpack finished in 7.03 s
[00:25:47]  sass started ...
Witout `from` option PostCSS could generate wrong source map or do not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning
[00:25:48]  sass finished in 809 ms
[00:25:48]  postprocess started ...
[00:25:48]  postprocess finished in 6 ms
[00:25:48]  lint started ...
[00:25:48]  build dev finished in 11.84 s
> cordova build android
cp: copyFileSync: could not write to dest file (code=ENOENT):/home/japseyz/Sites/festihvalApp/platforms/android/res/xml/config.xml

Parsing /home/japseyz/Sites/festihvalApp/platforms/android/res/xml/config.xml failed
(node:32508) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open '/home/japseyz/Sites/festihvalApp/platforms/android/res/xml/config.xml'
(node:32508) [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-zeroexit code.

[00:25:50]  lint finished in 2.64 s

You see errors about the config.xml file, because the path it’s trying to access is incorrect. The actual path is:

/home/japseyz/Sites/festihvalApp/platforms/android/app/src/main/res/

It’s not entering the “app/src/main” directories

Expected behavior: The app should build

Steps to reproduce: Run ionic cordova build android on a new ionic installation.

Other information: I have tried to remove and re-add the android platform, also at different versions, to no avail.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/usr/lib/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.7
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.9.3
    npm               : 5.5.1
    OS                : Linux 4.10

Environment Variables:

    ANDROID_HOME : /home/japseyz/Android/Sdk

Misc:

    backend : pro

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

I’m having the same problem on my iMac …

> cordova run android
cp: copyFileSync: could not write to dest file (code=ENOENT):/path_to_project/platforms/android/res/xml/config.xml

Which is exactly the same problem as the OP described (wrong path)

The starter project did build ok before I added another plugin (<plugin name="cordova-plugin-fingerprint-aio" spec="^1.3.4" />). I assume it didn’t need to write to the android platform’s xml file in the initial stage.

temporary solution

Downgrading the android engine from 7.0.0 to 6.4.0 solved my issue as well:

ionic cordova platform rm android
ionic cordova platform add android@6.4.0

ionic info

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 25.2.5
    ios-deploy        : 1.9.2
    ios-sim           : 5.0.13
    Node              : v7.4.0
    npm               : 5.5.1
    OS                : macOS High Sierra
    Xcode             : Xcode 9.2 Build version 9C40b

Environment Variables:

    ANDROID_HOME : /Users/dirkbertels/Library/Android/sdk

Misc:

    backend : pro

I am also getting this same issue

cli packages: (E:\applications\harvey-tool-ui\node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 6.1.2
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v8.2.1
npm               : 5.3.0
OS                : Windows 8.1

Environment Variables:

ANDROID_HOME : C:\Users\blaw\AppData\Local\Android\Sdk

Misc:

backend : pro

Hi @sbellver,

I was able to resolved the issue by downgrading my Cordova android platform to Android 6 ionic Cordova platform add android@6.4.0. Currently, there seems to have issues on Cordova android 7 (not Ionic) builder.

In my case, it required me to install Gradle Wrapper. Here’s some guide on setting up Gradle (just in case you haven’t set it up).

Cheers!

Be sure you uninstall Cordova first. Remove Android platform before you compile again.

Check your Cordova android version; 6.3.0 works fine: cordova platform add android@6.3.0

I’m also having this issue.

cli packages: (/home/matheus/.nvm/versions/node/v8.2.1/lib/node_modules)

   @ionic/cli-utils  : 1.19.1
   ionic (Ionic CLI) : 3.19.1

global packages:

   cordova (Cordova CLI) : 8.0.0

local packages:

   @ionic/app-scripts : 3.1.8
   Cordova Platforms  : android 7.0.0 ios 4.5.4
   Ionic Framework    : ionic-angular 3.9.2

System:

   Android SDK Tools : 26.1.1
   Node              : v8.2.1
   npm               : 5.6.0
   OS                : Linux 4.4

Environment Variables:

   ANDROID_HOME : /home/matheus/Android/Sdk

Misc:

   backend : pro

cordova run android cp: copyFileSync: could not write to dest file (code=ENOENT):/path_to_project/platforms/android/res/xml/config.xml

For this error create your own xml folder in platforms/android/res/

@dirk-theshiftleft you need to downgrade Cordova: npm uninstall cordova npm install -g cordova@7.1.0

Cordova 8 + Android stills searching files in wrong place