Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

capacitor.settings.gradle' as it does not exist

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.
like image 324
Jose Vazhappilly Avatar asked Aug 05 '20 14:08

Jose Vazhappilly


People also ask

Could not read script gradle as it does not exist?

Could not read script '…/node_modules/react-native/react. gradle' as it does not exist. This happens while you cloning your project and trying to run the project. The solution is simple just run command npm install in your project folder.

Could not compile settings file settings gradle in ionic?

To solve this problem you need to open the project/android/settings. gradle file and have to replace the backslash(\) with the frontslash(/) as windows directory structure do not support the backslash(\).

Where is gradle located on Mac?

Open Preferences -> Build, Execution, Deployment -> Gradle . Select Use local gradle distribution and specify Gradle home . On Mac: /usr/local/opt/gradle/libexec in case you installed it via brew . For Windows: specify the path where you installed Gradle.

What is ionic cap sync?

ionic capacitor sync will do the following: Perform an Ionic build, which compiles web assets. Copy web assets to Capacitor native platform(s) Update Capacitor native platform(s) and dependencies. Install any discovered Capacitor or Cordova plugins.


6 Answers

Try to sync your Ionic project by command:

ionic capacitor sync android
like image 98
Dmitry R Avatar answered Oct 09 '22 07:10

Dmitry R


Same thing happen to me. I did a

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

and this fixes it.

like image 39
Raymond Tey Avatar answered Oct 09 '22 08:10

Raymond Tey


JUST DO

npx cap sync android

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

like image 25
Ged Flod Avatar answered Oct 09 '22 08:10

Ged Flod


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

like image 31
Geovas Avatar answered Oct 09 '22 07:10

Geovas


just do

npm install jetifier
npx jetify
npx cap sync android

enter image description here

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

like image 41
ßãlãjî Avatar answered Oct 09 '22 06:10

ßãlãjî


  1. Over folder project execute: $ capacitor update android
  2. On Android Studio execute: File -> Sync Project with Gradle Files
like image 28
Jacobo Brito Salas Avatar answered Oct 09 '22 08:10

Jacobo Brito Salas