41

I am new to Ionic while build the app in android. Its opening a project in Android Studio but while gradle sync its showing the following error

Could not read script 'F:\IonicProjects\mis-tracking-master-latest\mis-tracking-master\mis-tracking\android\capacitor.settings.gradle' as it does not exist.
Gedeon Mutshipayi
  • 2,871
  • 3
  • 21
  • 42
Jose Vazhappilly
  • 511
  • 1
  • 4
  • 3

8 Answers8

104

Try to sync your Ionic project by command:

ionic capacitor sync android
Dmitry R
  • 1,141
  • 1
  • 7
  • 4
26

JUST DO

npx cap sync android

If you only use capacitor from (Vuejs, nuxtjs, etc.)

Gedeon Mutshipayi
  • 2,871
  • 3
  • 21
  • 42
12

Same thing happen to me. I did a

npm install --save @capacitor/core @capacitor/cli

and this fixes it.

Raymond Tey
  • 464
  • 3
  • 11
2

change the name of my file /android/settings.gradle to capacitor.settings.grandle works for me

Geovas
  • 47
  • 3
1

just do

npm install jetifier
npx jetify
npx cap sync android

enter image description here

Capacitor troubleshooting https://capacitorjs.com/docs/android/troubleshooting

Balaji
  • 9,657
  • 5
  • 47
  • 47
1
  1. Over folder project execute: $ capacitor update android
  2. On Android Studio execute: File -> Sync Project with Gradle Files
1

run ionic build before you run npx cap add android

0

This is what solved it for me: I'm using next/JS and I export it. So the build folder is not "build", it is "out".

Just go to the capacitor.config.json and change the webDir property to out