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
Same thing happens if I try to setup Ionic Deploy
japseyz@JapSeyz-Thinkpad:~/Sites/festihvalApp$ cordova plugin add cordova-plugin-ionic --save \
> --variable APP_ID="xxxx" \
> --variable CHANNEL_NAME="Master" \
> --variable UPDATE_METHOD="background"
Installing "cordova-plugin-ionic" for android
Installing "cordova-plugin-add-swift-support" for android
Failed to install 'cordova-plugin-add-swift-support': Error: ENOENT: no such file or directory, open '/home/japseyz/Sites/festihvalApp/platforms/android/AndroidManifest.xml'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at Object.parseElementtreeSync (/home/japseyz/Sites/festihvalApp/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js:180:27)
at new AndroidManifest (/home/japseyz/Sites/festihvalApp/platforms/android/cordova/lib/AndroidManifest.js:29:20)
at AndroidProject.getPackageName (/home/japseyz/Sites/festihvalApp/platforms/android/cordova/lib/AndroidProject.js:99:12)
at Api.addPlugin (/home/japseyz/Sites/festihvalApp/platforms/android/cordova/Api.js:223:57)
at handleInstall (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:594:10)
at /usr/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:357:28
at _fulfilled (/usr/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30)
Failed to install 'cordova-plugin-ionic': Error: ENOENT: no such file or directory, open '/home/japseyz/Sites/festihvalApp/platforms/android/AndroidManifest.xml'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at Object.parseElementtreeSync (/home/japseyz/Sites/festihvalApp/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js:180:27)
at new AndroidManifest (/home/japseyz/Sites/festihvalApp/platforms/android/cordova/lib/AndroidManifest.js:29:20)
at AndroidProject.getPackageName (/home/japseyz/Sites/festihvalApp/platforms/android/cordova/lib/AndroidProject.js:99:12)
at Api.addPlugin (/home/japseyz/Sites/festihvalApp/platforms/android/cordova/Api.js:223:57)
at handleInstall (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:594:10)
at /usr/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:357:28
at _fulfilled (/usr/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30)
(node:3705) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open '/home/japseyz/Sites/festihvalApp/platforms/android/AndroidManifest.xml'
(node:3705) [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.
I cannot duplicate your issue. I created a new project on my Linux machine, added Android platform, and built without issue.
Here is my ionic info:
~/Projects/Issues/delete-me (master *): ionic info
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.6
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.6.0
OS : Linux 4.13
Environment Variables:
ANDROID_HOME : /home/ken/Android/Sdk
Misc:
backend : pro
The Ionic Framework issues list is designated for the reporting of bugs with the Ionic Framework or for requesting new features. As this seems like more of a support question pertaining to your local setup, I am going to close this issue.
I urge that you ask this question on our forum or on our slack channel.
Thanks for using Ionic!
I am also getting this same issue
cli packages: (E:applicationsharvey-tool-uinode_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
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
Hi, any fix on this issue? Currently facing the same issue from my end.
Same here:
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.6
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
ios-sim : 5.0.13
Node : v7.10.0
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : /Users/user/Library/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 [email protected]
. 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!
I have some errors, but resolve them downgrading to Cordova 7.1.0.
Another issue is related with onesginal 2.2.5 and GoogleMaps 2.2.5; I need to downgrade GM to 2.1.1 to resolve it.
Ionic / Cordova is amazing... until you spend 3 days resolving this kind of errors :(
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.
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 [email protected]
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
@dirk-theshiftleft you need to downgrade Cordova:
npm uninstall cordova
npm install -g [email protected]
Cordova 8 + Android stills searching files in wrong place
@sbellver I downgraded cordova to 7.1.0 and I'm still having this issue when using ionic cordova build android --prod
I'm using cordova-android 7.1.0 with cordova 7.1.0
Same exact message as other people.
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 [email protected]
The problem I'm having with this is that the phonegap-plugin-push plugin tells me I need cordova-android version 7.1 or above...
EDIT: nevermind I fixed it by downgrading cordova android, then installing the plugin again, which fetches the latest highest version for that cordova android version...
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/
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Most helpful comment
I'm having the same problem on my iMac ...
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 info