Android ClassNotFoundException - android

I have problem with my app, everything was working fine yesterday but today I updated sdk and now when I'm trying to run my app I'm getting errors like this
05-21 00:14:19.285: W/dalvikvm(7061): Unable to resolve superclass of Lcom/lpp/towndefence/MainMenuActivity; (122)
05-21 00:14:19.285: W/dalvikvm(7061): Link of class 'Lcom/lpp/towndefence/MainMenuActivity;' failed
05-21 00:14:19.285: D/AndroidRuntime(7061): Shutting down VM
05-21 00:14:19.285: W/dalvikvm(7061): threadid=1: thread exiting with uncaught exception (group=0x40018560)
05-21 00:14:19.345: E/AndroidRuntime(7061): FATAL EXCEPTION: main
05-21 00:14:19.345: E/AndroidRuntime(7061): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.lpp.towndefence/com.lpp.towndefence.MainMenuActivity}: java.lang.ClassNotFoundException: com.lpp.towndefence.MainMenuActivity in loader dalvik.system.PathClassLoader[/data/app/com.lpp.towndefence-1.apk]
05-21 00:14:19.345: E/AndroidRuntime(7061): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1679)
05-21 00:14:19.345: E/AndroidRuntime(7061): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1783)
05-21 00:14:19.345: E/AndroidRuntime(7061): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
05-21 00:14:19.345: E/AndroidRuntime(7061): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:938)
05-21 00:14:19.345: E/AndroidRuntime(7061): at android.os.Handler.dispatchMessage(Handler.java:99)
05-21 00:14:19.345: E/AndroidRuntime(7061): at android.os.Looper.loop(Looper.java:130)
05-21 00:14:19.345: E/AndroidRuntime(7061): at android.app.ActivityThread.main(ActivityThread.java:3837)
05-21 00:14:19.345: E/AndroidRuntime(7061): at java.lang.reflect.Method.invokeNative(Native Method)
05-21 00:14:19.345: E/AndroidRuntime(7061): at java.lang.reflect.Method.invoke(Method.java:507)
05-21 00:14:19.345: E/AndroidRuntime(7061): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
05-21 00:14:19.345: E/AndroidRuntime(7061): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
05-21 00:14:19.345: E/AndroidRuntime(7061): at dalvik.system.NativeStart.main(Native Method)
05-21 00:14:19.345: E/AndroidRuntime(7061): Caused by: java.lang.ClassNotFoundException: com.lpp.towndefence.MainMenuActivity in loader dalvik.system.PathClassLoader[/data/app/com.lpp.towndefence-1.apk]
05-21 00:14:19.345: E/AndroidRuntime(7061): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
05-21 00:14:19.345: E/AndroidRuntime(7061): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
05-21 00:14:19.345: E/AndroidRuntime(7061): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-21 00:14:19.345: E/AndroidRuntime(7061): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-21 00:14:19.345: E/AndroidRuntime(7061): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1671)
05-21 00:14:19.345: E/AndroidRuntime(7061): ... 11 more
my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lpp.towndefence"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:label="#string/app_name"
android:name=".MainMenuActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".TownDefenseActivity">
</activity>
</application>
</manifest>
I cleaned project, fixed project properties but it didn't help.

Like #Barak said: jar files goes in libs directory. But make sure that libraries are checked at "project properties" -> "java build path" -> "order and export" too.

Related

Live video streaming issue on Micromax A117

I getting some issue on live video streaming.
05-21 17:56:34.589: E/DrmMtkUtil/DrmUtil(136): checkExistence failed, reason [No such file or directory]
05-21 17:56:34.589: E/DrmMtkUtil/DrmUtil(136): checkDcf: file does not exist.
05-21 17:56:34.595: E/AndroidRuntime(27984): FATAL EXCEPTION: main
05-21 17:56:34.595: E/AndroidRuntime(27984): java.lang.NullPointerException
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.widget.VideoView.openVideo(VideoView.java:421)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.widget.VideoView$6.surfaceCreated(VideoView.java:730)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.SurfaceView.updateWindow(SurfaceView.java:606)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.SurfaceView.access$000(SurfaceView.java:88)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:183)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:692)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2123)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4879)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.Choreographer.doCallbacks(Choreographer.java:579)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.Choreographer.doFrame(Choreographer.java:548)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.os.Handler.handleCallback(Handler.java:725)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.os.Handler.dispatchMessage(Handler.java:92)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.os.Looper.loop(Looper.java:153)
05-21 17:56:34.595: E/AndroidRuntime(27984): at android.app.ActivityThread.main(ActivityThread.java:5297)
05-21 17:56:34.595: E/AndroidRuntime(27984): at java.lang.reflect.Method.invokeNative(Native Method)
05-21 17:56:34.595: E/AndroidRuntime(27984): at java.lang.reflect.Method.invoke(Method.java:511)
05-21 17:56:34.595: E/AndroidRuntime(27984): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
05-21 17:56:34.595: E/AndroidRuntime(27984): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
05-21 17:56:34.595: E/AndroidRuntime(27984): at dalvik.system.NativeStart.main(Native Method)
Please suggest me

I am trying to follow a tutorial here:

trying to follow this tutorial:
http://www.youtube.com/watch?annotation_id=annotation_413231&feature=iv&src_vid=lQW1WQOCri0&v=zVIZSKP3tR8
to use AndEngine and by the time I reach the end I got two errors with the styles.xml files in the "values-v11" and "values-v14" folders (res parrent folder).
resources-->values-v11--> style.xml
Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'.
in resources-->values-v14--> style.xml
Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'.
I looked them up and was told to replace them with this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomWindowTitleBackground">
</style>
</resources>
Then I got an error in the main.xml file saying: “No resource identifier found for attribute 'showAsAction' in package 'android'” and was told to remove the "android:showAsAction="never" line resulting in this:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="#+id/action_settings"
android:orderInCategory="100"
android:title="#string/action_settings"/>
</menu>
This got rid of the errors. But now when I run it on my phone the phone says "Unfortunately, myTestProject has stopped"
Why is this? here is my logcat errors:
05-21 06:52:24.701: W/dalvikvm(8377): threadid=1: thread exiting with uncaught exception (group=0x40ac19d8)
05-21 06:52:24.701: E/AndroidRuntime(8377): FATAL EXCEPTION: main
05-21 06:52:24.701: E/AndroidRuntime(8377): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mystuff/com.mystuff.MainActivity}: java.lang.ClassNotFoundException: com.mystuff.MainActivity
05-21 06:52:24.701: E/AndroidRuntime(8377): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
05-21 06:52:24.701: E/AndroidRuntime(8377): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-21 06:52:24.701: E/AndroidRuntime(8377): at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-21 06:52:24.701: E/AndroidRuntime(8377): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-21 06:52:24.701: E/AndroidRuntime(8377): at android.os.Handler.dispatchMessage(Handler.java:99)
05-21 06:52:24.701: E/AndroidRuntime(8377): at android.os.Looper.loop(Looper.java:137)
05-21 06:52:24.701: E/AndroidRuntime(8377): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-21 06:52:24.701: E/AndroidRuntime(8377): at java.lang.reflect.Method.invokeNative(Native Method)
05-21 06:52:24.701: E/AndroidRuntime(8377): at java.lang.reflect.Method.invoke(Method.java:511)
05-21 06:52:24.701: E/AndroidRuntime(8377): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
05-21 06:52:24.701: E/AndroidRuntime(8377): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
05-21 06:52:24.701: E/AndroidRuntime(8377): at dalvik.system.NativeStart.main(Native Method)
05-21 06:52:24.701: E/AndroidRuntime(8377): Caused by: java.lang.ClassNotFoundException: com.mystuff.MainActivity
05-21 06:52:24.701: E/AndroidRuntime(8377): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
05-21 06:52:24.701: E/AndroidRuntime(8377): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-21 06:52:24.701: E/AndroidRuntime(8377): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-21 06:52:24.701: E/AndroidRuntime(8377): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
05-21 06:52:24.701: E/AndroidRuntime(8377): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
05-21 06:52:24.701: E/AndroidRuntime(8377): ... 11 more

Is there a way to use junit.extensions.TestSetup for tests on Android?

The android sdk source includes source for junit.extensions, but the classes are not in android.jar even though junit.framework and junit.runner are in there. I tried creating my own junit.extensions package and using the source included in the android sdk source, but I get a ClassCastException (see below). Something in android.test.suitebuilder is trying to cast the return value from the suite() method to a TestCase, even though suite returns a Test interface.
I want to use TestSetup class from junit.extensions, as in the following example (see http://etutorials.org/Programming/Java+extreme+programming/Chapter+4.+JUnit/4.7+One-Time+Set+Up+and+Tear+Down/):
public SomeTestCase extends TestCase {
public static Test suite() {
TestSetup setup = new TestSetup(new TestSuite(SomeTestCase.class)) {
#Override
protected void setUp( ) throws Exception {
// do your one-time setup here!
}
#Override
protected void tearDown( ) throws Exception {
// do your one-time tear down here!
}
};
return setup;
}
public void someTestMethod() { }
}
However, I get the following error:
05-21 08:10:14.152: I/TestRunner(1316): java.lang.RuntimeException: Exception during suite construction
05-21 08:10:14.152: I/TestRunner(1316): at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:238)
05-21 08:10:14.152: I/TestRunner(1316): at java.lang.reflect.Method.invokeNative(Native Method)
05-21 08:10:14.152: I/TestRunner(1316): at java.lang.reflect.Method.invoke(Method.java:511)
05-21 08:10:14.152: I/TestRunner(1316): at junit.framework.TestCase.runTest(TestCase.java:154)
05-21 08:10:14.152: I/TestRunner(1316): at junit.framework.TestCase.runBare(TestCase.java:127)
05-21 08:10:14.152: I/TestRunner(1316): at junit.framework.TestResult$1.protect(TestResult.java:106)
05-21 08:10:14.152: I/TestRunner(1316): at junit.framework.TestResult.runProtected(TestResult.java:124)
05-21 08:10:14.152: I/TestRunner(1316): at junit.framework.TestResult.run(TestResult.java:109)
05-21 08:10:14.152: I/TestRunner(1316): at junit.framework.TestCase.run(TestCase.java:118)
05-21 08:10:14.152: I/TestRunner(1316): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
05-21 08:10:14.152: I/TestRunner(1316): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
05-21 08:10:14.152: I/TestRunner(1316): at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:545)
05-21 08:10:14.152: I/TestRunner(1316): at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1551)
05-21 08:10:14.152: I/TestRunner(1316): Caused by: java.lang.ClassCastException: com.somebody.test.SomeTestCase$1 cannot be cast to junit.framework.TestCase
05-21 08:10:14.152: I/TestRunner(1316): at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:188)
05-21 08:10:14.152: I/TestRunner(1316): at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:379)
05-21 08:10:14.152: I/TestRunner(1316): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3920)
05-21 08:10:14.152: I/TestRunner(1316): at android.app.ActivityThread.access$1300(ActivityThread.java:123)
05-21 08:10:14.152: I/TestRunner(1316): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
05-21 08:10:14.152: I/TestRunner(1316): at android.os.Handler.dispatchMessage(Handler.java:99)
05-21 08:10:14.152: I/TestRunner(1316): at android.os.Looper.loop(Looper.java:137)
05-21 08:10:14.152: I/TestRunner(1316): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-21 08:10:14.152: I/TestRunner(1316): at java.lang.reflect.Method.invokeNative(Native Method)
05-21 08:10:14.152: I/TestRunner(1316): at java.lang.reflect.Method.invoke(Method.java:511)
05-21 08:10:14.152: I/TestRunner(1316): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-21 08:10:14.152: I/TestRunner(1316): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-21 08:10:14.152: I/TestRunner(1316): at dalvik.system.NativeStart.main(Native Method)
The suite() method of a TestCase is supposed to return a Test, but it appears something in android os is trying to cast it to a TestCase.
As one attempt to resolve the problem, I tweaked the TestDecorator class so that it subclassed TestCase instead of Test, but it still gave the same ClassCastException, which really mystified me.
By the way, there seems to be some doubt about android.jar containing junit, so here is a partial listing of android.jar contents:
$ jar tf android.jar | more
META-INF/
META-INF/MANIFEST.MF
assets/
assets/images/
assets/images/android-logo-mask.png
assets/images/android-logo-shine.png
assets/sounds/
assets/sounds/bootanim1.raw
assets/sounds/bootanim0.raw
assets/webkit/
assets/webkit/android-weberror.png
assets/webkit/togglePlugin.png
assets/webkit/nullPlugin.png
assets/webkit/youtube.html
assets/webkit/missingImage.png
assets/webkit/youtube.png
assets/webkit/textAreaResizeCorner.png
assets/webkit/play.png
junit/
junit/framework/
junit/framework/TestSuite.class
junit/framework/ComparisonFailure.class
junit/framework/Assert.class
junit/framework/TestListener.class
junit/framework/TestResult.class
junit/framework/Test.class
junit/framework/TestFailure.class
junit/framework/Protectable.class
junit/framework/TestCase.class
junit/framework/AssertionFailedError.class
junit/runner/
junit/runner/TestSuiteLoader.class
junit/runner/Version.class
junit/runner/BaseTestRunner.class
You can also see it listed in the package contents on the android reference site at https://developer.android.com/reference/packages.html. If you continue to doubt, please browse your copy of android.jar.
Any helpful suggestions? Has anyone successfully used junit.extensions.TestSetup with android?

Unable to instantiate activity error? how to solve it?

I made an App. and since I just wanted to test some functions before adding them to the App,
I decided to copy my project into a new Project. When I tried to run the new project, the app crashes and the log-cat output is as follows.
Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.androidbook.MP"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" android:debuggable="true">
<activity
android:name=".MPActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="AddLocationActivity"></activity>
<activity android:name="MPData"></activity>
<activity android:name="MyLocations"></activity>
<activity android:name="MPInfo"></activity>
<activity android:name="Navigation"></activity>
</application>
LogCat:
05-21 15:30:03.710: E/AndroidRuntime(11294): FATAL EXCEPTION: main
05-21 15:30:03.710: E/AndroidRuntime(11294): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.androidbook.MP/com.androidbook.MP.MPActivity}:
java.lang.ClassNotFoundException: com.androidbook.MP.MPActivity in loader
dalvik.system.PathClassLoader[/data/app/com.androidbook.MP-1.apk]
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.os.Handler.dispatchMessage(Handler.java:99)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.os.Looper.loop(Looper.java:130)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread.main(ActivityThread.java:3691)
05-21 15:30:03.710: E/AndroidRuntime(11294): at java.lang.reflect.Method.invokeNative(Native Method)
05-21 15:30:03.710: E/AndroidRuntime(11294): at java.lang.reflect.Method.invoke(Method.java:507)
05-21 15:30:03.710: E/AndroidRuntime(11294): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
05-21 15:30:03.710: E/AndroidRuntime(11294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
05-21 15:30:03.710: E/AndroidRuntime(11294): at dalvik.system.NativeStart.main(Native Method)
05-21 15:30:03.710: E/AndroidRuntime(11294): Caused by: java.lang.ClassNotFoundException: com.androidbook.MP.MPActivity in loader dalvik.system.PathClassLoader[/data/app/com.androidbook.MP-1.apk]
05-21 15:30:03.710: E/AndroidRuntime(11294): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
05-21 15:30:03.710: E/AndroidRuntime(11294): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
05-21 15:30:03.710: E/AndroidRuntime(11294): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
05-21 15:30:03.710: E/AndroidRuntime(11294): ... 11 more
Check your Manifest file, if the activity is to be declared.
for Ex:
<application>
<activity android:name=".MyActivity" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Look through all the files in your new project and make sure they aren't referencing classes from the old project.
I think I found the solution, i should have checked that, the package name of the new project is included in the manifest file as for an example
"package="com.androidbook.MPTest" ..
my mistake is the i used the package name of the old project as a package name of the new project.

Android Tab Layout 2.1

Hi all I have looked at the tutorial for creating tab layout on android on here:
link
which didn't work so I looked on here to find that there where errors with it. So I applied these and still I'm not getting anywhere with it.
The app loads on 2.1 emulator on eclipse and also on my phone but the application force closes each time which leads me to think that its a manifest problem.
Here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Android.fitnessap"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".TabLayout"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HomeActivity"/>
<activity android:name=".HistoryActivity"/>
<activity android:name=".SettingsActivity"/>
</application>
<uses-sdk android:minSdkVersion="7" />
</manifest>
I've been stuck on this for hours now.
Thanks.
edit logcat:
01-19 18:37:09.316: ERROR/AndroidRuntime(126): ERROR: thread attach failed
01-19 18:37:10.945: ERROR/MediaPlayerService(31): Couldn't open fd for content://settings/system/notification_sound
01-19 18:37:10.955: ERROR/MediaPlayer(52): Unable to to create media player
01-19 18:37:15.345: ERROR/AndroidRuntime(170): ERROR: thread attach failed
01-19 18:37:17.215: ERROR/AndroidRuntime(197): Uncaught handler: thread main exiting due to uncaught exception
01-19 18:37:17.315: ERROR/AndroidRuntime(197): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.Android.fitnessap/com.Android.fitnessap.TabLayout}: java.lang.ClassNotFoundException: com.Android.fitnessap.TabLayout in loader dalvik.system.PathClassLoader#43b868e0
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.os.Handler.dispatchMessage(Handler.java:99)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.os.Looper.loop(Looper.java:123)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread.main(ActivityThread.java:4363)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at java.lang.reflect.Method.invokeNative(Native Method)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at java.lang.reflect.Method.invoke(Method.java:521)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at dalvik.system.NativeStart.main(Native Method)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): Caused by: java.lang.ClassNotFoundException: com.Android.fitnessap.TabLayout in loader dalvik.system.PathClassLoader#43b868e0
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
01-19 18:37:17.315: ERROR/AndroidRuntime(197): ... 11 more
01-19 18:37:17.375: ERROR/dalvikvm(197): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
for a template on tabview that will work out of the box. Your manifest seems ok (but I'm not that good at android yet), so I would suggest using logcat to figure out what's up. In Eclipse, Window > Show View > Other.. and Under Android select logcat. Now run your app again and watch the ouptut of logcat for errors. It is a very good way to debug your app, just look for red exceptions and follow the ones related to your source code.

Categories

Resources