title: How to integrate ZXing Library to Android Studio for Barcode Scanning?
body: <p>I've been looking all over internet how to include zxing library to my project, and I found this tutorial: <a href="http://blog.dihaw.com/integrating-zxing-in-your-android-app-as-standalone-scanner/" rel="nofollow noreferrer">http://blog.dihaw.com/integrating-zxing-in-your-android-app-as-standalone-scanner/</a></p>
  
  <p>But when I reach the point that you need to check for BeepManager to add the R import I get all kinds of errors in my project (Even on the MainActivity) that it couldn't find R.</p>
  
  <p>Also I found this one <a href="https://github.com/journeyapps/zxing-android-embedded/blob/master/README.md" rel="nofollow noreferrer">https://github.com/journeyapps/zxing-android-embedded/blob/master/README.md</a> which seemed a lot easier because it was auto integrated by gradle, but when I sync it pops an error that it couldn't find the files.</p>
  
  <p>Any help would be appreciated :) I'm new to Android Studio.</p>
  
  <p>EDIT:</p>
  
  <p>I added the settings of the 2nd method (the one with the gradle settings) to my build.gradle and 4 error pop up: </p>
  
  <pre><code>Error:Failed to find: com.embarkmobile:zxing-android-legacy:2.0.0 
  Error:Failed to find: com.google.zxing:core:3.0.1 
  Error:Failed to find: com.embarkmobile:zxing-android-integration:2.0.0 
  Error:Failed to find: com.embarkmobile:zxing-android-minimal:2.0.0
  </code></pre>
  
  <p>Any help?</p>
  
  <p>---ANSWER---</p>
  
  <h1>To fix this problem I needed to disable Offline Work on Gradle.</h1>
  
  <ul>
  <li>Android Studio's settings>Gradle>Uncheck 'offline work'</li>
  </ul>