2

I have currently a big Problem with Phonegap and Plugins like org.apache.cordova.camera. They will not be loaded in my project.

I've found a lot of different answers here on stackoverflow: - reinstall plugins - delete the platform and rebuild the project - create a whole new project

and some more, but nothing has solved my problem.

This is the message I've found in the console.log:

2014-03-29 15:08:19.123 Parking[31170:70b] Multi-tasking -> Device: YES, App: YES
2014-03-29 15:08:19.132 Parking[31170:70b] Unlimited access to network resources
2014-03-29 15:08:19.149 Parking[31170:70b] CDVPlugin class CDVLocation (pluginName: geolocation) does not exist.
2014-03-29 15:08:19.150 Parking[31170:70b] [CDVTimer][geolocation] 0.471950ms
2014-03-29 15:08:19.150 Parking[31170:70b] CDVPlugin class CDVCamera (pluginName: camera) does not exist.
2014-03-29 15:08:19.150 Parking[31170:70b] [CDVTimer][camera] 0.374973ms
2014-03-29 15:08:19.151 Parking[31170:70b] [CDVTimer][TotalPluginStartup] 1.603007ms
2014-03-29 15:08:19.247 Parking[31170:70b] Resetting plugins due to page load.

And this is the way I've added the plugins:

phonegap plugin add org.apache.cordova.camera
phonegap plugin add org.apache.cordova.geolocation

In my config.xml I've added the following parts:

<feature name="Geolocation">
    <param name="ios-package" value="CDVLocation" />
</feature>
<feature name="Camera">
    <param name="ios-package" value="CDVCamera" />
</feature>

<gap:plugin name="org.apache.cordova.camera" />
<gap:plugin name="org.apache.cordova.geolocation" />

In my project I've used the camera example code from their docs, but navigator.camera was undefined.

Can anyone help me with this problems?

Pascal Bajorat
  • 464
  • 8
  • 20

2 Answers2

1

If your app has spaces in the config.xml file, try removing them. Remove the plugins and remove the platform. Then add the platform and re-install the plugins. Thanks to user Aras this processes solved my problems. Plugin not found, or is not a CDVPlugin. Check your plugin mapping in config.xml

Community
  • 1
  • 1
Tmillz
  • 39
  • 1
  • 4
0

If you're working with Xcode make sure that the Camera plugin files are actually added to the project.

Select the file CDVCamera.m in the file browser to the left, then make sure that the checkbox next to your App in the Target Membership panel is checked. It wasn't in my case.

Repeat for CDVJpegHeaderWriter.m and UIImage+CropScaleOrientation.m.

You may have to add ImageIO.framework and CoreLocation.framework as well.

jlapoutre
  • 1,767
  • 18
  • 22