Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to resolve FragmentActivity running on Android 2.3.3 with compatibility package v4
    text
    copied!<p>I'm building a simple hello world app to learn about the Android Compatibility Package. I'm able to get the app to run on the 3.2 emulator but when I run it on a 2.3.3 emulator I get </p> <pre><code>10-12 11:36:14.474: WARN/dalvikvm(469): Unable to resolve superclass of Lcom/example/MyActivity; (11) 10-12 11:36:14.564: WARN/dalvikvm(469): Link of class 'Lcom/example/MyActivity;' failed 10-12 11:36:14.564: DEBUG/AndroidRuntime(469): Shutting down VM 10-12 11:36:14.584: WARN/dalvikvm(469): threadid=1: thread exiting with uncaught exception (group=0x40015560) 10-12 11:36:14.624: ERROR/AndroidRuntime(469): FATAL EXCEPTION: main java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example/com.example.MyActivity}: java.lang.ClassNotFoundException: com.example.MyActivity in loader dalvik.system.PathClassLoader[/data/app/com.example-1.apk] </code></pre> <p>So obviously it can't find FragmentActivity (which is the super of com.example.MyActivity). I just don't know why.</p> <p>Some things to note:</p> <p>1) I'm following the tutorials at <a href="http://mobile.tutsplus.com/tutorials/android/android-compatibility-working-with-fragments/" rel="nofollow">http://mobile.tutsplus.com/tutorials/android/android-compatibility-working-with-fragments/</a> which isn't very thorough. </p> <p>2) I'm pretty sure I'm building the compatibility package into the APK correctly with maven. I installed the jar in my local maven repository and am depending on it with compile. I think that if I weren't building it in correctly it wouldn't be running on the 3.2 emulator.</p> <p>3) I've tried building with IntelliJ and the maven-compiler-plugin. Same result.</p> <p>Any help would be greatly appreciated. Thanks.</p> <p>EDIT... Here's the Manifest </p> <pre><code>&lt;uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;application android:label="@string/app_name" android:icon="@drawable/icon"&gt; &lt;activity android:name=".MyActivity" 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;activity android:name=".TutViewerActivity" android:label="@string/app_name" &gt; &lt;/activity&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion="7" /&gt; </code></pre> <p></p> <p>and the MyActivity definition</p> <pre><code>public class MyActivity extends FragmentActivity implements TutListFragment.OnTutSelectedListener </code></pre>
 

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