title: Cannot read property 'getPicture' of undefined
body: <blockquote>
    <p>Before opening this topic, I read several answers here, but all are
    very old and none worked.</p>
  </blockquote>
  
  <p>I'm new to Cordova.</p>
  
  <p>I am trying to use the <strong>cordova-plugin-camera plugin</strong>.</p>
  
  <p>I generate the apk, and when I'm going to test it on my phone (<strong>MotoG 3 - Android 6.0</strong>), it doesn't open.</p>
  
  <p>Using debug shows this error:</p>
  
  <blockquote>
    <p>Cannot read property 'getPicture' of undefined</p>
  </blockquote>
  
  <p>This code of mine:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta name="format-detection" content="telephone=no"&gt;
      &lt;meta name="msapplication-tap-highlight" content="no"&gt;
      &lt;meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover"&gt;
      &lt;link rel="stylesheet" type="text/css" href="css/style.css"&gt;
      &lt;link rel="shortcut icon" href="img/favicon.png"  /&gt;
  
      &lt;title&gt;Foto&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
  
      &lt;div class="app"&gt;
  
        &lt;button type="button" class="btn" id="cameraApp"&gt;Take a picture&lt;/button&gt;
        &lt;img src="" id="myImage"&gt;
  
  
      &lt;/div&gt;
  
  
  
  
      &lt;script src="js/jquery-3.4.1.min.js"&gt;&lt;/script&gt;
  
      &lt;script&gt;
  
        document.getElementById('cameraApp').addEventListener('click', cameraApp);
        function cameraApp() {
          navigator.camera.getPicture(onSuccess, onFail,{
            quality: 100,
            saveToPhotoAlbum: true,
            destinatinType: Camera.DestinatinType.DATA_URL
          });
  
          function onSuccess(imageData){
            var image = document.getElementById('myImage');
            image.src = "data:image/jpeg;base64," + imageData;
          }
  
          function onFail(message){
            alert('Falhou: ' + message);
          }
        }
  
      &lt;/script&gt;
  
  
    &lt;/body&gt;
  &lt;/html&gt;
  
  </code></pre>
  
  <h2>CONFIG.XML</h2>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;widget id="com.myapp.app" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android" &gt;
      &lt;name&gt;F.C. APP&lt;/name&gt;
      &lt;description&gt;
          Myapp
      &lt;/description&gt;
      &lt;author email="sac@mysite.net" href="www.mysite.net"&gt;
          Hostcia.net
      &lt;/author&gt;
      &lt;content src="index.html" /&gt;
      &lt;plugin name="cordova-plugin-whitelist" spec="1" /&gt;
      &lt;access origin="*" /&gt;
      &lt;allow-intent href="http://*/*" /&gt;
      &lt;allow-intent href="https://*/*" /&gt;
      &lt;allow-intent href="tel:*" /&gt;
      &lt;allow-intent href="sms:*" /&gt;
      &lt;allow-intent href="mailto:*" /&gt;
      &lt;allow-intent href="geo:*" /&gt;
      &lt;platform name="android"&gt;
          &lt;allow-intent href="market:*" /&gt;
          &lt;icon src="www/img/favicon.png" width="57" height="57" density="mdpi" /&gt;
          &lt;custom-config-file target="AndroidManifest.xml" parent="/*"&gt;
              &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
              &lt;uses-permission android:name="android.permission.NETWORK_ACCESS" /&gt;
              &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
              &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
              &lt;uses-feature android:name="android.hardware.camera" /&gt;
              &lt;uses-feature android:name="android.hardware.camera.autofocus" /&gt;
            &lt;/custom-config-file&gt;
      &lt;/platform&gt;
      &lt;platform name="ios"&gt;
          &lt;allow-intent href="itms:*" /&gt;
          &lt;allow-intent href="itms-apps:*" /&gt;
      &lt;/platform&gt;
  &lt;/widget&gt;
  
  </code></pre>
  
  <h2>What am I doing wrong?</h2>