Reputation: 501
while i run last command then got below Error.
FAILURE: Build failed with an exception.
Where: Script 'D:\Projects\corporatesolutionmobileapp\platforms\android\cordova-android -support-gradle-release\sancial-cordova-android-support-gradle-release.gradle' l ine: 11
What went wrong: A problem occurred evaluating script.
Could not read script 'D:\Projects\corporatesolutionmobileapp\platforms\androi d\app\cordova-android-support-gradle-release\properties.gradle' as it does not e xist.
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 1s [ERROR] An error occurred while running subprocess cordova.
cordova build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more
information.
Upvotes: 18
Views: 42159
Reputation: 447
It is related to M1 chipset of mac.
% brew uninstall node
% brew install nodenv
% echo 'export PATH=${PATH}:~/.nodenv/shims' >> ~/.zprofile
% nodenv install 17.7.2
% nodenv global 17.7.2
% npx cap run android
✔ Copying web assets from www to android/app/src/main/assets/public in 7.48ms
✔ Creating capacitor.config.json in android/app/src/main/assets in 745.25μs
✔ copy android in 12.87ms
✔ Updating Android plugins in 3.42ms
[info] Found 3 Capacitor plugins for android:
@capacitor/[email protected]
@capacitor/[email protected]
@capacitor/[email protected]
✔ update android in 32.04ms
✔ Running Gradle build in 1.32s
✔ Deploying app-debug.apk to emulator-5554 in 1.88s
ref https://github.com/ionic-team/capacitor/issues/5545
Upvotes: 0
Reputation: 175
Solved:
https://capacitorjs.com/docs/android/troubleshooting#recreating-your-project
Upvotes: -2
Reputation: 635
I was having a similar problem, running the command
ionic capacitor run android
I was getting androidmanifest.xml doesn't exist.
It was solved by running the command
ionic capacitor update
Upvotes: 48
Reputation: 2497
I was getting this error while only using Capacitor which I thought was strange so I nuked the android
path in my root folder and then npx cap add android
again and the build worked after that
Upvotes: 5
Reputation: 1594
This issue is mostly faced, when you add/remove a new plugin. So by just running cordova clean
can resolve that issue.
Inside your CMD/Terminal:
C:\<project folder>\cordova clean
Upvotes: 0
Reputation: 30366
Updating to the most recent version (v2.0.1) of cordova-android-support-gradle-release
should resolve your issue:
ionic cordova platform rm android
ionic cordova plugin rm cordova-android-support-gradle-release
ionic cordova plugin add cordova-android-support-gradle-release@latest
ionic cordova platform add android
ionic cordova build android
Upvotes: 11