Lakshman.S
Lakshman.S

Reputation: 101

Build Error on Android using Capacitor on Gradle

We have developed Mobile App via Capacitor, Currently when we build via DevOps it gives error as,


> Configure project :app
Project app at :app is either no Android app project or build version has not been set to override. Skipping...

FAILURE: Build failed with an exception.

* Where:
Script '/Users/runner/work/1/s/android/app/capacitor.build.gradle' line: 10

* What went wrong:
A problem occurred evaluating script.
> Could not read script '/Users/runner/work/1/s/android/capacitor-cordova-android-plugins/cordova.variables.gradle' as it does not exist.

Thank in Advance.

Upvotes: 1

Views: 13256

Answers (3)

Hammad Ahmad
Hammad Ahmad

Reputation: 204

I had exactly the same issue. In my case, running "npx cap sync" solved my problem.

Upvotes: 0

Lakshman.S
Lakshman.S

Reputation: 101

Thanks for your help @jcesarmobile & @FrankM,

I have solved the issue.

On DevOps, issues occurred because of the old version of ionic & with an android folder on it. Updated the ionic & capacitor version and build currently, I have deployed to Play Store via DevOps.

Things Done in Steps:

  1. Remove Existing Android Folder from Source.
  2. Update Capacitor & Ionic Version.
  3. Add Android Platform and Sync.
  4. Build on Android Studio.
  5. Run CI/CD Pipeline on DevOps.

Upvotes: 3

jcesarmobile
jcesarmobile

Reputation: 53301

You need to run npx cap sync in your DevOps server, after the npm run build (or the command you use to build your assets) and before you do the native build.

Upvotes: 5

Related Questions