Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PhoneGap/Cordova Cannot Read Property

 
Dexter Ramsden
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've exhausted every resource I can find on this, and nothing has helped. I'm new to PhoneGap and working with an Android device and I'm trying to access the camera. I copied the example from the documentation on camera use ( http://docs.phonegap.com/en/2.9.0/cordova_camera_camera.md.html )

Trying to run my code now first throws, "Uncaught TypeError: Cannot read property 'PictureSourceType' of undefined at file:///android_asset/www/test.html:21"
and then when I press the "Capture Photo" button, it throws, "Uncaught TypeError: Cannot read property 'PNG' of undefined at file:///android_asset/www/test.html:81"

I've included a lot of permissions in my config.xml file out of desperation for something to work:


At the top of the test.html page, I'm referencing cordova.js with:


I have the latest version of PhoneGap, so there's no version thing at the end of cordova.js. There's also phonegap.js, which is identical to cordova.js.
Also, this is in the AndroidManifest:


I've been at this for hours and I'd really appreciate any help I can get
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you contacted PhoneGap support to ask them why their examples might not work?
 
Dexter Ramsden
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I actually figured it out. The problem was that with the latest update, you need to install the plugins using the command line interface. They really need to update the documentation!
 
poda potta
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I installed the plugins through command line and still getting the same error. Anything else to do?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic