title: Including a JAR library to android project and starting an activity from it
body: <p>I'm trying to create a Library project in Android and use that library in other projects.</p>
  
  <p>I've created a simple Library project, with one layout that shows some text. Checked it's set to 'is Library' and on went.</p>
  
  <p>I took the Jar file that was created in the 'bin' directory, copied to a new project to the 'assets' folder (tried the 'libs' approach as well, same results).</p>
  
  <p>I've checked in 'properties -> java build path -> order and export' and it's there and is selected.</p>
  
  <p>In the application I'm trying to launch an Activity from the library, using:</p>
  
  <pre><code>    Button btnLoad = (Button)findViewById(R.id.btnLoadLibrary);
      btnLoad.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Intent intent = new Intent(MainActivity.this, LibraryActivity.class);
              startActivityForResult(intent, 0);
          }
      });
  </code></pre>
  
  <p>Having imported the library:</p>
  
  <pre><code>import com.example.superlibrary.LibraryActivity;
  </code></pre>
  
  <p>No errors here.</p>
  
  <p>Then, when I launch the application and push the button, I get:</p>
  
  <pre><code>05-01 20:24:07.030: E/AndroidRuntime(19011): FATAL EXCEPTION: main
  05-01 20:24:07.030: E/AndroidRuntime(19011): java.lang.NoClassDefFoundError: com.example.superlibrary.R$layout
  05-01 20:24:07.030: E/AndroidRuntime(19011):    at com.example.superlibrary.LibraryActivity.onCreate(LibraryActivity.java:12)
  05-01 20:24:07.030: E/AndroidRuntime(19011):    at android.app.Activity.performCreate(Activity.java:5206)
  05-01 20:24:07.030: E/AndroidRuntime(19011):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
  </code></pre>
  
  <p>To make sure, I've checked the manifest file of the application and I have there:</p>
  
  <pre><code>    &lt;activity
          android:name="com.example.superlibrary.LibraryActivity"
          android:label="LibraryActivity" &gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>So it's being recognized and included...</p>
  
  <p>Any ideas why this error would happen? (java.lang.NoClassDefFoundError)</p>
  
  <p>Thanks!</p>