ap.singh
ap.singh

Reputation: 1160

Camera plugin is not working in phonegap app for ios

I am new to ios development. I have created an app with phonegap its working fine with android. But for IOS its not working. I have installed all the plugins.

Right now i am testing the camera plugin.

But its showing the following error.

 Error: Can't find variable: Camera   ionic.bundle.js:20306
    clickPicture@file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/app/common/camera-service.js:11:38
_takePicture@file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/app/registration/registeration-controller.js:54:44
$parseFunctionCall@file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:21044:23
file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:53439:21
$eval@file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:23100:28
$apply@file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:23199:28
file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:53438:19
eventHandler@file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:11713:25
dispatchEvent@[native code]
triggerMouseEvent@file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:2863:20
tapClick@file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:2852:20
tapTouchEnd@file:///private/var/mobile/Containers/Bundle/Application/CF215D1D-130F-4901-B935-C086A94A5579/test_proj.app/www/lib/ionic/js/ionic.bundle.js:2975:13

there are two config.xml files in my project one is in root folder and other one is in staging folder

i made entry of camera plugin in both files as well as tried with individuals file.

i have tried with two types of entries in config.xml

first one :

 <feature name="Camera">
            <param name="ios-package" value="org.apache.cordova.camera" />
     </feature>

Second one

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

But its continuously showing the same error.

here is my project file structure. i am trying to fix it from last two days. But dont know where i am wrong.

enter image description here

Upvotes: 0

Views: 2339

Answers (1)

ap.singh
ap.singh

Reputation: 1160

After spent a lot of time. I found that the plugin was not updating ionic.bundle.js for that i just run the cordova platform update ios command.

And now its working fine.

Upvotes: 1

Related Questions