title: Cordova Plugin not loading com.google.zxing.client.j2se
body: <p>I'm working on a Cordova Plugin and want to add the functionality of printing QR codes. In order to do that I decided to use the ZXing library.</p>
  <p>I'm registering the dependencies of the library in the <code>plugin.xml</code> file like this</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;framework src=&quot;com.google.zxing:core:3.3.0&quot; value=&quot;gradle&quot; /&gt;
  &lt;framework src=&quot;com.google.zxing:javase:3.3.0&quot; value=&quot;gradle&quot; /&gt;
  </code></pre>
  <p>And importing the packages in the code like this</p>
  <pre class="lang-java prettyprint-override"><code>import com.google.zxing.BarcodeFormat;
  import com.google.zxing.WriterException;
  import com.google.zxing.client.j2se.MatrixToImageWriter;
  import com.google.zxing.common.BitMatrix;
  import com.google.zxing.qrcode.QRCodeWriter;
  </code></pre>
  <p>And this is the part of the code that uses ZXing</p>
  <pre class="lang-java prettyprint-override"><code>boolean printQRCode(CallbackContext callbackContext, String str) throws WriterException, IOException {
      try {
          QRCodeWriter qrCodeWriter = new QRCodeWriter();
          BitMatrix bitMatrix = qrCodeWriter.encode(str, BarcodeFormat.QR_CODE, 100, 100);
              
          ByteArrayOutputStream pngOutputStream = new ByteArrayOutputStream();
          MatrixToImageWriter.writeToStream(bitMatrix, &quot;PNG&quot;, pngOutputStream);
          byte[] pngData = pngOutputStream.toByteArray(); 
  
          mmOutputStream.write(pngData);
  
          Log.d(LOG_TAG, &quot;PRINT QRCODE SENT&quot;);
          callbackContext.success(&quot;PRINT QRCODE SENT&quot;);
          return true;
      } catch (Exception e) {
          String errMsg = e.getMessage();
          Log.e(LOG_TAG, errMsg);
          e.printStackTrace();
          callbackContext.error(errMsg);
      }
  
      return false  
  }
  </code></pre>
  <p>The thing is I'm receiving the following errors</p>
  <blockquote>
  <p>error: package com.google.zxing.client.j2se does not exist</p>
  <p>error: cannot find symbol (MatrixToImageWriter)</p>
  </blockquote>
  <p>I found some solutions in SO and Google but none of them explain how to solve the issue in a Cordova project setup. I'm really not very experienced in Java and, if possible, I would prefer to just configure ZXing through the <code>plugin.xml</code> file. Any</p>
  <p>Thanks!</p>