AndroidActivity extends GameBaseActivity crashes - android

I am having a class
public class GameActivity extends Activity implements
GLSurfaceView.Renderer, OnTouchListener{
The code does not have any problems, all needed methods are implemented. When I start the Activity it crashes with the following message:
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{[left out].GameActivity}:
java.lang.ClassNotFoundException: Didn't find class "...GameActivity"
on path [...]
I want to integreate the Google Game Service and Achievements in my game. Therefore I added the libary project and the GameBaseUtils as projects and also checkt that they should be exported inside my generated apk file. It compiles, the .jar for the google play services is also uploaded and will b e found. All includes are working. But when I start the game, it crashed immediately with the error message above.
I followed the tutorials on developers.android.com https://developers.google.com/games/services/android/init
Can someone tell me what I am doing wrong? Here is my Manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package=""
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<!--
Tell the market, that the the app requires at least OpenGLES 2.0
This is not really the truth but it will decrease the rate of error
-->
<uses-feature android:glEsVersion="0x00020000"
android:required="true" />
<!-- Maybe not neccessary -->
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/> -->
<application
android:allowBackup="true"
android:icon="#drawable/launcher_icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="sensorLandscape" >
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="13465798" />
<activity
android:name="GameActivity"
android:screenOrientation="sensorLandscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- For the implementation of Adds in this App -->
</application>
</manifest>
Edit: Locat output
07-21 01:13:47.730: W/dalvikvm(22578): Unable to resolve superclass of
LGameActivity; (1182) 07-21 01:13:47.730:
W/dalvikvm(22578): Link of class
'L/GameActivity;' failed 07-21 01:13:47.730:
D/AndroidRuntime(22578): Shutting down VM 07-21 01:13:47.730:
W/dalvikvm(22578): threadid=1: thread exiting with uncaught exception
(group=0x4159f930) 07-21 01:13:47.746: E/AndroidRuntime(22578): FATAL
EXCEPTION: main 07-21 01:13:47.746: E/AndroidRuntime(22578):
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{GameActivity}:
java.lang.ClassNotFoundException: Didn't find class
"GameActivity" on path:
.apk 07-21 01:13:47.746:
E/AndroidRuntime(22578): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
07-21 01:13:47.746: E/AndroidRuntime(22578): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-21 01:13:47.746: E/AndroidRuntime(22578): at
android.app.ActivityThread.access$600(ActivityThread.java:141) 07-21
01:13:47.746: E/AndroidRuntime(22578): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-21 01:13:47.746: E/AndroidRuntime(22578): at
android.os.Handler.dispatchMessage(Handler.java:99) 07-21
01:13:47.746: E/AndroidRuntime(22578): at
android.os.Looper.loop(Looper.java:137) 07-21 01:13:47.746:
E/AndroidRuntime(22578): at
android.app.ActivityThread.main(ActivityThread.java:5041) 07-21
01:13:47.746: E/AndroidRuntime(22578): at
java.lang.reflect.Method.invokeNative(Native Method) 07-21
01:13:47.746: E/AndroidRuntime(22578): at
java.lang.reflect.Method.invoke(Method.java:511) 07-21 01:13:47.746:
E/AndroidRuntime(22578): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-21 01:13:47.746: E/AndroidRuntime(22578): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 07-21
01:13:47.746: E/AndroidRuntime(22578): at
dalvik.system.NativeStart.main(Native Method) 07-21 01:13:47.746:
E/AndroidRuntime(22578): Caused by: java.lang.ClassNotFoundException:
Didn't find class "GameActivity" on path:
-1.apk 07-21 01:13:47.746:
E/AndroidRuntime(22578): at
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
07-21 01:13:47.746: E/AndroidRuntime(22578): at
java.lang.ClassLoader.loadClass(ClassLoader.java:501) 07-21
01:13:47.746: E/AndroidRuntime(22578): at
java.lang.ClassLoader.loadClass(ClassLoader.java:461) 07-21
01:13:47.746: E/AndroidRuntime(22578): at
android.app.Instrumentation.newActivity(Instrumentation.java:1054)
07-21 01:13:47.746: E/AndroidRuntime(22578): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
07-21 01:13:47.746: E/AndroidRuntime(22578): ... 11 more

I've found the error:
I had to mark both projects I am using for the app (GameBaseUtils and google-play-services_lib) as a libary project and add them to android libaries I want to use. The rest is handled by android on its own.

Related

java.lang.ClassNotFoundException: Didn't find class "com.millennialmedia.android.VideoPlayer"

I recently moved to MoPub and it all appears to be working well except for I have started getting this exception saying that com.millennialmedia.android.VideoPlayer can not be found. I looked and it isn't on the Millennial jar (I just got the latest from their site). Also my AndroidManifest mentions that class and Android Studio also says it can't be found.
This is what I have there:
<activity android:name="com.millennialmedia.android.MMActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboardHidden|orientation|keyboard" />
<activity android:name="com.millennialmedia.android.VideoPlayer" android:configChanges="keyboardHidden|orientation|keyboard" />
On Android Studio the VideoPlayer part is red.
This is the exception I got:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{mypackage/com.millennialmedia.android.VideoPlayer}: java.lang.ClassNotFoundException: Didn't find class "com.millennialmedia.android.VideoPlayer" on path: /data/app/mypackage-1.apk
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.millennialmedia.android.VideoPlayer" on path: /data/app/mypackage-1.apk
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(NativeStart.java)
Looking at the latest Millennial Media documentation, it looks like
com.millennialmedia.android.VideoPlayer
isn't included. This may be an update that needs to be made.
Alice

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo - Android

I'm really confused. After I tried to change my packages from android.app to android.support.v4, my app crashed and threw the following exceptions:
08-31 20:45:18.652: E/AndroidRuntime(1429): FATAL EXCEPTION: main
08-31 20:45:18.652: E/AndroidRuntime(1429): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.k2evil.porschejournal/com.k2evil.porschejournal.FirstScreen}: java.lang.ClassNotFoundException: Didn't find class "com.k2evil.porschejournal.FirstScreen" on path: DexPathList[[zip file "/data/app/com.k2evil.porschejournal-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.k2evil.porschejournal-2, /system/lib]]
08-31 20:45:18.652: E/AndroidRuntime(1429): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
08-31 20:45:18.652: E/AndroidRuntime(1429): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
08-31 20:45:18.652: E/AndroidRuntime(1429): at android.app.ActivityThread.access$600(ActivityThread.java:141)
08-31 20:45:18.652: E/AndroidRuntime(1429): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
08-31 20:45:18.652: E/AndroidRuntime(1429): at android.os.Handler.dispatchMessage(Handler.java:99)
08-31 20:45:18.652: E/AndroidRuntime(1429): at android.os.Looper.loop(Looper.java:137)
08-31 20:45:18.652: E/AndroidRuntime(1429): at android.app.ActivityThread.main(ActivityThread.java:5103)
08-31 20:45:18.652: E/AndroidRuntime(1429): at java.lang.reflect.Method.invokeNative(Native Method)
08-31 20:45:18.652: E/AndroidRuntime(1429): at java.lang.reflect.Method.invoke(Method.java:525)
08-31 20:45:18.652: E/AndroidRuntime(1429): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
08-31 20:45:18.652: E/AndroidRuntime(1429): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-31 20:45:18.652: E/AndroidRuntime(1429): at dalvik.system.NativeStart.main(Native Method)
08-31 20:45:18.652: E/AndroidRuntime(1429): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.k2evil.porschejournal.FirstScreen" on path: DexPathList[[zip file "/data/app/com.k2evil.porschejournal-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.k2evil.porschejournal-2, /system/lib]]
08-31 20:45:18.652: E/AndroidRuntime(1429): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
08-31 20:45:18.652: E/AndroidRuntime(1429): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-31 20:45:18.652: E/AndroidRuntime(1429): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-31 20:45:18.652: E/AndroidRuntime(1429): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
08-31 20:45:18.652: E/AndroidRuntime(1429): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
08-31 20:45:18.652: E/AndroidRuntime(1429): ... 11 more
And this is my android manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.k2evil.porschejournal"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity android:name="com.k2evil.porschejournal.FirstScreen" android:theme="#style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
I tried clean project, and to rename app package name. But it doesn't work.
It was just a eclipse bug... close and reopen eclipse :)

Android Flow example crashes with ClassNotFoundException

I'm Naive in Android development. I tried to use flow/mortar for development and stuck with an exception.
Here's what I did. In Eclipse, I chose New (Crtl N) -> Android Project from existing code and imported the flow sample downloaded from the square flow website https://github.com/square/flow/.
Eclipse marked errors in all the files as the package name was not matching the file's location. So to fix the package mismatch issue, I moved the files from : \flow-master\flow-sample\src\main\java\com\example\flow to : \flow-master\flow-sample\src\com\example\flow.
After this, I got some more errors saying 'Unresolved to a Type' which I fixed by importing proper jar files. Now all the errors are cleared and I tried to install and launch the app.
The app crashes as soon as we launch with the Logcat error below:
E/AndroidRuntime(5438): FATAL EXCEPTION: main
E/AndroidRuntime(5438): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.flow/com.example.flow.MainActivity}: java.lang.ClassNotFoundException: com.example.flow.MainActivity
E/AndroidRuntime(5438): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1888)
E/AndroidRuntime(5438): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1989)
E/AndroidRuntime(5438): at android.app.ActivityThread.access$600(ActivityThread.java:126)
E/AndroidRuntime(5438): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1155)
E/AndroidRuntime(5438): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(5438): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(5438): at android.app.ActivityThread.main(ActivityThread.java:4482)
E/AndroidRuntime(5438): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(5438): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(5438): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
E/AndroidRuntime(5438): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
E/AndroidRuntime(5438): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(5438): Caused by: java.lang.ClassNotFoundException: com.example.flow.MainActivity
E/AndroidRuntime(5438): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
E/AndroidRuntime(5438): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/AndroidRuntime(5438): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/AndroidRuntime(5438): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
E/AndroidRuntime(5438): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1879)
E/AndroidRuntime(5438): ... 11 more
The error says that the file MainActivity is not found even when the file is available in the path com.example.flow.. Can someone please help me understand what the issue is?
Android Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flow"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="18"/>
<application
android:icon="#drawable/flow_icon">
<activity
android:label="Flow"
android:name="com.example.flow.MainActivity"
android:theme="#android:style/Theme.Holo.Light.DarkActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>

Android Unexpected Shutdown

I've tried to get some data from the nasa rss ( I'm following Android HeadFirst book ) using the Simple Framework.
The problem that I face is that the application closes down automatically when the main activity is loaded.
Here is the code :
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try {
print();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
and here is the print method:
public void print() throws Exception
{
Rss rss = new Rss();
Serializer serializer = new Persister();
File source = new File("http://www.nasa.gov/rss/dyn/image_of_the_day.rss");
serializer.read(rss, source);
TextView text = (TextView) this.findViewById(R.id.imageTitle);
text.setText(rss.channel.title);
}
logcat:
> 12-11 18:27:03.459: D/AndroidRuntime(20621): Shutting down VM
12-11 18:27:03.459: W/dalvikvm(20621): threadid=1: thread exiting with uncaught exception (group=0x400205a0)
12-11 18:27:03.469: E/AndroidRuntime(20621): FATAL EXCEPTION: main
12-11 18:27:03.469: E/AndroidRuntime(20621): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.nasadailyimage/com.example.nasadailyimage.MainActivity}: java.lang.ClassNotFoundException: com.example.nasadailyimage.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.nasadailyimage-1.apk]
12-11 18:27:03.469: E/AndroidRuntime(20621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1743)
12-11 18:27:03.469: E/AndroidRuntime(20621): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1851)
12-11 18:27:03.469: E/AndroidRuntime(20621): at android.app.ActivityThread.access$1500(ActivityThread.java:132)
12-11 18:27:03.469: E/AndroidRuntime(20621): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
12-11 18:27:03.469: E/AndroidRuntime(20621): at android.os.Handler.dispatchMessage(Handler.java:99)
12-11 18:27:03.469: E/AndroidRuntime(20621): at android.os.Looper.loop(Looper.java:150)
12-11 18:27:03.469: E/AndroidRuntime(20621): at android.app.ActivityThread.main(ActivityThread.java:4277)
12-11 18:27:03.469: E/AndroidRuntime(20621): at java.lang.reflect.Method.invokeNative(Native Method)
12-11 18:27:03.469: E/AndroidRuntime(20621): at java.lang.reflect.Method.invoke(Method.java:507)
12-11 18:27:03.469: E/AndroidRuntime(20621): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-11 18:27:03.469: E/AndroidRuntime(20621): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-11 18:27:03.469: E/AndroidRuntime(20621): at dalvik.system.NativeStart.main(Native Method)
12-11 18:27:03.469: E/AndroidRuntime(20621): Caused by: java.lang.ClassNotFoundException: com.example.nasadailyimage.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.nasadailyimage-1.apk]
12-11 18:27:03.469: E/AndroidRuntime(20621): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
12-11 18:27:03.469: E/AndroidRuntime(20621): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
12-11 18:27:03.469: E/AndroidRuntime(20621): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
12-11 18:27:03.469: E/AndroidRuntime(20621): at android.app.Instrumentation.newActivity(Instrumentation.java:1040)
12-11 18:27:03.469: E/AndroidRuntime(20621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1735)
12-11 18:27:03.469: E/AndroidRuntime(20621): ... 11 more
Here is the manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.nasadailyimage"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.nasadailyimage.MainActivity"
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>
</manifest>
I've create a brand new android project. And it works
However even if I remove all the libraries I added ( simple.org) and if I comment out everything that I've added in MainActivity.java is still makes the application close down
I have been able to observe that the line:
Serializer serialezer = new Persister();
causes the error. Is the framework simple used for android applications? Does it usually cause these kind of errors?
Update
I have also tried different versions of the jar.
None seem to work
Closing Eclipse does not help whatsoever
The program only runs when the Serializer line is commented out
The line
Serializer ser = new Persister();
is what causes the error. I don't have the smallest idea weather the simple Framework is causing this somehow.

Android - exception launching project on start after copying a lot of code over from another project

am getting this exception:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{business.premium/business.premium.Problemio}:
java.lang.ClassNotFoundException: business.premium.Problemio
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: business.premium.Problemio
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
... 11 more
java.lang.ClassNotFoundException: business.premium.Problemio
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
it says that class is not there, but it IS there. I tried to configure things in my project's build path, but not too sure what to tweak there.
And here is how I start my Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="business.premium"
android:versionCode="1"
android:versionName="1.0" >
<supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15"/>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/CustomTheme"
android:name="MyApplication"
android:debuggable="true">
<activity
android:name=".Problemio"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Any thoughts on how to solve this, or what to look into? Thanks!
Its because you specified the "android:name" attribute in the application node in the manifest file.
Do not use the android:name attribute!
It, misleadingly, does not have anything to do with the name of your app and is actually the name of an extra class to load before loading your application. That's why you are getting the ClassNotFoundException.
Remove it and it should work:
<application
android:icon="#drawable/icon"
android:label="#string/app_name"
android:description="#string/help_text" >
This answer is taken from: java.lang.ClassNotFoundException on working app

Categories

Resources