When I add a plugin to my Capacitor project in Android Studio, the following message is displayed: “Caused by: org.gradle.api.resources.MissingResourceException: Could not read script ‘C:\Poliglota\poliglota-app\android\capacitor-cordova-android-plugins\cordova.variables.gradle’ as it does not exist.”
cordova-res : not installed
native-run : not installed
System:
NodeJS : v12.16.2 (C:\Program Files\nodejs\node.exe)
npm : 6.14.4
OS : Windows 10
npx cap ls
Found 0 Capacitor plugins for android:
Found 1 Cordova plugin for android
cordova-plugin-camera (4.1.0)
Found 0 Capacitor plugins for ios:
Found 1 Cordova plugin for ios
cordova-plugin-camera (4.1.0)
The capacitor-cordova-android-plugins folder is git ignored by default because it’s generated by npx cap update android command. Running update should generate it if it doesn’t exist (causing the MissingResourceException you’re getting).
PS C:\Poliglota\poliglota-app> npx cap update android
√ Updating Android plugins in 57.84ms
Found 0 Capacitor plugins for android:
Found 1 Cordova plugin for android
cordova.plugin.zoom (4.6.2166-6.512)
× update android: ENOENT: no such file or directory, open ‘C:\Poliglota\poliglota-app\node_modules@capacitor\android\package.json’
[error] Error running update: [Error: ENOENT: no such file or directory, open ‘C:\Poliglota\poliglota-app\node_modules@capacitor\android\package.json’] {
errno: -4058,
code: ‘ENOENT’,
syscall: ‘open’,
path: ‘C:\Poliglota\poliglota-app\node_modules\@capacitor\android\package.json’
}
Update finished in 0.295s
Before adding or applying the Zoom Plugin, my application runs normally, after adding or applying the Zoom Plugin, my application is no longer compiled in Android Studio.
When recreating the Capacitor Android application the error message changed when compiling in Android Studio, now several error messages are presented in the SDK file - Zoom.java: “local variable (…) needs to be declared final”.