Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing a Library causes ClassNotFoundException
    primarykey
    data
    text
    <p>I took a fully working application and copied it and made it a library (Properties -> Android, Is Library). I also renamed this project to keep track of it separately - com.mylib.</p> <p>I then took the original application com.myapp and removed all the .java files except for one with some data (no actual code). I linked this up via Properties -> Android, and in the Library section added in the mylib library. It shows up with a green check. </p> <p>Changed the myapp's manifest activities to all have the library as the prefix as recommended by Google.</p> <pre><code>android:name="com.mylib.AppInfo" </code></pre> <p>Cleaned both the library and the project, and exited and restarted Eclipse as well. Compiles fine, and the program runs the main activity "AppInfo", but attempting to get to other activities always fails with ClassNotFoundException. </p> <p>I've also tried different name prefixes in the myapp manifest such as:</p> <pre><code>android:name="com.myapp.AppInfo" android:name=".AppInfo" </code></pre> <p>But these fail to get to the main app. Although no activity class names were changed in the library or the myapp manifest, I've reviewed them character by character to be sure they all match up both in case and exact letter.</p> <p>Using Eclipse under Windows 7 x64, and the app is set for minSdk of 11. Latest SDK tools also loaded (v20.0.3). Also Proguard is not being used (yet), and I'm using actual hardware (Android 4.0).</p> <p>I'm pulling my hair out trying to get the library to work. I have a completely different library and app pair working the same way on another project, and I've compared every property and option between the two libraries and projects and can't find anything that is missing or added that causes this to fail.</p> <p>Here's the full error from LogCat:</p> <pre><code>java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.myapp/com.myapp.LiveWallpaperSettings}: java.lang.ClassNotFoundException: com.myapp.LiveWallpaperSettings </code></pre> <p>Any suggestions or ideas on how to track this down? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload