title: Failed resolution of: Lcom/abhi/barcode/frag/libv2/R$string
body: <p>i'm trying to launch an Activity with a Fragment inside that is doing a QR scan, 
  i'm using this library for that > 
  <a href="https://code.google.com/archive/p/barcodefraglibv2/" rel="nofollow">https://code.google.com/archive/p/barcodefraglibv2/</a></p>
  
  <p>I do everything by instructions but when i run the app it throws away an exception : </p>
  
  <pre><code>Failed resolution of: Lcom/abhi/barcode/frag/libv2/R$string
  </code></pre>
  
  <p>what am i doing wrong ? </p>
  
  <p>here is my MainActivity: </p>
  
  <pre><code>package apps.radwin.zxingprojectfragmentsthree;
  
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  import android.view.View;
  import android.widget.Button;
  import android.widget.Toast;
  
  import com.abhi.barcode.frag.libv2.BarcodeFragment;
  import com.abhi.barcode.frag.libv2.IScanResultHandler;
  import com.abhi.barcode.frag.libv2.ScanResult;
  import com.google.zxing.BarcodeFormat;
  
  import java.util.EnumSet;
  
  public class MainActivity extends FragmentActivity implements IScanResultHandler {
  
          BarcodeFragment fragment;
          Button btn;
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
              fragment = (BarcodeFragment)getSupportFragmentManager().findFragmentById(R.id.sample);
              fragment.setScanResultHandler(this);
              btn = ((Button)findViewById(R.id.scan));
              btn.setEnabled(false);
  
              // Support for adding decoding type
              fragment.setDecodeFor(EnumSet.of(BarcodeFormat.QR_CODE));
          }
  
          @Override
          public void scanResult(ScanResult result) {
              btn.setEnabled(true);
              Toast.makeText(this, result.getRawResult().getText(), Toast.LENGTH_LONG).show();
          }
  
          public void scanAgain(View v){
              fragment.restart();
          }
      }
  </code></pre>
  
  <p>here is my build.gradle file</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.3"
  
      defaultConfig {
          applicationId "apps.radwin.zxingprojectfragmentsthree"
          minSdkVersion 16
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.4.0'
      compile files('libs/barcodelib.jar')
      compile files('libs/core.jar')
  }
  </code></pre>
  
  <p>My Activity XML ></p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:paddingBottom="@dimen/activity_vertical_margin"
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin"
          android:paddingTop="@dimen/activity_vertical_margin"
          tools:context=".MainActivity"&gt;
  
          &lt;fragment
              android:id="@+id/sample"
              android:name="com.abhi.barcode.frag.libv2.BarcodeFragment"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_above="@+id/scan"
              android:layout_alignParentTop="true"
              android:layout_centerHorizontal="true" /&gt;
  
          &lt;Button
              android:id="@+id/scan"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerHorizontal="true"
              android:layout_centerVertical="true"
              android:onClick="scanAgain"
              android:text="Re-Scan" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>my exception is: </p>
  
  <pre><code>FATAL EXCEPTION: main
  
  Process: apps.radwin.zxingprojectfragmentsthree, PID: 11692
  java.lang.NoClassDefFoundError: Failed resolution of: Lcom/abhi/barcode/frag/libv2/R$string;
  at com.abhi.barcode.frag.libv2.BarcodeFragment.displayFrameworkBugMessageAndExit(BarcodeFragment.java:345)
  at com.abhi.barcode.frag.libv2.BarcodeFragment.initCamera(BarcodeFragment.java:338)
  at com.abhi.barcode.frag.libv2.BarcodeFragment.surfaceCreated(BarcodeFragment.java:212)
  at android.view.SurfaceView.updateWindow(SurfaceView.java:712)
  at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:209)
  at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1014)
  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2510)
  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437)
  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7397)
  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
  at android.view.Choreographer.doCallbacks(Choreographer.java:695)
  at android.view.Choreographer.doFrame(Choreographer.java:631)
  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
  at android.os.Handler.handleCallback(Handler.java:739)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:158)
  at android.app.ActivityThread.main(ActivityThread.java:7224)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
  Caused by: java.lang.ClassNotFoundException: Didn't find class "com.abhi.barcode.frag.libv2.R$string" on path: DexPathList[[zip file "/data/app/apps.radwin.zxingprojectfragmentsthree-1/base.apk"],nativeLibraryDirectories=[/data/app/apps.radwin.zxingprojectfragmentsthree-1/lib/arm64, /vendor/lib64, /system/lib64]]
  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
  at com.abhi.barcode.frag.libv2.BarcodeFragment.displayFrameworkBugMessageAndExit(BarcodeFragment.java:345) 
  at com.abhi.barcode.frag.libv2.BarcodeFragment.initCamera(BarcodeFragment.java:338) 
  at com.abhi.barcode.frag.libv2.BarcodeFragment.surfaceCreated(BarcodeFragment.java:212) 
  at android.view.SurfaceView.updateWindow(SurfaceView.java:712) 
  at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:209) 
  at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1014) 
  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2510) 
  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437) 
  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7397) 
  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920) 
  at android.view.Choreographer.doCallbacks(Choreographer.java:695) 
  at android.view.Choreographer.doFrame(Choreographer.java:631) 
  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906) 
  at android.os.Handler.handleCallback(Handler.java:739) 
  at android.os.Handler.dispatchMessage(Handler.java:95) 
  at android.os.Looper.loop(Looper.java:158) 
  at android.app.ActivityThread.main(ActivityThread.java:7224) 
  at java.lang.reflect.Method.invoke(Native Method) 
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
  Suppressed: java.lang.ClassNotFoundException: com.abhi.barcode.frag.libv2.R$string
  at java.lang.Class.classForName(Native Method)
  at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
  at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
  ... 21 more
  Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
  </code></pre>
  
  <p>in my app/libs folder, i have two files, barcodelib.jar, and code.jar, 
  i pressed in my android studio on the barcodelib.jar file right click, then add as a library, i cannot press that on the core.jar as well, it doesn't give the option.</p>
  
  <p>can you help me by saying what am i doing wrong ?</p>