Ok, by using sample code from this page
I'm able to interact with the camera on my device through the desktop phonegap tool.
However, I get multiple errors with the same code when going through phonegap build.
Typical: TypeError: undefined is not an object (evaluating 'navigator.camera.getPicture')
Are you including cordova.js (or phonegap.js) in your html file?
Are you waiting for the deviceready event before calling?
Edit: cancel that, I see that you are waiting for deviceready, and if thats firing you must be including cordova.js.
Not the cause of the problem, but note that at the top of the documentation page that you just linked, it indicates that you are viewing deprecated docs, and tells you the updated docs location.
I see that you're using Hydration. I'm guessing you added the camera plugin to your app, and then updated it using Hydration. When you add plugins to your app, you need to do a full rebuild and re-install of the app. Hydration only updates web assets, it cannot update native code such as plugins.
1 person found this helpful
By "full rebuild" I assume you mean clicking the rebuild button next to the "update code" button.
I did that.
Before doing that, I removed the directories for plugins, platforms, and hooks.
Same error persists
TypeError: undefined is not an object (evaluating 'navigator.camera.getPicture')
And you fully uninstalled and re-installed the app from your device? I just installed your app, and launched test.html, and the camera buttons work as expected. In addition, connecting the chrome inspector, I can call navigator.camera.getPicture successfully.
Thanks ... if that's in instructions somewhere, I missed it.
I had not seen anything about uninstalling and reinstalling. I was just quitting (swipe up) and restarting.
Yes, uninstall and reinstall works. Camera works.