• 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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?
 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic