bug: missing library with zoom plugin.
See original GitHub issueBug Report
I’m not sure if that’s the right project to file the bug report, please forgive if I’m wrong and point me to the correct project.
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 3.6.0
@capacitor/core: 3.6.0
@capacitor/android: 3.6.0
@capacitor/ios: 3.6.0
Installed Dependencies:
@capacitor/cli: 3.5.1
@capacitor/core: 3.5.1
@capacitor/android: 3.5.1
@capacitor/ios: 3.5.1
[success] iOS looking great! 👌
[success] Android looking great! 👌
Using following plugins:
"@awesome-cordova-plugins/zoom": "^5.43.0",
"cordova.plugin.zoom": "^4.6.2166-6.603",
Platform(s)
- android
Current Behavior
ionic cap run android
fails at the gradle build:
[capacitor] FAILURE: Build failed with an exception.
[capacitor]
[capacitor] * What went wrong:
[capacitor] Execution failed for task ':capacitor-cordova-android-plugins:generateDebugRFile'.
[capacitor] > Could not resolve all files for configuration ':capacitor-cordova-android-plugins:debugCompileClasspath'.
[capacitor] > Could not find :commonlib:.
[capacitor] Required by:
[capacitor] project :capacitor-cordova-android-plugins
[capacitor] > Could not find :mobilertc:.
[capacitor] Required by:
[capacitor] project :capacitor-cordova-android-plugins
Expected Behavior
The app is built and run on an Android device or emulator
Code Reproduction
ionic start
# select Angular, starter template: tabs,
npm install cordova.plugin.zoom
npm install @awesome-cordova-plugins/zoom
ionic cap add android
ionic cap sync android
ionic cap open android # open once in AndroidStudio for additional project configuration
ionic cap run android # needs a configured android device or emulator
The resulting project can be found here: https://github.com/mley/cordova-zoom-plugin-build-issue
Other Technical Details
npm --version
output: 8.12.1
node --version
output: v14.19.2
pod --version
output (iOS issues only):
Additional Context
The same error happens when trying to build the app in AndroidStudio.
In android/capacitor-cordova-android-plugins/build.gradle you can find:
repositories {
google()
mavenCentral()
jcenter()
flatDir{
dirs 'src/main/libs', 'libs'
}
}
when I check the actual directory structure in android/capacitor-cordova-android-plugins/src/main/libs , there is another subdirectory called android, which contain commonlib.aar and mobilertc.aar. When I change the flatDirs dir entry to dirs 'src/main/libs/android', 'libs'
, the app can be built in AndroidStudio, but still not with ionic. I assume ionic overwrites the change in build.gradle.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Thanks for the sample app. I’ve seen that the plugin has a custom gradle file that adds the
but that has no effect on Capacitor apps
as workaround you can edit the plugin.xml from zoom plugin from
to
so the files are copied to the root libs folder instead of the android subfolder
or use a
capacitor:sync:after
hook to modify the capacitor-cordova-android-plugins gradle file after sync command, because as you said, sync command undoes the manual changes you made to that file.using flatDir is deprecated and will probably stop working on gradle 8, so we won’t be fixing this issue, try reporting the issue to zoom so they can use a different approach, but the plugins looks unmaintained, so not sure if they will fix it
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.