Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after update to 1.2.2 ionic cordova build fails #51

Closed
AirBorne04 opened this issue Dec 23, 2018 · 9 comments
Closed

after update to 1.2.2 ionic cordova build fails #51

AirBorne04 opened this issue Dec 23, 2018 · 9 comments
Labels

Comments

@AirBorne04
Copy link

after the update the command
ionic cordova build ios
fails with the warning that the directory is not a cordova path apparently due to the missing www folder

reverting to 1.2.0 fixed this behaviour

@imhoffd
Copy link
Contributor

imhoffd commented Jan 2, 2019

@AirBorne04 Can you provide more information? Not able to reproduce this, so steps to reproduce and ionic info and full command output will be helpful.

@AirBorne04
Copy link
Author

@dwieeb sure, here is the exact output error of the build, after the angular build finishes without an error.

cordova build ios
(node:17691) UnhandledPromiseRejectionWarning: CordovaError: Current working directory is not a Cordova-based project.
at Object.cdProjectRoot (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:170:15)

and the output of ionic info

Ionic:
ionic (Ionic CLI) : 4.6.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-rc.0
@angular-devkit/build-angular : 0.11.4
@angular-devkit/schematics : 7.1.4
@angular/cli : 7.1.4
@ionic/angular-toolkit : 1.2.2

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

System:
ios-deploy : 1.9.2
NodeJS : v10.4.1 (/usr/local/Cellar/node/10.4.1/bin/node)
npm : 6.5.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61

what i have recognized is that in version 1.2.0 the very first output of the build command is that it created a www folder which after some investigation is suppose could be the reason for the error message i posted.

Also i am not sure why the cordova platform info states none as the ionic cordova platforms command prints ios, not sure if that is an issue though.

@GuilhermeBCC
Copy link
Contributor

GuilhermeBCC commented Jan 6, 2019

I have some ideas of what's going on:

the www folder is created at the beginning of the

'ionic cordova build' or 'ionic cordova run' without --livereload

then it's deleted deleting before build modules and after running builder.run

concatMap(builder => builder.run(browserConfig))

the error will occur after the build when calling the command

cordova run android
Current working directory is not a Cordova-based project.

because the www folder has been deleted.

@AirBorne04
Copy link
Author

that sounds like the source, is there any fix in sight?

@imhoffd
Copy link
Contributor

imhoffd commented Jan 14, 2019

The www folder is created at the beginning if missing by the Ionic CLI. The Angular CLI will remove it before a build but create it during the build. All of this should happen before the Ionic CLI calls cordova build or cordova run. Seeing the full command output would be useful for verifying the order of operations here. I am still unable to reproduce the issue.

@GuilhermeBCC If you can see what's wrong, would you mind committing a fix? I just wrote up some quick contributing docs: https://github.com/ionic-team/angular-toolkit/blob/master/CONTRIBUTING.md

@GuilhermeBCC
Copy link
Contributor

Sorry I do not know the solution. Did you say that the angle after deletion creates the folder again? The problem is that Angular no longer creates the folder for some reason.

@imhoffd
Copy link
Contributor

imhoffd commented Jan 16, 2019

If it doesn't create the folder, where are the files put that it builds? Each build should have an output directory.

@imhoffd
Copy link
Contributor

imhoffd commented Jan 24, 2019

Pretty sure the above commit fixes this ^^^

If not, let me know.

@Ionitron
Copy link
Collaborator

🎉 This issue has been resolved in version 1.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants