VoltBuilder apk does not contain plugins that PGB contains

This question is only for my hopefully better understanding. Today I unzipped both the VoltBuilder and the PhoneGap Build apk. PGB apk contains all plugins - like camera, media-capture - that are in config.xml. VoltBuilder apk, built with the same project, in plugins folder solely contains 2 - splashscreen and statusbar - plugins. What should I do so that VoltBuilder accepts / includes e.g. the cordova media-capture plugin?

Have a look at the log. It will list all the plugins in your project, along with their versions.

cordova-plugin-media-capture is on the greenlist, so VoltBuilder will be fine with it.

The first question is this: With the voltbuilder apk, are any of the features missing or not working in your app?

Since volt builder uses the latest SDK’s you’ll find some differences. Specifically, where the plugin provides functionality that is now fully supported in the HTML5 spec, the plugin will only provide the permission strings provided as part of the plugin config in the config.xml. This is what geolocation plugin does. While it may seem the plugin is missing, what’s actually happened is the permission strings and some API mapping is all that’s included and the real functionality is mapped to the HTML5 spec.

So, if the features are working, nothing is missing, it’s just handled differently.

Next, if features are missing, then check the log files and search for the plugin name. There may be 20+ entries to read through and eventually you’ll see the problem.

Thank you. The Volt app does not trigger the camera. I saw that the log file did not mention one of my cordova plugins e.g. camera or media-capture plugin. This is why I unzipped the VoltBuilder apk in order to check if the plugin folder would contain such plugins.

Update: After a few changes in config.xml I did a new build and indeed the media-capture plugin now is installed according to log. No idea which step achieved this.

Could this have something to do with it?

What you saw is not the version which finally worked. As far as I remember correctly, I made 2 relevant changes to config.xml. One was to add xmlns:android=“http://schemas.android.com/apk/res/android” to widget. Secondly I removed <platform…which had enclosed the plugins. So I think you are right. I made the unscholarly mistake to do several steps at once before a new try. This left me wondering where the success (plugins installed) came from. It is not a complete success. My Galaxy S10 with Android 10 does not yet access the camera/video view. PWA works fine. APK does not even ask for permission and the app’s properties tell me that permission (camera) is denied. Thanks for your help. I am glad that the plugin access issue is solved.

Further research shows that indeed open camera with PG 9.0.0 seems to be a bug when Android 10 is used. The other day I saw that Adobe published Android 8.1.0 or 8.0.1. My PGB apps are still produced with Android 8.0.0. Seems that I cannot update myself to Android 8+.
Anyway I would prefer VoltBuilder. But this bug, being related to native camera permissions, seems to appear even with VoltBuilder, also after having included an Android permissions plugin in config.xml. I do not really need this FotoPNG app. But I am keen on knowing what is wrong and if I can make the camera work in a native app. Is there something in config.xml that I can modify or amend so that with VoltBuilder the hardware camera is triggered? Can AppStudio implement the latest Android 8+ (if this makes sense at all :slight_smile: ?

You can specify the version of Cordova Android you want VoltBuilder to use:

Thanks a lot. Very interesting and valuable.

I already thought I should ask if the documents and threads at volt.build can be used here as well.

BTW: I had set targetSDKVersion value to 29. The log seemed to show 28.

To use Android-29, add this line to your config.xml:

<engine name="android" spec="9.0.0" />

Cordova Android 9.0.0 was released on Jun 29. More info here:
https://cordova.apache.org/announcements/2020/06/29/cordova-android-9.0.0.html

Cordova has not updated the default build to use this new library yet. VoltBuilder uses the default Cordova library.

This is what my config.xml looks like for the camera and media capture plugins. Both compile under the default version of VoltBuilder and both work within the app.

  <plugin name="cordova-plugin-camera" spec="4.1.0">
    <variable name="CAMERA_USAGE_DESCRIPTION" value="So you can take a  picture of __________."/>
    <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="So that you can access and upload images taken outside of _____________."/>
  </plugin>
  <plugin name="cordova-plugin-media-capture" spec="3.0.3">
  <edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
    <string>Need camera access to take videos and pictures of __________</string>
  </edit-config>
  <edit-config target="NSMicrophoneUsageDescription" file="*-Info.plist" mode="merge">
    <string>Need microphone access to record sounds during __________</string>
  </edit-config>
  <edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
    <string>Need photo library access to get pictures you've taken of __________</string>
  </edit-config>
  </plugin>

@Leader: Thanks. Spec 8.1.0 did not change something. I will give spec 9 a try.

@PPetree: Thank you. Looks like my config.xml, except the usage description lines which I had used and then removed because I thought they are only for iOS and I now solely build native apps for Android.