ngCordova camera works on emulator but not on device
<p>I'm building an app with Ionic for my Course Conclusion (I'm really in a hurry because I have only 2 weeks left) and I'm stuck with a ngCordova Camera Plugin issue.
When testing on the emulator the camera works fine, on my device no image appears. It doesn't show a cracked image icon either, just a blank square.
On the emulator I tried using 3 differents Android API versions: 17, 19 and 22 (and it works on all the 3), but on my device with a API 22 it doesn't work.</p>

<p>I'm using Genymotion emulator and <strong>> ionic run android</strong> and here is what I get:
<a href="http://i.stack.imgur.com/WNEMa.jpg" rel="nofollow">Emulator: Xperia Z - android 4.2.2 API 17</a></p>

<p>But when I try <strong>> ionic build android</strong> and install it on my device, this is what I get:</p>

<p><a href="http://i.stack.imgur.com/YmjN9.jpg" rel="nofollow">Device: Xperia Z2 - Android 5.1 API 22</a></p>

<p>It's like this for all images on all pages, if I shot the picture or get it from library. Here's my code (from where the pictures came from):</p>

<p>form.html (it's a modal):</p>

<pre><code>&lt;div class="list"&gt;
    &lt;label class="item item-input item-floating-label"&gt;
      &lt;span class="input-label"&gt;Nome&lt;/span&gt;
      &lt;input type="text" placeholder="Nome" ng-model="nomeperfil"&gt;
    &lt;/label&gt;
    &lt;label class="item item-input item-floating-label"&gt;
      &lt;span class="input-label"&gt;Sobrenome&lt;/span&gt;
      &lt;input type="text" placeholder="Sobrenome" ng-model="snperfil"&gt;
    &lt;/label&gt;
    &lt;button class="button button-block button-royal" ng-click="escolhefotoperfil()"&gt;Escolha uma foto para o perfil!&lt;/button&gt;
    &lt;img id="fotoperfil" class="picture" ng-model="fotoperfil" ng-show="fotoperfil !== undefined" ng-src="{{'data:image/jpeg;base64,'+fotoperfil}}"&gt;&lt;/img&gt;
    &lt;br /&gt;&lt;br /&gt;
    &lt;button class="button button-block button-calm" ng-click="salvarUsuario(nomeperfil, snperfil, fotoperfil)"&gt;Salvar&lt;/button&gt;
  &lt;/div&gt;
</code></pre>

<p>My controller for the page were the modal is launched (just the camera part, if needed I'll add more code):</p>

<pre><code>.controller('AppCtrl', function($scope, $rootScope, $ionicModal, $cordovaNetwork, $localStorage, $ionicPopup, $cordovaCamera, $state, $ionicPlatform, client) {
   $scope.escolhefotoperfil = function(){
   var options = {
     quality: 50,
     destinationType: 0,
     sourceType: 0,
     allowEdit: true,
     encodingType: 1,
     targetWidth: 300,
     targetHeight: 300,
     popoverOptions: CameraPopoverOptions,
     saveToPhotoAlbum: false
   };

   $cordovaCamera.getPicture(options).then(function (imageData) {
      $scope.fotoperfil = imageData;
   }, function (err) {
     $scope.errofoto = "Erro ao escolher foto: " + err.message;
   });
 };
});
</code></pre>

<p>I've tried:</p>

<ul>
<li>Reinstall the plugin</li>
<li>Reinstall platform</li>
<li>Change <em>DATA_URL</em> to <em>FILE_URI</em></li>
<li>Taking out the <em>'data:image/jpeg;base64,'</em> from the <em>&lt; img ></em> tag and using it on the function with <em>imageData</em></li>
</ul>

<p>Can someone help me out?</p>

<p><strong>EDIT:</strong></p>

<p>Using <em>Chrome Inspect</em> it shows the following error when trying to load an image:</p>

<p><em><strong>Refused to load the image because it violates the following Content Security Policy directive: "default-src *". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.</strong></em> on ionic.bundle.js:16438</p>

<p>Now i've add the <strong>img-src 'self' *;</strong> to my meta tag on my index, the error changed to:</p>

<p><em><strong>Refused to load the image because it violates the following Content Security Policy directive: "img-src *".</strong></em></p>