07-10 08:32:43.863: E/AndroidRuntime(718): FATAL EXCEPTION: main
07-10 08:32:43.863: E/AndroidRuntime(718): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.burp/com.example.burp.MainActivity}: java.lang.ClassNotFoundException: com.example.burp.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.burp-2.apk]
07-10 08:32:43.863: E/AndroidRuntime(718): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
07-10 08:32:43.863: E/AndroidRuntime(718): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-10 08:32:43.863: E/AndroidRuntime(718): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-10 08:32:43.863: E/AndroidRuntime(718): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-10 08:32:43.863: E/AndroidRuntime(718): at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 08:32:43.863: E/AndroidRuntime(718): at android.os.Looper.loop(Looper.java:123)
07-10 08:32:43.863: E/AndroidRuntime(718): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-10 08:32:43.863: E/AndroidRuntime(718): at java.lang.reflect.Method.invokeNative(Native Method)
07-10 08:32:43.863: E/AndroidRuntime(718): at java.lang.reflect.Method.invoke(Method.java:507)
07-10 08:32:43.863: E/AndroidRuntime(718): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-10 08:32:43.863: E/AndroidRuntime(718): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-10 08:32:43.863: E/AndroidRuntime(718): at dalvik.system.NativeStart.main(Native Method)
07-10 08:32:43.863: E/AndroidRuntime(718): Caused by: java.lang.ClassNotFoundException: com.example.burp.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.burp-2.apk]
07-10 08:32:43.863: E/AndroidRuntime(718): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
07-10 08:32:43.863: E/AndroidRuntime(718): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
07-10 08:32:43.863: E/AndroidRuntime(718): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
07-10 08:32:43.863: E/AndroidRuntime(718): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
07-10 08:32:43.863: E/AndroidRuntime(718): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
07-10 08:32:43.863: E/AndroidRuntime(718): ... 11 more
how do I solve this problem? I am using Windows 7
Include your Activity in Manifest file. Like this
<activity
android:name=".application's starting activity" <!-- (.)dot means current dir, if your activity is in another package then give full package name ex: com.xxx.Activity -->
android:label="LABEL FOR ACTIVITY "
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Related
We tried integrating HelpStack by following steps given on GitHub, but we kept getting the following errors:
04-03 13:54:22.054 4638-4638/com.playerline.android E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.playerline.android/com.tenmiles.helpstack.activities.HomeActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
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.NullPointerException
at com.tenmiles.helpstack.activities.HSActivityParent.onCreate(HSActivityParent.java:48)
at com.tenmiles.helpstack.activities.HomeActivity.onCreate(HomeActivity.java:46)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
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)
I'm guessing it has something to do with the App Theme, which in our case is is Theme.AppCompat.NoActionBar.
I have used ZBAR library to scan bar code in my Application.
And I got this error log while opening camera on Samsung Galaxy S3 :
java.lang.RuntimeException: startPreview failed
at android.hardware.Camera.startPreview(Native Method)
at com.SGID.MainApp.ScanningFragment.engageCamera(ScanningFragment.java:184)
at com.SGID.MainApp.ScanningFragment.access$10(ScanningFragment.java:154)
at com.SGID.MainApp.ScanningFragment$4.run(ScanningFragment.java:111)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
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:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to start activity ComponentInfo
{com.SGID.MainApp/com.SGID.MainApp.AllTabsActivity}
: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
at android.app.ActivityThread.access$600(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
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:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.SGID.MainApp.ParametersFragment.onCreateView(ParametersFragment.java:78)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1478)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1086)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1877)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:552)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1167)
at android.app.Activity.performStart(Activity.java:5216)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2073)
... 11 more
EDIT :
Getting error at this line :
CameraPreview mPreview = new CameraPreview(getActivity(), mCamera, previewCb,
autoFocusCB);
Can Anyone help me to resolve this error??
Thanks in advance..
Hi I have an activity that shows a dialog form an standard layout.
android:theme="#android:style/Theme.Holo.Light.Dialog"/>
I was trying to add a simple spinner to the actionbar but I am having issues and error in the line getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST).
When I change my theme to a common activity it works perfect.
This are the errors showed by the logcat:
3114-3114/org.PeteProto E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.PeteProto/org.PeteProto.Detail}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
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:5039)
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:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at org.PeteProto.Detail.onCreate(Detail.java:30)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
... 11 more
My App is run correctly in simulator but when i try to run in device .i will not give me error
please try to solve this problem
07-10 02:56:34.022: D/AndroidRuntime(28052): Shutting down VM
07-10 02:56:34.022: W/dalvikvm(28052): threadid=1: thread exiting with uncaught exception (group=0x40a551f8)
07-10 02:56:34.022: E/AndroidRuntime(28052): FATAL EXCEPTION: main
07-10 02:56:34.022: E/AndroidRuntime(28052): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mobileTimerClock/com.android.mobileTimerClock.TimeClockDashBoard}: java.lang.NullPointerException: println needs a message
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.app.ActivityThread.access$600(ActivityThread.java:123)
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.os.Looper.loop(Looper.java:137)
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.app.ActivityThread.main(ActivityThread.java:4424)
07-10 02:56:34.022: E/AndroidRuntime(28052): at java.lang.reflect.Method.invokeNative(Native Method)
07-10 02:56:34.022: E/AndroidRuntime(28052): at java.lang.reflect.Method.invoke(Method.java:511)
07-10 02:56:34.022: E/AndroidRuntime(28052): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-10 02:56:34.022: E/AndroidRuntime(28052): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-10 02:56:34.022: E/AndroidRuntime(28052): at dalvik.system.NativeStart.main(Native Method)
07-10 02:56:34.022: E/AndroidRuntime(28052): Caused by: java.lang.NullPointerException: println needs a message
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.util.Log.println_native(Native Method)
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.util.Log.i(Log.java:159)
07-10 02:56:34.022: E/AndroidRuntime(28052): at com.android.mobileTimerClock.TimeClockDashBoard.onCreate(TimeClockDashBoard.java:394)
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.app.Activity.performCreate(Activity.java:4465)
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
07-10 02:56:34.022: E/AndroidRuntime(28052): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
07-10 02:56:34.022: E/AndroidRuntime(28052): ... 11 more
07-10 02:56:34.022: W/ActivityManager(177): Force finishing activity com.android.mobileTimerClock/.TimeClockDashBoard
07-10 02:56:34.030: W/ActivityManager(177): Force finishing activity com.android.mobileTimerClock/.DashBoard
07-10 02:56:34.530: W/ActivityManager(177): Activity pause timeout for ActivityRecord{41d0a690 com.android.mobileTimerClock/.TimeClockDashBoard}
My guess would be that you're passing null as the second parameter to a Log.i(String, String) call (or similar Log.*() method):
java.lang.NullPointerException: println needs a message
I have searched the internet for days and have found dozens of solutions none of which work. So I thought I'd post my situation:
I have installed eclipse and the 2.3.3 android SDK onto my laptop, put the code in for hello world (or hello android) and clicked run. The emulator starts but when the activity is run I get the message "SORRY! the application Hello Android (process com.example helloandroid) has stopped unexpectedly. Please try again"
package com.example.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
and this is log cat
02-03 12:54:59.470: D/AndroidRuntime(356): Shutting down VM
02-03 12:54:59.470: W/dalvikvm(356): threadid=1: thread exiting with uncaught exception (group=0x40015560)
02-03 12:54:59.521: E/AndroidRuntime(356): FATAL EXCEPTION: main
02-03 12:54:59.521: E/AndroidRuntime(356): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.helloandroid/com.example.helloandroid.HelloAndroidActivity}: java.lang.ClassNotFoundException: com.example.helloandroid.HelloAndroidActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.helloandroid-1.apk]
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.os.Handler.dispatchMessage(Handler.java:99)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.os.Looper.loop(Looper.java:123)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread.main(ActivityThread.java:3683)
02-03 12:54:59.521: E/AndroidRuntime(356): at java.lang.reflect.Method.invokeNative(Native Method)
02-03 12:54:59.521: E/AndroidRuntime(356): at java.lang.reflect.Method.invoke(Method.java:507)
02-03 12:54:59.521: E/AndroidRuntime(356): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-03 12:54:59.521: E/AndroidRuntime(356): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-03 12:54:59.521: E/AndroidRuntime(356): at dalvik.system.NativeStart.main(Native Method)
02-03 12:54:59.521: E/AndroidRuntime(356): Caused by: java.lang.ClassNotFoundException: com.example.helloandroid.HelloAndroidActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.helloandroid-1.apk]
02-03 12:54:59.521: E/AndroidRuntime(356): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
02-03 12:54:59.521: E/AndroidRuntime(356): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
02-03 12:54:59.521: E/AndroidRuntime(356): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
02-03 12:54:59.521: E/AndroidRuntime(356): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
02-03 12:54:59.521: E/AndroidRuntime(356): ... 11 more
02-03 12:59:59.691: I/Process(356): Sending signal. PID: 356 SIG: 9
02-03 13:00:33.371: D/AndroidRuntime(366): Shutting down VM
02-03 13:00:33.371: W/dalvikvm(366): threadid=1: thread exiting with uncaught exception (group=0x40015560)
02-03 13:00:33.431: E/AndroidRuntime(366): FATAL EXCEPTION: main
02-03 13:00:33.431: E/AndroidRuntime(366): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.helloandroid/com.example.helloandroid.HelloAndroidActivity}: java.lang.ClassNotFoundException: com.example.helloandroid.HelloAndroidActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.helloandroid-1.apk]
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.os.Handler.dispatchMessage(Handler.java:99)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.os.Looper.loop(Looper.java:123)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread.main(ActivityThread.java:3683)
02-03 13:00:33.431: E/AndroidRuntime(366): at java.lang.reflect.Method.invokeNative(Native Method)
02-03 13:00:33.431: E/AndroidRuntime(366): at java.lang.reflect.Method.invoke(Method.java:507)
02-03 13:00:33.431: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-03 13:00:33.431: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-03 13:00:33.431: E/AndroidRuntime(366): at dalvik.system.NativeStart.main(Native Method)
02-03 13:00:33.431: E/AndroidRuntime(366): Caused by: java.lang.ClassNotFoundException: com.example.helloandroid.HelloAndroidActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.helloandroid-1.apk]
02-03 13:00:33.431: E/AndroidRuntime(366): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
02-03 13:00:33.431: E/AndroidRuntime(366): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
02-03 13:00:33.431: E/AndroidRuntime(366): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
02-03 13:00:33.431: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
02-03 13:00:33.431: E/AndroidRuntime(366): ... 11 more
02-03 13:05:33.600: I/Process(366): Sending signal. PID: 366 SIG: 9
It seems to be something wrong with the way your emulator is set up. Did you follow this tutorial especially the "Setting up the AVD" part?
I would start the install of the emulator all over again. Also you could send him a copy of your program and if he can successfully run your project in the emulator then you know you just need to get your emulator set up correctly.
try moving your setContentView() method above your textview initialization