Please advice what the problem is with my code...
I am constantly getting this exception any suggestion would be really appreciated.
STACK_TRACE=java.lang.RuntimeException: Unable to start receiver com.platinumapps.platinumtasks.AlarmReceiver: java.lang.NullPointerException
at android.app.ActivityThread.handleReceiver(ActivityThread.java:1975)
at android.app.ActivityThread.access$1400(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1074)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4123)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.platinumapps.platinumtasks.AlarmReceiver.onReceive(AlarmReceiver.java:109)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:1968)
... 10 more
java.lang.NullPointerException
at com.platinumapps.platinumtasks.AlarmReceiver.onReceive(AlarmReceiver.java:109)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:1968)
at android.app.ActivityThread.access$1400(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1074)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4123)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
at dalvik.system.NativeStart.main(Native Method)
Its a nullpointer exception.
Means that something you are calling isn't initiated correctly, Or that you dont have access to that part(ei. havn't decalred activities in AndroidManifest. Or havn't included the rights jars etc.)
If you want better help, post the code you are working with.
Related
I am wondering if this is some bug in Android Studio or I am simply lack od knowladge but straight to the point.
I am writing simple client-server via bluetooth app on android. At some point I encoured following problem:
07-11 18:59:20.553 10364-10364/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not find a method parujUrzadzenia(View) in the activity class com.example.pc.klient_serwerbluetooth.Klient for onClick handler on view class android.widget.Button with id 'button6'
at android.view.View$1.onClick(View.java:3775)
at android.view.View.performClick(View.java:4421)
at android.view.View$PerformClick.run(View.java:18190)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:175)
at android.app.ActivityThread.main(ActivityThread.java:5279)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoSuchMethodException: parujUrzadzenia [class android.view.View]
at java.lang.Class.getConstructorOrMethod(Class.java:460)
at java.lang.Class.getMethod(Class.java:915)
at android.view.View$1.onClick(View.java:3768)
at android.view.View.performClick(View.java:4421)
at android.view.View$PerformClick.run(View.java:18190)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:175)
at android.app.ActivityThread.main(ActivityThread.java:5279)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
07-11 19:34:00.498 449-522/? E/ActivityManager﹕ The package com.example.pc.klient_serwerbluetooth is not found. Failure starting process com.example.pc.klient_serwerbluetooth
For what I understand Android Studio can't find method parujUrzadzenia(View) that is marked in button6's properties as onClick method...the funny thing is i deleted this button in my way of solving this problem.
I can't post picture of my project due to low reputation but like I said. I've deleted the reference to method from .xml and method from .java file and got an error saying that there is no required onClick method. So I deleted this whole button and still got this error.
Any advices will be greatly appreciated.
my application crashed when I start it again after closing it for quite some time. Below you can see the log that shows the error:
java.lang.RuntimeException: Failed to initialize display event receiver. status=-2147483648
at android.view.DisplayEventReceiver.nativeInit(Native Method)
at android.view.DisplayEventReceiver.<init>(DisplayEventReceiver.java:61)
at android.view.Choreographer$FrameDisplayEventReceiver.<init>(Choreographer.java:725)
at android.view.Choreographer.<init>(Choreographer.java:169)
at android.view.Choreographer.<init>(Choreographer.java:69)
at android.view.Choreographer$1.initialValue(Choreographer.java:95)
at android.view.Choreographer$1.initialValue(Choreographer.java:88)
at java.lang.ThreadLocal$Values.getAfterMiss(ThreadLocal.java:430)
at java.lang.ThreadLocal.get(ThreadLocal.java:65)
at android.view.Choreographer.getInstance(Choreographer.java:194)
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:487)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:235)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2892)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2304)
at android.app.ActivityThread.access$700(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5306)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
I'm looking for the solution or at least someone with similar problem but surprisingly there is none.
Someone can help me?
Thank you!
Please help to understand strange application behaviour.
In almost all devices in production everything is OK, I'm using ACRA to collect crash reports. But here is what I've got from Alpha GTR device:
ComponentInfo{com.xxxxxxxxxxx /com.xxxxxxxxxxx.xxxxActivity}: java.lang.ClassNotFoundException: com.xxxxxxxxxxx.xxxxActivity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2108)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2211)
at android.app.ActivityThread.access$600(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1300)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:4987)
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:821)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.xxxxxxxxxxx.xxxxActivity
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:1053)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2099)
... 11 more
java.lang.ClassNotFoundException: com.xxxxxxxxxxx.xxxxActivity
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:1053)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2099)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2211)
at android.app.ActivityThread.access$600(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1300)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:4987)
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:821)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
at dalvik.system.NativeStart.main(Native Method)
So application failed to start with strange exception. I've already checked SO questions about it, and just adding libraries as Unable to instantiate activity... Caused by ClassNotFoundException doesn't help here.
Could it be some device-specific exception? My app uses Camera, Google Maps and GPS.
Maybe you have to check if GPS or Camera are supported by the device first?
LocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
I have no Idea why I get this error :/
Exception class java.lang.NullPointerException
Source method Jax$7.onClick()
java.lang.NullPointerException
at com.reg.lolsoundboard.Jax$7.onClick(Jax.java:83)
at android.view.View.performClick(View.java:2485)
at android.view.View$PerformClick.run(View.java:9089)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3806)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Obviously you are dereferencing a variable in line 83 of the file Jax.java where the variable is null.
java.lang.NullPointerException
at com.reg.lolsoundboard.Jax$7.onClick(Jax.java:83)
If show the relevant code, people may be able to help you.
By default Bluetooth is not enabled in Android. But when I go to Setting > Wireless & network and I click on Bluetooth Settings I get the following error:
04-04 11:42:22.492:
WARN/dalvikvm(747): threadid=1: thread
exiting with uncaught exception
(group=0x40014760) FATAL EXCEPTION:
main android.view.InflateException:
Binary XML file line #29: Error
inflating class
java.lang.reflect.Constructor
at android.preference.GenericInflater.createItem(GenericInflater.java:397)
at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:430)
at android.preference.GenericInflater.rInflate(GenericInflater.java:481)
at android.preference.GenericInflater.inflate(GenericInflater.java:326)
at android.preference.GenericInflater.inflate(GenericInflater.java:263)
at android.preference.
PreferenceManager.inflateFromResource(PreferenceManager.java:269)
at android.preference.PreferenceFragment.addPreferencesFromResource(PreferenceFragment.java:271)
at com.android.settings.bluetooth.BluetoothSettings.addPreferencesForActivity(BluetoothSettings.java:53)
at com.android.settings.bluetooth.DeviceListPreferenceFragment.onActivityCreated(DeviceListPreferenceFragment.java:93)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:749)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:921)
at android.app.BackStackRecord.run(BackStackRecord.java:578)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1221)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:375)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:126)
at android.app.ActivityThread.main(ActivityThread.java:3997)
at java.lang.reflect.Method.invokeNative(Native
Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
at dalvik.system.NativeStart.main(Native
Method) Caused by:
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native
Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.preference.GenericInflater.createItem(GenericInflater.java:383)
... 22 more Caused by: java.lang.NullPointerException
at com.android.settings.bluetooth.BluetoothNamePreference.setSummaryToName(BluetoothNamePreference.java:101)
at com.android.settings.bluetooth.BluetoothNamePreference.(BluetoothNamePreference.java:66)
... 25 more
What I'm missing?
Thanks.
You cant setup bluetooth on ANdroid AVD. Please check this link for emulator limitations:
http://developer.android.com/guide/developing/devices/emulator.html