Volt and PhoneGap built apk apps do not work the same way

I have an app which should use the camera with cordova-plugin-camera . With PhoneGap, when form1 is ready, the user is asked for permission to use the camera. When permitted, the user can take a photo successfully. With Volt build the user is not asked for permission (question is not displayed), does not get the view of the camera and cannot take a photo. For both Volt and PhoneGap builder the same code is used.

Any idea what one can do in order to get Volt builder app doing the same as the PGB app?

Are there any messages on device when you connect the remote debugger?

Do you have the permission settings in the config.xml file? Without those, the user will not get prompted.

Thanks for your quick answers. Permission is set and android namespace added. VoltBuilder produces the same result with and without these entries to config.xml. My question is and what I really would like to learn is: Why does VoltBuilder not trigger the camera, while PhoneGap Build does it withe the same code and with the same device. To know this seems important when VoltBuilder is intended to replace an allegedly outdated PhoneGap Build that does the job.

With every new system there are always growing pains.

Adobe is no longer updating PGB and Apple is no longer accepting apps not built with their latest SDK. As developers, we really have no choice but to migrate to something else. Thankfully, George and crew is developing a replacement as there aren’t many alternatives.

As for the camera stuff. Right before they updated Voltbuilder to the latest Android sdk, I built one of my apps with both the camera plugin and the media plugin. Both worked and prompted for access. If you’re just doing subsequent builds and tests it won’t prompt you again unless you completely delete the app and reinstall OR you go to settings and revoke access and then it depends on the device and os version as to whether it will prompt you or just ignore your request. The camera plugin has a call to check permissions, does it not?

Also when I built, I built with the latest versions of the plugins. Have you made sure you have the latest versions or are you perhaps using an older version? Have you tried deleting the app and reinstalling to see what happens? Have you rebooted your device? Obviously there’s lots of things we can try.

Thank you.

I just checked that the app on the device had no permissions. I granted them in app settings. Now the Voltbuilder app version can take photos.

I always uninstall the app before a new try. Now and then I install the PGB app in order to see if it is still working “better” than the Voltbuilder app. The PGB app always asks for permission, the Voltbuilder app does not.

So I still wonder what the difference might be in building with Voltbuilder compared to PGB when VoltB does not achieve the same result as PGB.

Indeed the PGB apk did not need explicit permission call by code in config.xml because the plugin does it. Extra coding for permission in config.xml was only one of many experiments without success solely in Voltbuilder.

I still have to do further tries with your idea not to use the suggested plugin versions in order to get a possibly newer one. And I should reboot between the tries … Lots indeed :slight_smile:

Thanks again.

I get it… we get in messing around with settings in order to test stuff and then forget the changes and get bogged down with details. It’s easy to overlook the basics. That’s why we offer each other new eyes.

In terms of prompting for permissions, if you had to grant the permissions in Settings, that seems like the config.xml doesn’t have the correct permission prompts and I know some plugins have changed how they’re handling that stuff so you may want to double check that as well.

No. I did not have to grant permissions in Settings with PGB app. PGB accepts config.xml and the PGB apk can trigger the cam. I am still stuck with the problem that VoltBuilder does not do what the same code with PGB can perform without problem. As long as this is not solved I cannot see why Voltbuilder could replace PGB.

The app where I granted permissions in Settings on the device is the very one VoltBuilder app that did not install and work as correctly as the PGB app. This should be something that VoltBuilder does differently.

BTW: The plugins are latest versions. When I tried to remove the PGB suggested specs I was reminded that I already had tried with and without specs. Again: PGB app works in all cases.

There are always going to be differences between PGB and VoltBuilder. These changes will get bigger as time goes on, since VoltBuilder is using the latest tools and libraries from Cordova, while PGB is not being updated.

VoltBuilder just adds the plugins to your project. We don’t do anything with them. Their behaviour is completely defined by the plugins themselves, not by anything we do.

I know that permissions is an area that Android and iOS are constantly working on improving, which will also cause differences.

Thank you. I use exactly the same cordova-plugin-camera in both builders. This is why I would like to understand why solely VoltB does not trigger camera view.

Today I managed to run the latest VoltBuilder apk remotely with Android Studio. Worked. Got camera view and photo. Did not see errors.

Since this experiment I can achieve the same with the app directly on the device. No idea what change somewhere made this happen.

It might be a moot point anyway. I built another app with camera plugin and completely different code which is working.

The additional current app is only for the purpose of hopefully better understanding VoltBuilder, PGB and the plugins.

Thanks again.

Just in case somebody is struggling with a comparable issue…
I finally got permission request and camera view with VoltBuilder build by these lines:

var isCordovaApp = (typeof window.cordova !== "undefined");

if(isCordovaApp) {
   document.addEventListener("deviceready", onDeviceReady, false);
   function onDeviceReady() {
      cameraStart();
   }
} else {
   loadProject();
}
 
function loadProject() {
   document.addEventListener("DOMContentLoaded", cameraStart, false);
}

cameraStart is the function where I use getUserMedia etc.