• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

PhoneGap/Cordova Cannot Read Property

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I installed the plugins through command line and still getting the same error. Anything else to do?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic