I was following the tutorial given at https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/
While trying to create the Android Project with Facebook login as given in section 6, I am stuck with the following error as shown in LogCat:
08-09 15:48:56.556: I/dalvikvm(378): Could not find method com.facebook.Session.getActiveSession, referenced from method com.example.myfirstandroidapplication.MainActivity.onActivityResult
08-09 15:48:56.576: W/dalvikvm(378): VFY: unable to resolve static method 27: Lcom/facebook/Session;.getActiveSession ()Lcom/facebook/Session;
08-09 15:48:56.576: D/dalvikvm(378): VFY: replacing opcode 0x71 at 0x0003
08-09 15:48:56.576: D/dalvikvm(378): VFY: dead code 0x0006-000a in Lcom/example/myfirstandroidapplication/MainActivity;.onActivityResult (IILandroid/content/Intent;)V
08-09 15:48:56.586: I/dalvikvm(378): Failed resolving Lcom/example/myfirstandroidapplication/MainActivity$1; interface 25 'Lcom/facebook/Session$StatusCallback;'
08-09 15:48:56.586: W/dalvikvm(378): Link of class 'Lcom/example/myfirstandroidapplication/MainActivity$1;' failed
08-09 15:48:56.586: E/dalvikvm(378): Could not find class 'com.example.myfirstandroidapplication.MainActivity$1', referenced from method com.example.myfirstandroidapplication.MainActivity.onCreate
08-09 15:48:56.586: W/dalvikvm(378): VFY: unable to resolve new-instance 10 (Lcom/example/myfirstandroidapplication/MainActivity$1;) in Lcom/example/myfirstandroidapplication/MainActivity;
08-09 15:48:56.586: D/dalvikvm(378): VFY: replacing opcode 0x22 at 0x0009
08-09 15:48:56.636: D/dalvikvm(378): VFY: dead code 0x000b-0010 in Lcom/example/myfirstandroidapplication/MainActivity;.onCreate (Landroid/os/Bundle;)V
08-09 15:48:56.717: D/AndroidRuntime(378): Shutting down VM
08-09 15:48:56.717: W/dalvikvm(378): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-09 15:48:56.736: E/AndroidRuntime(378): FATAL EXCEPTION: main
08-09 15:48:56.736: E/AndroidRuntime(378): java.lang.NoClassDefFoundError: com.example.myfirstandroidapplication.MainActivity$1
08-09 15:48:56.736: E/AndroidRuntime(378): at com.example.myfirstandroidapplication.MainActivity.onCreate(MainActivity.java:28)
08-09 15:48:56.736: E/AndroidRuntime(378): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-09 15:48:56.736: E/AndroidRuntime(378): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
08-09 15:48:56.736: E/AndroidRuntime(378): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-09 15:48:56.736: E/AndroidRuntime(378): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-09 15:48:56.736: E/AndroidRuntime(378): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-09 15:48:56.736: E/AndroidRuntime(378): at android.os.Handler.dispatchMessage(Handler.java:99)
08-09 15:48:56.736: E/AndroidRuntime(378): at android.os.Looper.loop(Looper.java:123)
08-09 15:48:56.736: E/AndroidRuntime(378): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-09 15:48:56.736: E/AndroidRuntime(378): at java.lang.reflect.Method.invokeNative(Native Method)
08-09 15:48:56.736: E/AndroidRuntime(378): at java.lang.reflect.Method.invoke(Method.java:521)
08-09 15:48:56.736: E/AndroidRuntime(378): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-09 15:48:56.736: E/AndroidRuntime(378): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-09 15:48:56.736: E/AndroidRuntime(378): at dalvik.system.NativeStart.main(Native Method)
08-09 16:22:11.456: I/dalvikvm(402): Could not find method com.facebook.Session.getActiveSession, referenced from method com.example.myfirstandroidapplication.MainActivity.onActivityResult
08-09 16:22:11.456: W/dalvikvm(402): VFY: unable to resolve static method 27: Lcom/facebook/Session;.getActiveSession ()Lcom/facebook/Session;
08-09 16:22:11.466: D/dalvikvm(402): VFY: replacing opcode 0x71 at 0x0003
08-09 16:22:11.466: D/dalvikvm(402): VFY: dead code 0x0006-000a in Lcom/example/myfirstandroidapplication/MainActivity;.onActivityResult (IILandroid/content/Intent;)V
08-09 16:22:11.476: I/dalvikvm(402): Failed resolving Lcom/example/myfirstandroidapplication/MainActivity$1; interface 25 'Lcom/facebook/Session$StatusCallback;'
08-09 16:22:11.476: W/dalvikvm(402): Link of class 'Lcom/example/myfirstandroidapplication/MainActivity$1;' failed
08-09 16:22:11.507: E/dalvikvm(402): Could not find class 'com.example.myfirstandroidapplication.MainActivity$1', referenced from method com.example.myfirstandroidapplication.MainActivity.onCreate
08-09 16:22:11.507: W/dalvikvm(402): VFY: unable to resolve new-instance 10 (Lcom/example/myfirstandroidapplication/MainActivity$1;) in Lcom/example/myfirstandroidapplication/MainActivity;
08-09 16:22:11.507: D/dalvikvm(402): VFY: replacing opcode 0x22 at 0x0009
08-09 16:22:11.507: D/dalvikvm(402): VFY: dead code 0x000b-0010 in Lcom/example/myfirstandroidapplication/MainActivity;.onCreate (Landroid/os/Bundle;)V
08-09 16:22:11.696: D/AndroidRuntime(402): Shutting down VM
08-09 16:22:11.706: W/dalvikvm(402): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-09 16:22:11.716: E/AndroidRuntime(402): FATAL EXCEPTION: main
08-09 16:22:11.716: E/AndroidRuntime(402): java.lang.NoClassDefFoundError: com.example.myfirstandroidapplication.MainActivity$1
08-09 16:22:11.716: E/AndroidRuntime(402): at com.example.myfirstandroidapplication.MainActivity.onCreate(MainActivity.java:28)
08-09 16:22:11.716: E/AndroidRuntime(402): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-09 16:22:11.716: E/AndroidRuntime(402): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
08-09 16:22:11.716: E/AndroidRuntime(402): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-09 16:22:11.716: E/AndroidRuntime(402): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-09 16:22:11.716: E/AndroidRuntime(402): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-09 16:22:11.716: E/AndroidRuntime(402): at android.os.Handler.dispatchMessage(Handler.java:99)
08-09 16:22:11.716: E/AndroidRuntime(402): at android.os.Looper.loop(Looper.java:123)
08-09 16:22:11.716: E/AndroidRuntime(402): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-09 16:22:11.716: E/AndroidRuntime(402): at java.lang.reflect.Method.invokeNative(Native Method)
08-09 16:22:11.716: E/AndroidRuntime(402): at java.lang.reflect.Method.invoke(Method.java:521)
08-09 16:22:11.716: E/AndroidRuntime(402): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-09 16:22:11.716: E/AndroidRuntime(402): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-09 16:22:11.716: E/AndroidRuntime(402): at dalvik.system.NativeStart.main(Native Method)
I have also tried every possible search here and tried resolving library dependencies but still can't get out of this error.
I am also attaching a screen shot of facebook sdk reference error, if it can help you in suggesting me a solution.1
If there is solution to this problem in another thread then please direct me towards the link.
Related
I am using eclipse with libGdx framework... And Everything is set... But only when i am Run android through emulator after launching when i click on App icon it gives me a message "UNFORTUNATELY APP-NAME HAS STOPPED"... Please tell me why this is happening... Because same code works when i run as Desktop java Application through Eclipse... Please help me out... Thanks...
LOG CAT DETAILS :
08-09 19:30:45.729: W/dalvikvm(747): Unable to resolve superclass of Lcom/badlogic/drop/MainActivity; (20)
08-09 19:30:45.739: W/dalvikvm(747): Link of class 'Lcom/badlogic/drop/MainActivity;' failed
08-09 19:30:45.759: D/AndroidRuntime(747): Shutting down VM
08-09 19:30:45.759: W/dalvikvm(747): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
08-09 19:30:45.779: E/AndroidRuntime(747): FATAL EXCEPTION: main
08-09 19:30:45.779: E/AndroidRuntime(747): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.badlogic.drop/com.badlogic.drop.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.badlogic.drop.MainActivity" on path: /data/app/com.badlogic.drop-2.apk
08-09 19:30:45.779: E/AndroidRuntime(747): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
08-09 19:30:45.779: E/AndroidRuntime(747): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
08-09 19:30:45.779: E/AndroidRuntime(747): at android.app.ActivityThread.access$600(ActivityThread.java:141)
08-09 19:30:45.779: E/AndroidRuntime(747): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
08-09 19:30:45.779: E/AndroidRuntime(747): at android.os.Handler.dispatchMessage(Handler.java:99)
08-09 19:30:45.779: E/AndroidRuntime(747): at android.os.Looper.loop(Looper.java:137)
08-09 19:30:45.779: E/AndroidRuntime(747): at android.app.ActivityThread.main(ActivityThread.java:5041)
08-09 19:30:45.779: E/AndroidRuntime(747): at java.lang.reflect.Method.invokeNative(Native Method)
08-09 19:30:45.779: E/AndroidRuntime(747): at java.lang.reflect.Method.invoke(Method.java:511)
08-09 19:30:45.779: E/AndroidRuntime(747): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
08-09 19:30:45.779: E/AndroidRuntime(747): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
08-09 19:30:45.779: E/AndroidRuntime(747): at dalvik.system.NativeStart.main(Native Method)
08-09 19:30:45.779: E/AndroidRuntime(747): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.badlogic.drop.MainActivity" on path: /data/app/com.badlogic.drop-2.apk
08-09 19:30:45.779: E/AndroidRuntime(747): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
08-09 19:30:45.779: E/AndroidRuntime(747): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-09 19:30:45.779: E/AndroidRuntime(747): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-09 19:30:45.779: E/AndroidRuntime(747): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
08-09 19:30:45.779: E/AndroidRuntime(747): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
08-09 19:30:45.779: E/AndroidRuntime(747): ... 11 more
08-09 19:35:53.845: I/Process(747): Sending signal. PID: 747 SIG: 9
08-09 19:37:20.125: E/Trace(958): error opening trace file: No such file or directory (2)
08-09 19:37:20.225: W/dalvikvm(958): Unable to resolve superclass of Lcom/badlogic/drop/MainActivity; (20)
08-09 19:37:20.255: W/dalvikvm(958): Link of class 'Lcom/badlogic/drop/MainActivity;' failed
08-09 19:37:20.265: D/AndroidRuntime(958): Shutting down VM
08-09 19:37:20.265: W/dalvikvm(958): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
08-09 19:37:20.306: E/AndroidRuntime(958): FATAL EXCEPTION: main
08-09 19:37:20.306: E/AndroidRuntime(958): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.badlogic.drop/com.badlogic.drop.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.badlogic.drop.MainActivity" on path: /data/app/com.badlogic.drop-2.apk
08-09 19:37:20.306: E/AndroidRuntime(958): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
08-09 19:37:20.306: E/AndroidRuntime(958): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
08-09 19:37:20.306: E/AndroidRuntime(958): at android.app.ActivityThread.access$600(ActivityThread.java:141)
08-09 19:37:20.306: E/AndroidRuntime(958): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
08-09 19:37:20.306: E/AndroidRuntime(958): at android.os.Handler.dispatchMessage(Handler.java:99)
08-09 19:37:20.306: E/AndroidRuntime(958): at android.os.Looper.loop(Looper.java:137)
08-09 19:37:20.306: E/AndroidRuntime(958): at android.app.ActivityThread.main(ActivityThread.java:5041)
08-09 19:37:20.306: E/AndroidRuntime(958): at java.lang.reflect.Method.invokeNative(Native Method)
08-09 19:37:20.306: E/AndroidRuntime(958): at java.lang.reflect.Method.invoke(Method.java:511)
08-09 19:37:20.306: E/AndroidRuntime(958): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
08-09 19:37:20.306: E/AndroidRuntime(958): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
08-09 19:37:20.306: E/AndroidRuntime(958): at dalvik.system.NativeStart.main(Native Method)
08-09 19:37:20.306: E/AndroidRuntime(958): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.badlogic.drop.MainActivity" on path: /data/app/com.badlogic.drop-2.apk
08-09 19:37:20.306: E/AndroidRuntime(958): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
08-09 19:37:20.306: E/AndroidRuntime(958): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-09 19:37:20.306: E/AndroidRuntime(958): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-09 19:37:20.306: E/AndroidRuntime(958): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
08-09 19:37:20.306: E/AndroidRuntime(958): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
08-09 19:37:20.306: E/AndroidRuntime(958): ... 11 more
08-09 19:37:24.495: I/Process(958): Sending signal. PID: 958 SIG: 9
It seems you renamed your mainactivity class and didn't update the android manifest.
i'm getting this message when i run my application i don't know why i'm getting it could any one help me. here is the logcat.
java.lang.VerifyError: com.kosh.me.Smaller
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1429)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
This happens when the build library classes conflict with those at run-time. Try performing a Clean of your project followed by a build.
I have a simple android application which uses a modbus library ("jamod") on its build path. It crashes immediately as i run it. I have basically the same problem in this question: Getting "Caused by: java.lang.VerifyError:"
But i cannot really fix the problem. My application was working fine before, now no matter what i do it doesn't seem to work.
Below is logcat output. Thanks in advance.
08-09 14:36:47.753: W/dalvikvm(396): VFY: unable to find class referenced in signature (Lnet/wimpi/modbus/net/TCPMasterConnection;)
08-09 14:36:47.823: W/dalvikvm(396): VFY: unable to resolve exception class 510 (Lnet/wimpi/modbus/ModbusIOException;)
08-09 14:36:47.823: W/dalvikvm(396): VFY: unable to find exception handler at addr 0x18
08-09 14:36:47.854: W/dalvikvm(396): VFY: rejected Lcom/example/xmlparsertest/JavaModBusTcpDriver;.<init> (Ljava/lang/String;I)V
08-09 14:36:47.854: W/dalvikvm(396): VFY: rejecting opcode 0x0d at 0x0018
08-09 14:36:47.854: W/dalvikvm(396): VFY: rejected Lcom/example/xmlparsertest/JavaModBusTcpDriver;.<init> (Ljava/lang/String;I)V
08-09 14:36:47.854: W/dalvikvm(396): Verifier rejected class Lcom/example/xmlparsertest/JavaModBusTcpDriver;
08-09 14:36:47.854: D/AndroidRuntime(396): Shutting down VM
08-09 14:36:47.854: W/dalvikvm(396): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-09 14:36:47.873: E/AndroidRuntime(396): FATAL EXCEPTION: main
08-09 14:36:47.873: E/AndroidRuntime(396): java.lang.VerifyError: com.example.xmlparsertest.JavaModBusTcpDriver
08-09 14:36:47.873: E/AndroidRuntime(396): at com.example.xmlparsertest.MainActivity.<init>(MainActivity.java:13)
08-09 14:36:47.873: E/AndroidRuntime(396): at java.lang.Class.newInstanceImpl(Native Method)
08-09 14:36:47.873: E/AndroidRuntime(396): at java.lang.Class.newInstance(Class.java:1429)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.os.Handler.dispatchMessage(Handler.java:99)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.os.Looper.loop(Looper.java:123)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-09 14:36:47.873: E/AndroidRuntime(396): at java.lang.reflect.Method.invokeNative(Native Method)
08-09 14:36:47.873: E/AndroidRuntime(396): at java.lang.reflect.Method.invoke(Method.java:521)
08-09 14:36:47.873: E/AndroidRuntime(396): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-09 14:36:47.873: E/AndroidRuntime(396): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-09 14:36:47.873: E/AndroidRuntime(396): at dalvik.system.NativeStart.main(Native Method)
One thing to double check you are doing is that the checkbox is ticked for the jar files in the "Order and Export" tab in the Build path window. That will include the library in the built APK.
Did you put the jamod jar file in the "libs" directory in Eclipse? If not it won't be bundled into your application even if it is on the path during compilation. This is a fairly new change.
I had a similar VFY, link and class def not found errors even though all of my libraries were in "LIB" folder and had added them in build path as well and ECLIPSE could find them easily in compile time, but when they were deployed on a real device, it gave problems.
Solution: Make sure your library files are placed in "libs" folder and not in "lib" or "library" in the ECLIPSE project.
This error (java.lang.VerifyError) comes when there are incompatible resources like interfaces/class/libs files, improper inheritances/encapsulation of static/instance level identifiers as variables/methods/arguments/class/files.
This issue is coming by simply violation of OOP design principles in the code. So the code rejected by verification process of jvm and throws verification error on runtime. If you closely look at the Error stacktrace, Instance of class-A(com.example.xmlparsertest.MainActivity) is being created by jvm stack [java.lang.Class.newInstanceImpl(Native Method)... java.lang.Class.newInstance...]. This class is referring or being reffered by other classes with violation of design principles which is causing the class to fail to get instantiated.
08-09 14:36:47.854: W/dalvikvm(396): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-09 14:36:47.873: E/AndroidRuntime(396): FATAL EXCEPTION: main
08-09 14:36:47.873: E/AndroidRuntime(396): java.lang.VerifyError: com.example.xmlparsertest.JavaModBusTcpDriver
08-09 14:36:47.873: E/AndroidRuntime(396): at com.example.xmlparsertest.MainActivity.<init>(MainActivity.java:13)
08-09 14:36:47.873: E/AndroidRuntime(396): at java.lang.Class.newInstanceImpl(Native Method)
08-09 14:36:47.873: E/AndroidRuntime(396): at java.lang.Class.newInstance(Class.java:1429)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.os.Handler.dispatchMessage(Handler.java:99)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.os.Looper.loop(Looper.java:123)
08-09 14:36:47.873: E/AndroidRuntime(396): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-09 14:36:47.873: E/AndroidRuntime(396): at java.lang.reflect.Method.invokeNative(Native Method)
08-09 14:36:47.873: E/AndroidRuntime(396): at java.lang.reflect.Method.invoke(Method.java:521)
08-09 14:36:47.873: E/AndroidRuntime(396): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-09 14:36:47.873: E/AndroidRuntime(396): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-09 14:36:47.873: E/AndroidRuntime(396): at dalvik.system.NativeStart.main(Native Method)
These warnings cannot be ignored because these warnings are causing the FATAL EXCEPTIONS. Dalvikvm Engineers have implemented the OOP principles as Sun Engineers Done. There are various blogs/forum where people says to ignore these warning. So do not ignore these warning and correct them especially for medical/banking/security field applications or that warning is causing to break the Application.
Do recheck your implemented OOP design principles (e.g. inheritances/encapsulation/polymorphism etc.) in the code. I was being asked to check and eliminate such errors on a big multi-module android application and i found many design violations.
First trigger to solve such issues make public/non-final everything related to class which is getting into FATAL ERROR. Once you solved, then implement your design principles one-by-one and you will get an error free appplication.
Thanks,
Vinod Bherwal (Android Architect).
I have used more than 15 Handlers in a timing being executed one gets over another on completion.I get java.lang.OutOfMemoryError: thread creation failed in the log and the app crashes,the code runs fine for the first time and gets crashes in the second time due to this issue how can I resolve this.Please help with this issue.Thanks.
MY log is
08-09 13:36:12.125: E/AndroidRuntime(1473): FATAL EXCEPTION: main
08-09 13:36:12.125: E/AndroidRuntime(1473): java.lang.OutOfMemoryError: thread creation failed
08-09 13:36:12.125: E/AndroidRuntime(1473): at java.lang.VMThread.create(Native Method)
08-09 13:36:12.125: E/AndroidRuntime(1473): at java.lang.Thread.start(Thread.java:1232)
08-09 13:36:12.125: E/AndroidRuntime(1473): at java.util.Timer$TimerImpl.<init>(Timer.java:192)
08-09 13:36:12.125: E/AndroidRuntime(1473): at java.util.Timer.<init>(Timer.java:369)
08-09 13:36:12.125: E/AndroidRuntime(1473): at java.util.Timer.<init>(Timer.java:389)
08-09 13:36:12.125: E/AndroidRuntime(1473): at java.util.Timer.<init>(Timer.java:396)
08-09 13:36:12.125: E/AndroidRuntime(1473): at com.CarBuyCo.Slotter.rollerstopthree(Slotter.java:655)*
08-09 13:36:12.125: E/AndroidRuntime(1473): at com.CarBuyCo.Slotter$32.run(Slotter.java:593)*
08-09 13:36:12.125: E/AndroidRuntime(1473): at android.os.Handler.handleCallback(Handler.java:587)
08-09 13:36:12.125: E/AndroidRuntime(1473): at android.os.Handler.dispatchMessage(Handler.java:92)
08-09 13:36:12.125: E/AndroidRuntime(1473): at android.os.Looper.loop(Looper.java:130)
08-09 13:36:12.125: E/AndroidRuntime(1473): at android.app.ActivityThread.main(ActivityThread.java:3687)
08-09 13:36:12.125: E/AndroidRuntime(1473): at java.lang.reflect.Method.invokeNative(Native Method)
08-09 13:36:12.125: E/AndroidRuntime(1473): at java.lang.reflect.Method.invoke(Method.java:507)
08-09 13:36:12.125: E/AndroidRuntime(1473): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
08-09 13:36:12.125: E/AndroidRuntime(1473): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
08-09 13:36:12.125: E/AndroidRuntime(1473): at dalvik.system.NativeStart.main(Native Method)
when im going to insert the the data in database i found the following errors
please give me solution
07-26 12:24:38.275: ERROR/Zygote(32): setreuid() failed. errno: 2
07-26 12:24:45.445: ERROR/Zygote(32): setreuid() failed. errno: 17
07-26 12:24:46.705: ERROR/BatteryService(58): usbOnlinePath not found
07-26 12:24:46.705: ERROR/BatteryService(58): batteryVoltagePath not found
07-26 12:24:46.705: ERROR/BatteryService(58): batteryTemperaturePath not found
07-26 12:24:46.757: ERROR/SurfaceFlinger(58): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
07-26 12:24:52.576: ERROR/EventHub(58): could not get driver version for /dev/input/mouse0, Not a typewriter
07-26 12:24:52.576: ERROR/EventHub(58): could not get driver version for /dev/input/mice, Not a typewriter
07-26 12:24:52.727: ERROR/System(58): Failure starting core service
07-26 12:24:52.727: ERROR/System(58): java.lang.SecurityException
07-26 12:24:52.727: ERROR/System(58): at android.os.BinderProxy.transact(Native Method)
07-26 12:24:52.727: ERROR/System(58): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
07-26 12:24:52.727: ERROR/System(58): at android.os.ServiceManager.addService(ServiceManager.java:72)
07-26 12:24:52.727: ERROR/System(58): at com.android.server.ServerThread.run(SystemServer.java:184)
07-26 12:24:53.727: ERROR/SoundPool(58): error loading /system/media/audio/ui/Effect_Tick.ogg
07-26 12:24:53.737: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressStandard.ogg
07-26 12:24:53.737: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressSpacebar.ogg
07-26 12:24:53.737: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressDelete.ogg
07-26 12:24:53.746: ERROR/SoundPool(58): error loading /system/media/audio/ui/KeypressReturn.ogg
07-26 12:24:56.527: ERROR/ThrottleService(58): Could not open GPS configuration file /etc/gps.conf
07-26 12:24:57.955: ERROR/logwrapper(142): executing /system/bin/tc failed: No such file or directory
07-26 12:24:58.026: ERROR/logwrapper(144): executing /system/bin/tc failed: No such file or directory
07-26 12:24:58.096: ERROR/logwrapper(146): executing /system/bin/tc failed: No such file or directory
07-26 12:25:10.246: ERROR/HierarchicalStateMachine(58): TetherMaster - unhandledMessage: msg.what=3
07-26 12:25:41.245: ERROR/AndroidRuntime(274): FATAL EXCEPTION: main
07-26 12:25:41.245: ERROR/AndroidRuntime(274): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dataApplication/com.dataApplication.Edit}: java.lang.NullPointerException
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at android.os.Handler.dispatchMessage(Handler.java:99)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at android.os.Looper.loop(Looper.java:123)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at java.lang.reflect.Method.invokeNative(Native Method)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at java.lang.reflect.Method.invoke(Method.java:521)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at dalvik.system.NativeStart.main(Native Method)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): Caused by: java.lang.NullPointerException
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at com.dataApplication.Edit.onCreate(Edit.java:87)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-26 12:25:41.245: ERROR/AndroidRuntime(274): ... 11 more
07-26 12:26:54.735: ERROR/AndroidRuntime(285): FATAL EXCEPTION: main
07-26 12:26:54.735: ERROR/AndroidRuntime(285): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dataApplication/com.dataApplication.Edit}: java.lang.NullPointerException
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at android.os.Handler.dispatchMessage(Handler.java:99)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at android.os.Looper.loop(Looper.java:123)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at java.lang.reflect.Method.invokeNative(Native Method)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at java.lang.reflect.Method.invoke(Method.java:521)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at dalvik.system.NativeStart.main(Native Method)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): Caused by: java.lang.NullPointerException
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at com.dataApplication.Edit.onCreate(Edit.java:87)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-26 12:26:54.735: ERROR/AndroidRuntime(285): ... 11 more
I think the error you got is:
07-26 12:25:41.245: ERROR/AndroidRuntime(274): Caused by: java.lang.NullPointerException
07-26 12:25:41.245: ERROR/AndroidRuntime(274): at com.dataApplication.Edit.onCreate(Edit.java:87)
You are accessing a object that is not existing on line 87 in your Edit class.