Note that there are some explanatory texts on larger screens.

plurals
  1. POJar-file issue with ADT r17
    text
    copied!<p>I seem to have a tricky problem since the latest ADT update to release 17.</p> <p>I have made a simple application to illustrate my problem, I don't know if I'm doing anything wrong. The main Activity of my application is inheriting from FragmentActivity in the support package and somehow the application crashes at launch.</p> <p>To illustrate, I made a sample project.</p> <p>First of all, here is the code of my dummy class, DummyProjectActivity, very simple:</p> <pre><code>public class DummyProjectActivity extends FragmentActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } </code></pre> <p>Then, there is the manifest:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="be.emich.labs" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" &gt; &lt;activity android:name=".DummyProjectActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>The .jar file is imported correctly in the project and I am getting this stack trace:</p> <pre><code>E/AndroidRuntime(11509): FATAL EXCEPTION: main E/AndroidRuntime(11509): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{be.emich.labs/be.emich.labs.DummyProjectActivity}: java.lang.ClassNotFoundException: be.emich.labs.DummyProjectActivity E/AndroidRuntime(11509): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1879) E/AndroidRuntime(11509): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980) E/AndroidRuntime(11509): at android.app.ActivityThread.access$600(ActivityThread.java:122) E/AndroidRuntime(11509): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146) E/AndroidRuntime(11509): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(11509): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime(11509): at android.app.ActivityThread.main(ActivityThread.java:4340) E/AndroidRuntime(11509): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(11509): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime(11509): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) E/AndroidRuntime(11509): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) E/AndroidRuntime(11509): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(11509): Caused by: java.lang.ClassNotFoundException: be.emich.labs.DummyProjectActivity E/AndroidRuntime(11509): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) E/AndroidRuntime(11509): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) E/AndroidRuntime(11509): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) E/AndroidRuntime(11509): at android.app.Instrumentation.newActivity(Instrumentation.java:1023) E/AndroidRuntime(11509): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1870) E/AndroidRuntime(11509): ... 11 more </code></pre> <p>What am I doing wrong here? Could this be a bug in the latest dev tools?</p> <p>I am encountering the problem in every project that uses FragmentActivity from the compatibility library. I don't get what could be wrong. Anyone else having this problem? Help would be greatly appreciated. I'm not having the problem with an Activity that inherits from FragmentActivity. I have uninstalled/reinstalled the application. Done various "clean project". Restarted Eclipse.</p> <p>UPDATE: The issue is apparently not linked to the compatibility package but the way ADT r17 handles linking of jar files. Jars to be included should be put into the libs/ folder and ADT will link them automatically. Otherwise they will be missing from the APK and make the app crash whenever the code from the jarfile is invoked.</p>
 

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