android app using GCM crash after running - android

I am trying to create an app using GCM tech to push notifications, but the app crashes after running.
here is my logfile ..I can't find the mistake:
05-11 20:04:55.758: I/dalvikvm(20069): DexOpt: access denied from Lcom/google/android/gms/common/GooglePlayServicesUtil; to field Landroid/app/Notification;.extras
05-11 20:04:55.758: W/dalvikvm(20069): VFY: unable to resolve instance field 12
05-11 20:04:55.758: D/dalvikvm(20069): VFY: replacing opcode 0x54 at 0x00b3
05-11 20:04:55.758: E/dalvikvm(20069): Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
05-11 20:04:55.758: W/dalvikvm(20069): VFY: unable to resolve check-cast 29 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/common/GooglePlayServicesUtil;
05-11 20:04:55.758: D/dalvikvm(20069): VFY: replacing opcode 0x1f at 0x000e
05-11 20:04:55.758: I/dalvikvm(20069): Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzh
05-11 20:04:55.758: W/dalvikvm(20069): VFY: unable to resolve virtual method 534: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
05-11 20:04:55.758: D/dalvikvm(20069): VFY: replacing opcode 0x6e at 0x000b
05-11 20:04:55.793: D/AndroidRuntime(20069): Shutting down VM
05-11 20:04:55.793: W/dalvikvm(20069): threadid=1: thread exiting with uncaught exception (group=0x4108f2a0)
05-11 20:04:55.803: E/AndroidRuntime(20069): FATAL EXCEPTION: main
05-11 20:04:55.803: E/AndroidRuntime(20069): java.lang.RuntimeException: Unable to resume activity {com.prgguru.example/com.prgguru.example.MainActivity}: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2639)
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2667)
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2140)
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.app.ActivityThread.access$700(ActivityThread.java:140)
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.os.Handler.dispatchMessage(Handler.java:99)
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.os.Looper.loop(Looper.java:137)
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.app.ActivityThread.main(ActivityThread.java:4921)
05-11 20:04:55.803: E/AndroidRuntime(20069): at java.lang.reflect.Method.invokeNative(Native Method)
05-11 20:04:55.803: E/AndroidRuntime(20069): at java.lang.reflect.Method.invoke(Method.java:511)
05-11 20:04:55.803: E/AndroidRuntime(20069): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
05-11 20:04:55.803: E/AndroidRuntime(20069): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
05-11 20:04:55.803: E/AndroidRuntime(20069): at dalvik.system.NativeStart.main(Native Method)
05-11 20:04:55.803: E/AndroidRuntime(20069): Caused by: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
05-11 20:04:55.803: E/AndroidRuntime(20069): at com.google.android.gms.common.GooglePlayServicesUtil.zzO(Unknown Source)
05-11 20:04:55.803: E/AndroidRuntime(20069): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
05-11 20:04:55.803: E/AndroidRuntime(20069): at com.prgguru.example.MainActivity.checkPlayServices(MainActivity.java:206)
05-11 20:04:55.803: E/AndroidRuntime(20069): at com.prgguru.example.MainActivity.onResume(MainActivity.java:235)
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1199)
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.app.Activity.performResume(Activity.java:5280)
05-11 20:04:55.803: E/AndroidRuntime(20069): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2629)
05-11 20:04:55.803: E/AndroidRuntime(20069): ... 12 more
05-11 20:04:55.838: D/dalvikvm(20069): GC_CONCURRENT freed 218K, 14% free 9628K/11143K, paused 33ms+3ms, total 77ms
05-11 20:04:55.838: D/dalvikvm(20069): WAIT_FOR_CONCURRENT_GC blocked 33ms
05-11 20:05:11.633: I/Process(20069): Sending signal. PID: 20069 SIG: 9
whats wrong?!

you should add this lines in inside the tag.
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Make sure google-play-service_lib library added or not to your project.

Related

How to debug an error when I create a string in login method? [duplicate]

This question already has answers here:
Can not find a View with findViewById()
(4 answers)
What is a NullPointerException, and how do I fix it?
(12 answers)
What is a stack trace, and how can I use it to debug my application errors?
(7 answers)
Closed 5 years ago.
03-30 23:49:56.536 15105-15105/? D/dalvikvm: Late-enabling CheckJNI
03-30 23:49:56.560 15105-15111/? E/jdwp: Failed writing handshake
bytes: Broken pipe (-1 of 14) 03-30 23:49:56.560 15105-15111/?
D/dalvikvm: Debugger has detached; object registry had 0 entries 03-30
23:49:56.600 15105-15105/? I/dalvikvm: Could not find method
android.view.Window$Callback.onProvideKeyboardShortcuts, referenced
from method
android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts
03-30 23:49:56.600 15105-15105/? W/dalvikvm: VFY: unable to resolve
interface method 21845:
Landroid/view/Window$Callback;.onProvideKeyboardShortcuts
(Ljava/util/List;Landroid/view/Menu;I)V 03-30 23:49:56.600
15105-15105/? D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 03-30
23:49:56.604 15105-15105/? W/dalvikvm: VFY: unable to find class
referenced in signature (Landroid/view/SearchEvent;) 03-30
23:49:56.604 15105-15105/? I/dalvikvm: Could not find method
android.view.Window$Callback.onSearchRequested, referenced from method
android.support.v7.view.WindowCallbackWrapper.onSearchRequested 03-30
23:49:56.604 15105-15105/? W/dalvikvm: VFY: unable to resolve
interface method 21847:
Landroid/view/Window$Callback;.onSearchRequested
(Landroid/view/SearchEvent;)Z 03-30 23:49:56.604 15105-15105/?
D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 03-30 23:49:56.604
15105-15105/? I/dalvikvm: Could not find method
android.view.Window$Callback.onWindowStartingActionMode, referenced
from method
android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
03-30 23:49:56.604 15105-15105/? W/dalvikvm: VFY: unable to resolve
interface method 21851:
Landroid/view/Window$Callback;.onWindowStartingActionMode
(Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode; 03-30
23:49:56.604 15105-15105/? D/dalvikvm: VFY: replacing opcode 0x72 at
0x0002 03-30 23:49:56.604 15105-15105/? I/dalvikvm: Could not find
method android.content.res.TypedArray.getChangingConfigurations,
referenced from method
android.support.v7.widget.TintTypedArray.getChangingConfigurations
03-30 23:49:56.604 15105-15105/? W/dalvikvm: VFY: unable to resolve
virtual method 502:
Landroid/content/res/TypedArray;.getChangingConfigurations ()I 03-30
23:49:56.604 15105-15105/? D/dalvikvm: VFY: replacing opcode 0x6e at
0x0002 03-30 23:49:56.604 15105-15105/? I/dalvikvm: Could not find
method android.content.res.TypedArray.getType, referenced from method
android.support.v7.widget.TintTypedArray.getType 03-30 23:49:56.604
15105-15105/? W/dalvikvm: VFY: unable to resolve virtual method 524:
Landroid/content/res/TypedArray;.getType (I)I 03-30 23:49:56.604
15105-15105/? D/dalvikvm: VFY: replacing opcode 0x6e at 0x0008 03-30
23:49:56.636 15105-15105/? I/dalvikvm: Could not find method
android.widget.FrameLayout.startActionModeForChild, referenced from
method
android.support.v7.widget.ActionBarContainer.startActionModeForChild
03-30 23:49:56.636 15105-15105/? W/dalvikvm: VFY: unable to resolve
virtual method 22329:
Landroid/widget/FrameLayout;.startActionModeForChild
(Landroid/view/View;Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
03-30 23:49:56.640 15105-15105/? D/dalvikvm: VFY: replacing opcode
0x6f at 0x0002 03-30 23:49:56.640 15105-15105/? I/dalvikvm: Could not
find method android.content.Context.getColorStateList, referenced from
method
android.support.v7.content.res.AppCompatResources.getColorStateList
03-30 23:49:56.640 15105-15105/? W/dalvikvm: VFY: unable to resolve
virtual method 315: Landroid/content/Context;.getColorStateList
(I)Landroid/content/res/ColorStateList; 03-30 23:49:56.640
15105-15105/? D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006 03-30
23:49:56.652 15105-15105/? I/dalvikvm: Could not find method
android.content.res.Resources.getDrawable, referenced from method
android.support.v7.widget.ResourcesWrapper.getDrawable 03-30
23:49:56.652 15105-15105/? W/dalvikvm: VFY: unable to resolve virtual
method 465: Landroid/content/res/Resources;.getDrawable
(ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
03-30 23:49:56.652 15105-15105/? D/dalvikvm: VFY: replacing opcode
0x6e at 0x0002 03-30 23:49:56.652 15105-15105/? I/dalvikvm: Could not
find method android.content.res.Resources.getDrawableForDensity,
referenced from method
android.support.v7.widget.ResourcesWrapper.getDrawableForDensity 03-30
23:49:56.652 15105-15105/? W/dalvikvm: VFY: unable to resolve virtual
method 467: Landroid/content/res/Resources;.getDrawableForDensity
(IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
03-30 23:49:56.652 15105-15105/? D/dalvikvm: VFY: replacing opcode
0x6e at 0x0002 03-30 23:49:56.660 15105-15105/? E/dalvikvm: Could not
find class 'android.graphics.drawable.RippleDrawable', referenced from
method
android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
03-30 23:49:56.660 15105-15105/? W/dalvikvm: VFY: unable to resolve
instanceof 150 (Landroid/graphics/drawable/RippleDrawable;) in
Landroid/support/v7/widget/AppCompatImageHelper; 03-30 23:49:56.660
15105-15105/? D/dalvikvm: VFY: replacing opcode 0x20 at 0x000c 03-30
23:49:56.680 15105-15108/? D/dalvikvm: GC_CONCURRENT freed 234K, 22%
free 2639K/3364K, paused 1ms+2ms, total 9ms 03-30 23:49:56.692
15105-15105/? D/dalvikvm: GC_FOR_ALLOC freed 31K, 21% free
2676K/3364K, paused 3ms, total 3ms 03-30 23:49:56.692 15105-15105/?
I/dalvikvm-heap: Grow heap (frag case) to 3.506MB for 435468-byte
allocation 03-30 23:49:56.692 15105-15114/? D/dalvikvm: GC_FOR_ALLOC
freed 1K, 19% free 3100K/3792K, paused 3ms, total 3ms 03-30
23:49:56.700 15105-15108/? D/dalvikvm: GC_CONCURRENT freed 3K, 19%
free 3097K/3792K, paused 0ms+0ms, total 6ms 03-30 23:49:56.700
15105-15105/? D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 5ms 03-30
23:49:56.700 15105-15105/? I/dalvikvm-heap: Grow heap (frag case) to
3.821MB for 333408-byte allocation 03-30 23:49:56.704 15105-15114/? D/dalvikvm: GC_FOR_ALLOC freed <1K, 17% free 3422K/4120K, paused 4ms,
total 4ms 03-30 23:49:56.748 15105-15105/? D/libEGL: loaded
/system/lib/egl/libEGL_genymotion.so
[ 03-30 23:49:56.748 15105:15105 D/ ]
HostConnection::get() New Host Connection established 0xb85b25b0, tid 15105
[ 03-30 23:49:56.752 62: 62 D/ ]
Socket deconnection 03-30 23:49:56.756 15105-15105/? D/libEGL: loaded
/system/lib/egl/libGLESv1_CM_genymotion.so 03-30 23:49:56.756
15105-15105/? D/libEGL: loaded /system/lib/egl/libGLESv2_genymotion.so
03-30 23:49:56.804 15105-15105/? W/EGL_genymotion: eglSurfaceAttrib
not implemented 03-30 23:49:56.804 15105-15105/? E/OpenGLRenderer:
Getting MAX_TEXTURE_SIZE from GradienCache 03-30 23:49:56.812
15105-15105/? E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from
Caches::initConstraints() 03-30 23:49:56.812 15105-15105/?
D/OpenGLRenderer: Enabling debug mode 0 03-30 23:50:19.456
15105-15105/com.example.samsungvy277.myapp E/InputEventSender:
Exception dispatching finished signal. 03-30 23:50:19.456
15105-15105/com.example.samsungvy277.myapp E/MessageQueue-JNI:
Exception in MessageQueue callback: handleReceiveCallback 03-30
23:50:19.468 15105-15105/com.example.samsungvy277.myapp D/dalvikvm:
GC_FOR_ALLOC freed 806K, 30% free 3127K/4428K, paused 5ms, total 5ms
03-30 23:50:19.468 15105-15105/com.example.samsungvy277.myapp
E/MessageQueue-JNI: java.lang.IllegalStateException: Could not execute
method for android:onClick
at
android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)
at android.view.View.performClick(View.java:4240)
at android.view.View.onKeyUp(View.java:7928)
at android.widget.TextView.onKeyUp(TextView.java:5606)
at android.view.KeyEvent.dispatch(KeyEvent.java:2647)
at android.view.View.dispatchKeyEvent(View.java:7343)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1933)
at
com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1408)
at android.app.Activity.dispatchKeyEvent(Activity.java:2384)
at
android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:541)
at
android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at
android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:319)
at
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1860)
at
android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:3791)
at
android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3774)
at
android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
at
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
at
android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
at
android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3483)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
at
android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3540)
at
android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
at
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
at
android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
at
android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
at
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
at
android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
at
android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3516)
at
android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3666)
at
android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:1982)
at
android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1698)
at
android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1689)
at
android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:1959)
at
android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:132)
at android.os.Looper.loop(Looper.java:124)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at an 03-30 23:50:19.468 15105-15105/com.example.samsungvy277.myapp
D/AndroidRuntime: Shutting down VM 03-30 23:50:19.472
15105-15105/com.example.samsungvy277.myapp W/dalvikvm: threadid=1:
thread exiting with uncaught exception (group=0xa4c2e648) 03-30
23:50:19.480 15105-15105/com.example.samsungvy277.myapp
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method for
android:onClick
at
android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)
at android.view.View.performClick(View.java:4240)
at android.view.View.onKeyUp(View.java:7928)
at android.widget.TextView.onKeyUp(TextView.java:5606)
at android.view.KeyEvent.dispatch(KeyEvent.java:2647)
at android.view.View.dispatchKeyEvent(View.java:7343)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1393)
at
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1933)
at
com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1408)
at android.app.Activity.dispatchKeyEvent(Activity.java:2384)
at
android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:541)
at
android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at
android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:319)
at
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1860)
at
android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:3791)
at
android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3774)
at
android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
at
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
at
android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
at
android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3483)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
at
android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3540)
at
android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
at
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
at
android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
at
android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
at
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
at
android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
at
android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3516)
at
android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3666)
at
android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:1982)
at
android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1698)
at
android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1689)
at
android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:1959)
at
android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:132)
at android.os.Looper.loop(Looper.java:124)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Met 03-30 23:50:22.504
15105-15105/? I/Process: Sending signal. PID: 15105 SIG: 9
Use findViewById after setting your setContentView(R.layout.activity_main)

Application Crashes on Start after creating Application Class to set Parse.com Push Notifications

I'm following this tutorial to enable Parse Push Notifications.https://parse.com/tutorials/android-push-notifications
I also downloaded the code and used it in my own application. But it is causing the application to crash on start and I don't know why.
Here is my code for the Application Class:
public class Application extends android.app.Application {
public Application() {
}
#Override
public void onCreate() {
super.onCreate();
// Initialize the Parse SDK.
Parse.initialize(this, "My_APP_ID", "My_CLIENT_KEY");
// Specify an Activity to handle all pushes by default.
PushService.setDefaultPushCallback(this, MainActivity.class);
}
}
When I remove the last two lines related to Parse my application works fine. Could you please help me.
This is the logcat output:
--------- beginning of /dev/log/main
05-28 12:24:44.755 2638-2638/? D/AndroidRuntime﹕ >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
05-28 12:24:44.765 2638-2638/? D/AndroidRuntime﹕ CheckJNI is OFF
05-28 12:24:44.765 2638-2638/? D/dalvikvm﹕ Trying to load lib libjavacore.so 0x0
05-28 12:24:44.765 2638-2638/? D/dalvikvm﹕ Added shared lib libjavacore.so 0x0
05-28 12:24:44.765 2638-2638/? D/dalvikvm﹕ Trying to load lib libnativehelper.so 0x0
05-28 12:24:44.765 2638-2638/? D/dalvikvm﹕ Added shared lib libnativehelper.so 0x0
05-28 12:24:44.765 2638-2638/? D/dalvikvm﹕ No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
05-28 12:24:44.775 2638-2638/? D/dalvikvm﹕ Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
05-28 12:24:44.845 2638-2638/? E/memtrack﹕ Couldn't load memtrack module (No such file or directory)
05-28 12:24:44.845 2638-2638/? E/android.os.Debug﹕ failed to load memtrack module: -2
05-28 12:24:44.865 2638-2638/? D/AndroidRuntime﹕ Calling main entry com.android.commands.am.Am
--------- beginning of /dev/log/system
05-28 12:24:44.865 1724-1815/system_process I/ActivityManager﹕ Force stopping com.example.adla.insurancemobileapplication appid=10066 user=0: from pid 2638
05-28 12:24:44.875 2638-2638/? D/AndroidRuntime﹕ Shutting down VM
05-28 12:24:44.875 2638-2645/? D/dalvikvm﹕ Debugger has detached; object registry had 1 entries
05-28 12:24:44.875 2638-2647/? I/AndroidRuntime﹕ NOTE: attach of thread 'Binder_1' failed
05-28 12:24:44.875 2638-2646/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
05-28 12:24:44.875 1724-1739/system_process I/ActivityManager﹕ Setting mBooting value to false, currently mBooted = true
05-28 12:24:45.135 2658-2658/? D/AndroidRuntime﹕ >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
05-28 12:24:45.135 2658-2658/? D/AndroidRuntime﹕ CheckJNI is OFF
05-28 12:24:45.145 2658-2658/? D/dalvikvm﹕ Trying to load lib libjavacore.so 0x0
05-28 12:24:45.145 2658-2658/? D/dalvikvm﹕ Added shared lib libjavacore.so 0x0
05-28 12:24:45.155 2658-2658/? D/dalvikvm﹕ Trying to load lib libnativehelper.so 0x0
05-28 12:24:45.155 2658-2658/? D/dalvikvm﹕ Added shared lib libnativehelper.so 0x0
05-28 12:24:45.155 2658-2658/? D/dalvikvm﹕ No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
05-28 12:24:45.165 2658-2658/? D/dalvikvm﹕ Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
05-28 12:24:45.265 2658-2665/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
05-28 12:24:45.305 2658-2658/? E/memtrack﹕ Couldn't load memtrack module (No such file or directory)
05-28 12:24:45.305 2658-2658/? E/android.os.Debug﹕ failed to load memtrack module: -2
05-28 12:24:45.325 2658-2658/? D/AndroidRuntime﹕ Calling main entry com.android.commands.am.Am
05-28 12:24:45.345 1724-1735/system_process I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.adla.insurancemobileapplication/.MainActivity} from pid 2658
05-28 12:24:45.345 1724-1735/system_process D/ActivityManager﹕ TopActivityInfo, pkgName: com.example.adla.insurancemobileapplication activityName: com.example.adla.insurancemobileapplication.MainActivity bstSpecialAppKeyboardHandlingEnabled = false
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ event === app_launch
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ hiding guidance
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ hardKeyboard = 1
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ controllerType === DualAction
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ appName: InsuranceMobileApplication, currentPkg: com.example.adla.insurancemobileapplication, event: app_launch, controller: DualAction
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ appName: InsuranceMobileApplication
05-28 12:24:45.345 1724-1735/system_process D/ActivityManager﹕ Showing guidance for pkgName: com.example.adla.insurancemobileapplication
05-28 12:24:45.355 2658-2658/? D/AndroidRuntime﹕ Shutting down VM
05-28 12:24:45.355 2658-2665/? D/dalvikvm﹕ Debugger has detached; object registry had 1 entries
05-28 12:24:45.355 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ no guidance for com.example.adla.insurancemobileapplication.
05-28 12:24:45.355 2669-2669/? D/dalvikvm﹕ Late-enabling CheckJNI
05-28 12:24:45.375 2669-2675/? D/dalvikvm﹕ Debugger has detached; object registry had 1 entries
05-28 12:24:45.375 1724-1913/system_process I/ActivityManager﹕ Start proc com.example.adla.insurancemobileapplication for activity com.example.adla.insurancemobileapplication/.MainActivity: pid=2669 uid=10066 gids={50066, 3003}
05-28 12:24:45.395 2031-2031/com.bluestacks.home D/Home.AppLaunchReceiver﹕ *************************Received app launch broadcast
05-28 12:24:45.395 2031-2031/com.bluestacks.home D/Home.AppLaunchReceiver﹕ APP LAUNCH com.example.adla.insurancemobileapplication
05-28 12:24:45.435 1724-1743/system_process D/WindowManager﹕ Sending appClickStats request with data: [package=com.example.adla.insurancemobileapplication, appname=InsuranceMobileApplication, appver=1.0, clickloc=system_server]
05-28 12:24:45.455 2669-2669/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
05-28 12:24:45.455 2669-2669/? W/dalvikvm﹕ VFY: unable to resolve virtual method 452: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
05-28 12:24:45.455 2669-2669/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.455 2669-2669/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
05-28 12:24:45.455 2669-2669/? W/dalvikvm﹕ VFY: unable to resolve virtual method 474: Landroid/content/res/TypedArray;.getType (I)I
05-28 12:24:45.455 2669-2669/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.465 2669-2669/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawable
05-28 12:24:45.465 2669-2669/? W/dalvikvm﹕ VFY: unable to resolve virtual method 415: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.465 2669-2669/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.465 2669-2669/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawableForDensity
05-28 12:24:45.465 2669-2669/? W/dalvikvm﹕ VFY: unable to resolve virtual method 417: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.465 2669-2669/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.465 2669-2669/? D/AndroidRuntime﹕ Shutting down VM
05-28 12:24:45.465 2669-2669/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x95d30b20)
05-28 12:24:45.475 2669-2669/? D/AndroidRuntime﹕ procName from cmdline: com.example.adla.insurancemobileapplication
05-28 12:24:45.475 2669-2669/? E/AndroidRuntime﹕ in writeCrashedAppName, pkgName :com.example.adla.insurancemobileapplication
05-28 12:24:45.495 2669-2672/? D/dalvikvm﹕ GC_CONCURRENT freed 324K, 18% free 3063K/3728K, paused 10ms+10ms, total 20ms
05-28 12:24:45.505 2669-2669/? D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 10ms
05-28 12:24:45.505 2669-2669/? I/Process﹕ Sending signal. PID: 2669 SIG: 9
05-28 12:24:45.505 1946-1996/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Application﹕ Application crash has been observed.
05-28 12:24:45.505 2669-2669/? D/AndroidRuntime﹕ file written successfully with content: com.example.adla.insurancemobileapplication StringBuffer : ;com.example.adla.insurancemobileapplication
05-28 12:24:45.505 2669-2669/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.adla.insurancemobileapplication, PID: 2669
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.adla.insurancemobileapplication/com.example.adla.insurancemobileapplication.MainActivity}: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at com.parse.Parse.enableLocalDatastore(Parse.java:65)
at com.example.adla.insurancemobileapplication.MainActivity.onCreate(MainActivity.java:48)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5021)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
            at dalvik.system.NativeStart.main(Native Method)
05-28 12:24:45.505 1724-1735/system_process I/ActivityManager﹕ Process com.example.adla.insurancemobileapplication (pid 2669) has died.
05-28 12:24:45.515 2689-2689/? D/dalvikvm﹕ Late-enabling CheckJNI
05-28 12:24:45.525 1724-1735/system_process I/ActivityManager﹕ Start proc com.example.adla.insurancemobileapplication for activity com.example.adla.insurancemobileapplication/.MainActivity: pid=2689 uid=10066 gids={50066, 3003}
05-28 12:24:45.635 2689-2689/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
05-28 12:24:45.635 2689-2689/? W/dalvikvm﹕ VFY: unable to resolve virtual method 452: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
05-28 12:24:45.635 2689-2689/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.635 2689-2689/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
05-28 12:24:45.635 2689-2689/? W/dalvikvm﹕ VFY: unable to resolve virtual method 474: Landroid/content/res/TypedArray;.getType (I)I
05-28 12:24:45.635 2689-2689/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.645 2689-2692/? D/dalvikvm﹕ GC_CONCURRENT freed 454K, 20% free 3016K/3728K, paused 10ms+0ms, total 40ms
05-28 12:24:45.645 2689-2689/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawable
05-28 12:24:45.645 2689-2689/? W/dalvikvm﹕ VFY: unable to resolve virtual method 415: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.645 2689-2689/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.645 2689-2689/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawableForDensity
05-28 12:24:45.645 2689-2689/? W/dalvikvm﹕ VFY: unable to resolve virtual method 417: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.645 2689-2689/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.645 2689-2689/? D/AndroidRuntime﹕ Shutting down VM
05-28 12:24:45.645 2689-2689/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x95d30b20)
05-28 12:24:45.645 1946-1996/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Application﹕ Application crash has been observed.
05-28 12:24:45.645 2689-2689/? I/Process﹕ Sending signal. PID: 2689 SIG: 9
05-28 12:24:45.645 2689-2689/? D/AndroidRuntime﹕ procName from cmdline: com.example.adla.insurancemobileapplication
05-28 12:24:45.645 2689-2689/? E/AndroidRuntime﹕ in writeCrashedAppName, pkgName :com.example.adla.insurancemobileapplication
05-28 12:24:45.645 2689-2689/? D/AndroidRuntime﹕ file written successfully with content: com.example.adla.insurancemobileapplication StringBuffer : ;com.example.adla.insurancemobileapplication
05-28 12:24:45.645 2689-2689/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.adla.insurancemobileapplication, PID: 2689
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.adla.insurancemobileapplication/com.example.adla.insurancemobileapplication.MainActivity}: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at com.parse.Parse.enableLocalDatastore(Parse.java:65)
at com.example.adla.insurancemobileapplication.MainActivity.onCreate(MainActivity.java:48)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5021)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
            at dalvik.system.NativeStart.main(Native Method)
05-28 12:24:45.655 2727-2727/? D/dalvikvm﹕ Late-enabling CheckJNI
05-28 12:24:45.655 1724-1909/system_process I/ActivityManager﹕ Process com.example.adla.insurancemobileapplication (pid 2689) has died.
05-28 12:24:45.675 1724-1909/system_process I/ActivityManager﹕ Start proc com.example.adla.insurancemobileapplication for activity com.example.adla.insurancemobileapplication/.MainActivity: pid=2727 uid=10066 gids={50066, 3003}
05-28 12:24:45.705 2727-2727/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
05-28 12:24:45.705 2727-2727/? W/dalvikvm﹕ VFY: unable to resolve virtual method 452: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
05-28 12:24:45.705 2727-2727/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.705 2727-2727/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
05-28 12:24:45.705 2727-2727/? W/dalvikvm﹕ VFY: unable to resolve virtual method 474: Landroid/content/res/TypedArray;.getType (I)I
05-28 12:24:45.705 2727-2727/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.725 2727-2731/? D/dalvikvm﹕ GC_CONCURRENT freed 433K, 25% free 2826K/3728K, paused 10ms+0ms, total 10ms
05-28 12:24:45.735 2727-2727/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawable
05-28 12:24:45.735 2727-2727/? W/dalvikvm﹕ VFY: unable to resolve virtual method 415: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.735 2727-2727/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.735 2727-2727/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawableForDensity
05-28 12:24:45.735 2727-2727/? W/dalvikvm﹕ VFY: unable to resolve virtual method 417: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.735 2727-2727/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.745 2727-2727/? D/AndroidRuntime﹕ Shutting down VM
05-28 12:24:45.745 2727-2727/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x95d30b20)
05-28 12:24:45.745 1946-1996/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Application﹕ Application crash has been observed.
05-28 12:24:45.745 2727-2727/? I/Process﹕ Sending signal. PID: 2727 SIG: 9
05-28 12:24:45.745 2727-2727/? D/AndroidRuntime﹕ procName from cmdline: com.example.adla.insurancemobileapplication
05-28 12:24:45.745 2727-2727/? E/AndroidRuntime﹕ in writeCrashedAppName, pkgName :com.example.adla.insurancemobileapplication
05-28 12:24:45.745 2727-2727/? D/AndroidRuntime﹕ file written successfully with content: com.example.adla.insurancemobileapplication StringBuffer : ;com.example.adla.insurancemobileapplication
05-28 12:24:45.745 2727-2727/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.adla.insurancemobileapplication, PID: 2727
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.adla.insurancemobileapplication/com.example.adla.insurancemobileapplication.MainActivity}: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at com.parse.Parse.enableLocalDatastore(Parse.java:65)
at com.example.adla.insurancemobileapplication.MainActivity.onCreate(MainActivity.java:48)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5021)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
            at dalvik.system.NativeStart.main(Native Method)
05-28 12:24:45.755 1724-1914/system_process I/ActivityManager﹕ Process com.example.adla.insurancemobileapplication (pid 2727) has died.
05-28 12:24:45.755 1724-1914/system_process W/ActivityManager﹕ Force removing ActivityRecord{4b263638 u0 com.example.adla.insurancemobileapplication/.MainActivity t11}: app died, no saved state
Caused by: java.lang.IllegalStateException:
Parse#enableLocalDatastore(Context) must be invoked before
Parse#initialize(Context)
Seems you just need to follow the advice from the exception:
#Override
public void onCreate() {
super.onCreate();
Parse.enableLocalDatastore(this);
// Initialize the Parse SDK.
Parse.initialize(this, "My_APP_ID", "My_CLIENT_KEY");
// Specify an Activity to handle all pushes by default.
PushService.setDefaultPushCallback(this, MainActivity.class);
}

Android in-app purchase fails in my adapter

I have a list which has a buy button and on click of this button I would like to make an in-app purchase.
I have created an interface and also a function in my fragment but I am getting following error.
05-11 11:02:03.224: E/AndroidRuntime(2999): FATAL EXCEPTION: main
05-11 11:02:03.224: E/AndroidRuntime(2999): java.lang.ClassCastException: com.chinese.flashcard.ShopActivity cannot be cast to com.chinese.flashcard.TestAdapter$IABHelperProvider
05-11 11:02:03.224: E/AndroidRuntime(2999): at com.chinese.flashcard.TestAdapter.getView(TestAdapter.java:82)
05-11 11:02:03.224: E/AndroidRuntime(2999): at android.widget.AbsListView.obtainView(AbsListView.java:2177)
05-11 11:02:03.224: E/AndroidRuntime(2999): at android.widget.ListView.makeAndAddView(ListView.java:1840)
05-11 11:02:03.224: E/AndroidRuntime(2999): at android.widget.ListView.fillDown(ListView.java:675)
05-11 11:02:03.224: E/AndroidRuntime(2999): at android.widget.ListView.fillFromTop(ListView.java:736)
05-11 11:02:03.224: E/AndroidRuntime(2999): at android.widget.ListView.layoutChildren(ListView.java:1655)
05-11 11:02:03.224: E/AndroidRuntime(2999): at android.widget.AbsListView.onLayout(AbsListView.java:2012)
05-11 11:02:03.224: E/AndroidRuntime(2999): at android.view.View.layout(View.java:14289)
05-11 11:02:03.224: E/AndroidRuntime(2999): at android.view.ViewGroup.layout(ViewGroup.java:4562)
05-11 11:02:03.224: E/AndroidRuntime(2999): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)

Android Maps v2 Stopped Working

I've had Google Maps v2 up and running for months, no code has changed, and now every fragment with a MapFragment crashes when attached. (Building without proguard and signing with debug key)
I am guessing that it has to do with Play Services, because it appeared to work after re-installing the Play Services updates. But now it crashes again, even with re-installing. This occurs on two Samsung Note 8s, a Note 3, a Note 1, and a Nexus 5.
I have tried clean builds and regenerating the Maps API with a different Google APIs account.
I've included the necessary bits in my AndroidManifest:
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/app_id_maps"/>
I include the following xml in the my fragment layouts:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
map:mapType="normal"
map:uiCompass="true"
map:uiRotateGestures="true"
map:uiScrollGestures="true"
map:uiTiltGestures="true"
map:uiZoomControls="false"
map:uiZoomGestures="true"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Logcat:
07-31 08:23:57.721 31926-31926/com.packagename I/u﹕ Making Creator dynamically
07-31 08:23:57.731 31926-31926/com.packagename I/Google Maps Android API﹕ Google Play services client version: 5077000
07-31 08:23:57.731 31926-31926/com.packagename I/dalvikvm﹕ Could not find method guj.a, referenced from method gqi.a
07-31 08:23:57.731 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve static method 24936: Lguj;.a (Landroid/content/Context;)Lgri;
07-31 08:23:57.731 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0003
07-31 08:23:57.731 31926-31926/com.packagename E/dalvikvm﹕ Could not find class 'gpr', referenced from method gps.a
07-31 08:23:57.731 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-31 08:23:57.731 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
07-31 08:23:57.736 31926-31926/com.packagename E/dalvikvm﹕ Could not find class 'gpr', referenced from method gps.a
07-31 08:23:57.736 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-31 08:23:57.736 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
07-31 08:23:57.736 31926-31926/com.packagename E/dalvikvm﹕ Could not find class 'gpr', referenced from method gps.a
07-31 08:23:57.736 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-31 08:23:57.736 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
07-31 08:23:57.736 31926-31926/com.packagename D/dalvikvm﹕ DexOpt: unable to opt direct call 0x5ea3 at 0x0a in Lgps;.a
07-31 08:23:57.736 31926-31926/com.packagename D/dalvikvm﹕ DexOpt: unable to opt direct call 0x5ea3 at 0x0c in Lgps;.a
07-31 08:23:57.736 31926-31926/com.packagename D/dalvikvm﹕ DexOpt: unable to opt direct call 0x5ea3 at 0x0a in Lgps;.a
07-31 08:23:57.741 31926-31926/com.packagename I/Google Maps Android API﹕ Google Play services package version: 5084030
07-31 08:23:57.746 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve static field 20873 (t) in Lyp;
07-31 08:23:57.746 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x62 at 0x000e
07-31 08:23:57.746 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve static field 20873 (t) in Lyp;
07-31 08:23:57.746 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x62 at 0x000d
07-31 08:23:57.846 31926-31926/com.packagename I/dalvikvm﹕ Failed resolving Lcom/google/android/gms/location/internal/ParcelableGeofence; interface 4023 'Lgln;'
07-31 08:23:57.846 31926-31926/com.packagename W/dalvikvm﹕ Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed
07-31 08:23:57.846 31926-31926/com.packagename E/dalvikvm﹕ Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a
07-31 08:23:57.846 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve check-cast 2086 (Lcom/google/android/gms/location/internal/ParcelableGeofence;) in Lglt;
07-31 08:23:57.846 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x1f at 0x0019
07-31 08:23:57.886 31926-31926/com.packagename D/dalvikvm﹕ GC_FOR_ALLOC freed 3142K, 31% free 10122K/14616K, paused 19ms, total 19ms
07-31 08:23:57.901 31926-31926/com.packagename D/AbsListView﹕ Get MotionRecognitionManager
07-31 08:23:57.916 31926-32063/com.packagename A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 32063 (DataRequestDisp)
07-31 08:23:57.921 31926-31926/com.packagename D/ProgressBar﹕ setProgressDrawable drawableHeight = 0
07-31 08:23:57.921 31926-31926/com.packagename D/AbsSeekBar﹕ AbsSeekBar Constructor: misSeebarAnimationAvailable = false
07-31 08:23:57.956 31926-31926/com.packagename W/GmsClientEvents﹕ registerConnectionCallbacks(): listener com.google.android.gms.internal.hc$c#429b29d0 is already registered
07-31 08:23:58.011 31926-31926/com.packagename D/ProgressBar﹕ updateDrawableBounds: left = 0
07-31 08:23:58.011 31926-31926/com.packagename D/ProgressBar﹕ updateDrawableBounds: top = 0
07-31 08:23:58.011 31926-31926/com.packagename D/ProgressBar﹕ updateDrawableBounds: right = 64
07-31 08:23:58.011 31926-31926/com.packagename D/ProgressBar﹕ updateDrawableBounds: bottom = 64
On Samsung devices I also get this stacktrace:
07-31 08:23:57.656 31926-31926/com.packagename W/dalvikvm﹕ No implementation found for native Ldalvik/system/VMRuntime;.pauseGc:(Ljava/lang/String;)I
07-31 08:23:57.661 31926-31926/com.packagename E/ActivityThread﹕ Pause GC
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at android.app.ActivityThread.pauseGC(ActivityThread.java:5410)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2277)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
at android.app.ActivityThread.access$900(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5487)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Native method not found: dalvik.system.VMRuntime.pauseGc:(Ljava/lang/String;)I
at dalvik.system.VMRuntime.pauseGc(Native Method)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at android.app.ActivityThread.pauseGC(ActivityThread.java:5410)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2277)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
at android.app.ActivityThread.access$900(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5487)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)

Getting ClassNotFound

i have this messages from LogCat
dalvikvm(526): Could not find class 'com.temp.pt.database.DBHelper',
referenced from method com.temp.pt.database.DBUtils.getDBHelper
and after this i have this
05-11 21:46:25.305: E/AndroidRuntime(526): FATAL EXCEPTION: main
05-11 21:46:25.305: E/AndroidRuntime(526): java.lang.NoClassDefFoundError: com.temp.pt.database.DBHelper
05-11 21:46:25.305: E/AndroidRuntime(526): at com.temp.pt.database.DBUtils.getDBHelper(DBUtils.java:20)
05-11 21:46:25.305: E/AndroidRuntime(526): at com.temp.pt.CategoriesFragment$CategoryAsyncLoader.<init>(CategoriesFragment.java:169)
05-11 21:46:25.305: E/AndroidRuntime(526): at com.temp.pt.CategoriesFragment.onCreateLoader(CategoriesFragment.java:76)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.support.v4.app.LoaderManagerImpl.createLoader(LoaderManager.java:486)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.support.v4.app.LoaderManagerImpl.createAndInstallLoader(LoaderManager.java:495)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.support.v4.app.LoaderManagerImpl.initLoader(LoaderManager.java:549)
05-11 21:46:25.305: E/AndroidRuntime(526): at com.temp.pt.CategoriesFragment.onActivityCreated(CategoriesFragment.java:45)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:891)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1080)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1810)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:501)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1133)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.app.Activity.performStart(Activity.java:4475)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1929)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.os.Handler.dispatchMessage(Handler.java:99)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.os.Looper.loop(Looper.java:137)
05-11 21:46:25.305: E/AndroidRuntime(526): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-11 21:46:25.305: E/AndroidRuntime(526): at java.lang.reflect.Method.invokeNative(Native Method)
05-11 21:46:25.305: E/AndroidRuntime(526): at java.lang.reflect.Method.invoke(Method.java:511)
05-11 21:46:25.305: E/AndroidRuntime(526): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-11 21:46:25.305: E/AndroidRuntime(526): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-11 21:46:25.305: E/AndroidRuntime(526): at dalvik.system.NativeStart.main(Native Method)
note i have define the class and the app compiles without error but crash at runtime . any suggestion , ,solution for this problem ?

Categories

Resources