I am getting a crash on Samsung Note 2 with parse sdk version 1.5.1 and below is my Application class code.
#Override
public void onCreate()
{
super.onCreate();
try
{
Parse.enableLocalDatastore(this);
// Live acc
Parse.initialize(this, "XXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX");
//Enable to receive push
PushService.setDefaultPushCallback(this, RespondToPushActivity.class);
Log.d("System out", "Parse ID----> "+ParseInstallation.getCurrentInstallation().getString("deviceToken"));
Constants.PARSEID = ParseInstallation.getCurrentInstallation().getString("deviceToken");
ParseInstallation.getCurrentInstallation().saveInBackground();
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Now I got the stacktrace below:
java.lang.RuntimeException: java.util.ConcurrentModificationException
at com.parse.PushRouter$8$1.run(PushRouter.java:235)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
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:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.util.ConcurrentModificationException
at java.util.LinkedList$LinkIterator.next(LinkedList.java:124)
at com.parse.ParseObject.mergeREST(ParseObject.java:928)
at com.parse.OfflineStore$13$2.then(OfflineStore.java:765)
at com.parse.OfflineStore$13$2.then(OfflineStore.java:762)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.continueWith(Task.java:318)
at com.parse.Task.continueWith(Task.java:329)
at com.parse.Task$8.then(Task.java:381)
at com.parse.Task$8.then(Task.java:373)
at com.parse.Task$11.run(Task.java:481)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.continueWithTask(Task.java:353)
at com.parse.Task.onSuccess(Task.java:373)
at com.parse.Task.onSuccess(Task.java:393)
at com.parse.OfflineStore$13.then(OfflineStore.java:762)
at com.parse.OfflineStore$13.then(OfflineStore.java:721)
at com.parse.Task$11.run(Task.java:481)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.continueWithTask(Task.java:353)
at com.parse.Task.continueWithTask(Task.java:364)
at com.parse.Task$9.then(Task.java:410)
at com.parse.Task$9.then(Task.java:402)
at com.parse.Task$11.run(Task.java:481)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.access$400(Task.java:22)
at com.parse.Task$7.then(Task.java:346)
at com.parse.Task$7.then(Task.java:343)
at com.parse.Task.runContinuations(Task.java:510)
at com.parse.Task.access$800(Task.java:22)
at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
at com.parse.Task$11$1.then(Task.java:493)
at com.parse.Task$11$1.then(Task.java:485)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.continueWith(Task.java:318)
at com.parse.Task.continueWith(Task.java:329)
at com.parse.Task$11.run(Task.java:485)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.access$400(Task.java:22)
at com.parse.Task$7.then(Task.java:346)
at com.parse.Task$7.then(Task.java:343)
at com.parse.Task.runContinuations(Task.java:510)
at com.parse.Task.access$800(Task.java:22)
at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
at com.parse.Task$11$1.then(Task.java:493)
at com.parse.Task$11$1.then(Task.java:485)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.access$300(Task.java:22)
at com.parse.Task$6.then(Task.java:311)
at com.parse.Task$6.then(Task.java:308)
at com.parse.Task.runContinuations(Task.java:510)
at com.parse.Task.access$800(Task.java:22)
at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
at com.parse.Task$11$1.then(Task.java:493)
at com.parse.Task$11$1.then(Task.java:485)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.access$300(Task.java:22)
at com.parse.Task$6.then(Task.java:311)
at com.parse.Task$6.then(Task.java:308)
at com.parse.Task.runContinuations(Task.java:510)
at com.parse.Task.access$800(Task.java:22)
at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
at com.parse.Task$11$1.then(Task.java:493)
at com.parse.Task$11$1.then(Task.java:485)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.continueWith(Task.java:318)
at com.parse.Task.continueWith(Task.java:329)
at com.parse.Task$11.run(Task.java:485)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
[7:19:27 PM] Hiren Raval: 2nd once:
[7:19:28 PM] Hiren Raval: java.lang.RuntimeException: Unable to start receiver com.parse.ParseBroadcastReceiver: java.util.ConcurrentModificationException
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2462)
at android.app.ActivityThread.access$1600(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1365)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5317)
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.util.ConcurrentModificationException
at java.util.LinkedList$LinkIterator.next(LinkedList.java:124)
at com.parse.ParseObject.mergeREST(ParseObject.java:928)
at com.parse.OfflineStore$13$2.then(OfflineStore.java:765)
at com.parse.OfflineStore$13$2.then(OfflineStore.java:762)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.continueWith(Task.java:318)
at com.parse.Task.continueWith(Task.java:329)
at com.parse.Task$8.then(Task.java:381)
at com.parse.Task$8.then(Task.java:373)
at com.parse.Task$11.run(Task.java:481)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.continueWithTask(Task.java:353)
at com.parse.Task.onSuccess(Task.java:373)
at com.parse.Task.onSuccess(Task.java:393)
at com.parse.OfflineStore$13.then(OfflineStore.java:762)
at com.parse.OfflineStore$13.then(OfflineStore.java:721)
at com.parse.Task$11.run(Task.java:481)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.continueWithTask(Task.java:353)
at com.parse.Task.continueWithTask(Task.java:364)
at com.parse.Task$9.then(Task.java:410)
at com.parse.Task$9.then(Task.java:402)
at com.parse.Task$11.run(Task.java:481)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.access$400(Task.java:22)
at com.parse.Task$7.then(Task.java:346)
at com.parse.Task$7.then(Task.java:343)
at com.parse.Task.runContinuations(Task.java:510)
at com.parse.Task.access$800(Task.java:22)
at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
at com.parse.Task$11$1.then(Task.java:493)
at com.parse.Task$11$1.then(Task.java:485)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.continueWith(Task.java:318)
at com.parse.Task.continueWith(Task.java:329)
at com.parse.Task$11.run(Task.java:485)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.access$400(Task.java:22)
at com.parse.Task$7.then(Task.java:346)
at com.parse.Task$7.then(Task.java:343)
at com.parse.Task.runContinuations(Task.java:510)
at com.parse.Task.access$800(Task.java:22)
at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
at com.parse.Task$11$1.then(Task.java:493)
at com.parse.Task$11$1.then(Task.java:485)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.continueWith(Task.java:318)
at com.parse.Task.continueWith(Task.java:329)
at com.parse.Task$11.run(Task.java:485)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)
Let me know if anyone has a solution for this issue.
I have check this SO as well but no reply over there.
Try fully uninstalling the app from your phone and re-deploy it. I just had the same issue and uninstalling (include deleting cache and configs!) fixed it for me.
Did you make sure to register your custom Application class in the Android Manifest?
<application
android:name=".MyApplication"
...>
.
.
.
</application>
I had the same issue. As it appears in your stacktrace, you encountered a java.util.ConcurrentModificationException when iterating over a LinkedList:
at java.util.LinkedList$LinkIterator.next(LinkedList.java:124)
One solution is to protect your code in a synchronized block or method.
Another solution, which I chose, is to use a collection specifically made for concurrent accesses. In my case I wanted an random accessed list (like ArrayList) so I used instead the java.util.concurrent.CopyOnWriteArrayList provided in Android package java.util.concurrent. I did not find any concurrent access collection for LinkedList but maybe the CopyOnWriteArrayList is enough for you. It is specifically made to read the list a lot and update it rarely.
Wwhile I cannot guarantee I found the exact right solution (it is a concurrent access issue, so this is hard to test), I do not have the bug any more, I consider my issue resolved.
Related
i show on my tablelayout two videos and two images. For the videos i use the VideoView and for the images i use Picasso. All code is writed with Xamarin Android.
After any hours i have this error in logcat, but i don't understand the problem.
Can someone help me ? Sorry for my english.
07-28 13:47:35.090: E/Surface(2313): queueBuffer: error queuing buffer to SurfaceTexture, -19
07-28 13:47:35.090: E/Surface(2313): queueBuffer (handle=0x6a578a80) failed (No such device)
07-28 13:47:35.110: E/ViewRootImpl(2313): Could not unlock surface
07-28 13:47:35.110: E/ViewRootImpl(2313): java.lang.IllegalArgumentException
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.Surface.nativeUnlockCanvasAndPost(Native Method)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.Surface.unlockCanvasAndPost(Surface.java:285)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2584)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2437)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2281)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1892)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1005)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5750)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.Choreographer.doFrame(Choreographer.java:544)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.os.Handler.handleCallback(Handler.java:733)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.os.Handler.dispatchMessage(Handler.java:95)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.os.Looper.loop(Looper.java:136)
07-28 13:47:35.110: E/ViewRootImpl(2313): at android.app.ActivityThread.main(ActivityThread.java:5017)
07-28 13:47:35.110: E/ViewRootImpl(2313): at java.lang.reflect.Method.invokeNative(Native Method)
07-28 13:47:35.110: E/ViewRootImpl(2313): at java.lang.reflect.Method.invoke(Method.java:515)
07-28 13:47:35.110: E/ViewRootImpl(2313): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
07-28 13:47:35.110: E/ViewRootImpl(2313): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
07-28 13:47:35.110: E/ViewRootImpl(2313): at dalvik.system.NativeStart.main(Native Method)
07-28 13:47:35.130: E/ViewRootImpl(2313): drawSoftware() getRotation() error~~~#!
07-28 13:47:37.220: W/IMediaDeathNotifier(2313): media server died
07-28 13:47:37.220: E/MediaPlayer(2313): error (100, 0)
07-28 13:47:37.220: W/AudioSystem(2313): AudioFlinger server died!
07-28 13:47:37.220: E/MediaPlayer(2313): error (100, 0)
07-28 13:47:37.220: E/MediaPlayer(2313): Error (100,0)
07-28 13:47:37.220: D/VideoView(2313): Error: 100,0
07-28 13:47:37.300: D/AndroidRuntime(2313): Shutting down VM
07-28 13:47:37.300: W/dalvikvm(2313): threadid=1: thread exiting with uncaught exception (group=0x418e22a0)
07-28 13:47:37.330: E/AndroidRuntime(2313): FATAL EXCEPTION: main
07-28 13:47:37.330: E/AndroidRuntime(2313): Process: com.XXX.XXX, PID: 2313
07-28 13:47:37.330: E/AndroidRuntime(2313): java.lang.RuntimeException: Adding window failed
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.view.ViewRootImpl.setView(ViewRootImpl.java:516)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:259)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.app.Dialog.show(Dialog.java:286)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.app.AlertDialog$Builder.show(AlertDialog.java:951)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.widget.VideoView$5.onError(VideoView.java:515)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:2248)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.os.Handler.dispatchMessage(Handler.java:102)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.os.Looper.loop(Looper.java:136)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.app.ActivityThread.main(ActivityThread.java:5017)
07-28 13:47:37.330: E/AndroidRuntime(2313): at java.lang.reflect.Method.invokeNative(Native Method)
07-28 13:47:37.330: E/AndroidRuntime(2313): at java.lang.reflect.Method.invoke(Method.java:515)
07-28 13:47:37.330: E/AndroidRuntime(2313): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
07-28 13:47:37.330: E/AndroidRuntime(2313): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
07-28 13:47:37.330: E/AndroidRuntime(2313): at dalvik.system.NativeStart.main(Native Method)
07-28 13:47:37.330: E/AndroidRuntime(2313): Caused by: android.os.DeadObjectException
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.os.BinderProxy.transact(Native Method)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.view.IWindowSession$Stub$Proxy.addToDisplay(IWindowSession.java:721)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.view.ViewRootImpl.setView(ViewRootImpl.java:505)
07-28 13:47:37.330: E/AndroidRuntime(2313): ... 14 more
07-28 13:47:37.330: I/Process(2313): Sending signal. PID: 2313 SIG: 9
07-28 13:47:37.330: E/AndroidRuntime(2313): Error reporting crash
07-28 13:47:37.330: E/AndroidRuntime(2313): android.os.DeadObjectException
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.os.BinderProxy.transact(Native Method)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerNative.java:3703)
07-28 13:47:37.330: E/AndroidRuntime(2313): at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:84)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.runtime.UncaughtExceptionHandler.n_uncaughtException(Native Method)
07-28 13:47:37.330: E/AndroidRuntime(2313): at android.runtime.UncaughtExceptionHandler.uncaughtException(UncaughtExceptionHandler.java:37)
07-28 13:47:37.330: E/AndroidRuntime(2313): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
07-28 13:47:37.330: E/AndroidRuntime(2313): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
07-28 13:47:37.330: E/AndroidRuntime(2313): at dalvik.system.NativeStart.main(Native Method)
I have a lot of users reporting this crash to the play console. I tested it and it only appears sometimes. The crash occurs in this exact line that I have in the ParseApplication class, which extends the Application class and which should be called before everything else no?
This is the line where it crashes:
Parse.initialize(this, "XXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXX");
This is the crash
java.lang.RuntimeException: Unable to create application com.hour.chat.ParseApplication: java.util.ConcurrentModificationException
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4411)
at android.app.ActivityThread.access$1500(ActivityThread.java:145)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1266)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5081)
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:781)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.util.ConcurrentModificationException
at java.util.LinkedList$LinkIterator.next(LinkedList.java:124)
at com.parse.ParseObject.mergeREST(ParseObject.java:928)
at com.parse.ParseUser.mergeREST(ParseUser.java:285)
at com.parse.OfflineStore$13$2.then(OfflineStore.java:765)
at com.parse.OfflineStore$13$2.then(OfflineStore.java:762)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.continueWith(Task.java:318)
at com.parse.Task.continueWith(Task.java:329)
at com.parse.Task$8.then(Task.java:381)
at com.parse.Task$8.then(Task.java:373)
at com.parse.Task$11.run(Task.java:481)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.continueWithTask(Task.java:353)
at com.parse.Task.onSuccess(Task.java:373)
at com.parse.Task.onSuccess(Task.java:393)
at com.parse.OfflineStore$13.then(OfflineStore.java:762)
at com.parse.OfflineStore$13.then(OfflineStore.java:721)
at com.parse.Task$11.run(Task.java:481)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.continueWithTask(Task.java:353)
at com.parse.Task.continueWithTask(Task.java:364)
at com.parse.Task$9.then(Task.java:410)
at com.parse.Task$9.then(Task.java:402)
at com.parse.Task$11.run(Task.java:481)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.access$400(Task.java:22)
at com.parse.Task$7.then(Task.java:346)
at com.parse.Task$7.then(Task.java:343)
at com.parse.Task.runContinuations(Task.java:510)
at com.parse.Task.access$800(Task.java:22)
at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
at com.parse.Task$11$1.then(Task.java:493)
at com.parse.Task$11$1.then(Task.java:485)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.continueWith(Task.java:318)
at com.parse.Task.continueWith(Task.java:329)
at com.parse.Task$11.run(Task.java:485)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeAfterTask(Task.java:477)
at com.parse.Task.access$400(Task.java:22)
at com.parse.Task$7.then(Task.java:346)
at com.parse.Task$7.then(Task.java:343)
at com.parse.Task.runContinuations(Task.java:510)
at com.parse.Task.access$800(Task.java:22)
at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
at com.parse.Task$11$1.then(Task.java:493)
at com.parse.Task$11$1.then(Task.java:485)
at com.parse.Task$10.run(Task.java:448)
at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
at com.parse.Task.completeImmediately(Task.java:444)
at com.parse.Task.continueWith(Task.java:318)
at com.parse.Task.continueWith(Task.java:329)
at com.parse.Task$11.run(Task.java:485)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Since this thread is 4 months old lets update some stuff first;
1)Update to the lastest SDK you can do this at Parse
2) Make sure you have correctly initialized your keys at Application level once you have the SDK in your project like this:
public class YourAppName extends Application {
#Override
public void onCreate() {
super.onCreate();
Parse.initialize(this, "KEY_1", "KEY_2);
}
}
3)Make sure you have this defined in your AndroidManifest.xml like this:
<application
android:name=".YourAppName" <!--This is the important part-->
android:allowBackup="true"
android:icon="#drawable/launcher_icon"
android:label="#string/app_name"
android:theme="#style/Theme.MyTheme">
...
Hope it resolves your problem.
It's simple, when you use parse for the first time on your mobile it works like a charm.
When you reinstall your application, it screws everything.
As stated on stackoverflow by Eran:
"PushService.subscribe seems to cache the subscription in local storage, to avoid re-subscribing when you launch the app multiple times.
This is what the first parameter of that method is used for :
context - This is used to access local storage to cache the subscription, so it must currently be a viable context.
(quote from here).
However, when you uninstall the app, local storage for that app is wiped from your device, so the new installation will cause PushService.subscribe to re-register to Google Cloud Messaging. If the new registration returns a new registration ID, Parse would have two registration IDs that can be used to send push notifications to your app, and both of them would be linked to the same userName you supplied to subscribe. Therefore sending a notification to that userName will send it to both registration IDs, causing it to arrive twice.
When Parse send the notifications for you, they should get from Google a response with canonical_registration_id, which will let them know one of the registration IDs associated with your app on your device is old, and should not be used anymore. Therefore (assuming Parse have a decent implementation of GCM) the next time you send a notification to your device, you should receive it only once."
Here is my source code for the installation:
String androidId = Secure.getString(getApplicationContext().getContentResolver(),Secure.ANDROID_ID);
Parse.initialize(this, "KEY1", "KEY2");
PushService.setDefaultPushCallback(this, ParseActivity.class);
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.put("UniqueId",androidId);
installation.setObjectId(null);
installation.saveInBackground();
My stacktrace (like everyones):
05-20 19:47:35.630: E/ParseCommandCache(6497): com.parse.ParseException: at least one ID field (installationId,deviceToken) must be specified in this operation
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.ParseCommand.onPostExecute(ParseCommand.java:334)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.ParseRequest$5.then(ParseRequest.java:321)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.ParseRequest$5.then(ParseRequest.java:318)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11.run(Task.java:481)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.completeAfterTask(Task.java:477)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.continueWithTask(Task.java:353)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.continueWithTask(Task.java:364)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$9.then(Task.java:410)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$9.then(Task.java:402)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11.run(Task.java:481)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.completeAfterTask(Task.java:477)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.access$400(Task.java:22)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$7.then(Task.java:346)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$7.then(Task.java:343)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.runContinuations(Task.java:510)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.access$800(Task.java:22)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11$1.then(Task.java:493)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11$1.then(Task.java:485)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$10.run(Task.java:448)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.completeImmediately(Task.java:444)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.access$300(Task.java:22)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$6.then(Task.java:311)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$6.then(Task.java:308)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.runContinuations(Task.java:510)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.access$800(Task.java:22)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11$1.then(Task.java:493)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11$1.then(Task.java:485)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$10.run(Task.java:448)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.completeImmediately(Task.java:444)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.access$300(Task.java:22)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$6.then(Task.java:311)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$6.then(Task.java:308)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.runContinuations(Task.java:510)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.access$800(Task.java:22)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11$1.then(Task.java:493)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11$1.then(Task.java:485)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$10.run(Task.java:448)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.completeImmediately(Task.java:444)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.continueWith(Task.java:318)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.continueWith(Task.java:329)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11.run(Task.java:485)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.completeAfterTask(Task.java:477)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.access$400(Task.java:22)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$7.then(Task.java:346)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$7.then(Task.java:343)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.runContinuations(Task.java:510)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.access$800(Task.java:22)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$TaskCompletionSource.trySetResult(Task.java:565)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$TaskCompletionSource.setResult(Task.java:599)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11$1.then(Task.java:493)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11$1.then(Task.java:485)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$10.run(Task.java:448)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.completeImmediately(Task.java:444)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.continueWith(Task.java:318)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task.continueWith(Task.java:329)
05-20 19:47:35.630: E/ParseCommandCache(6497): at com.parse.Task$11.run(Task.java:485)
05-20 19:47:35.630: E/ParseCommandCache(6497): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
05-20 19:47:35.630: E/ParseCommandCache(6497): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
05-20 19:47:35.630: E/ParseCommandCache(6497): at java.lang.Thread.run(Thread.java:841)
05-20 19:48:32.615: D/Request(6497): Warning: Sessionless Request needs token but missing either application ID or client token.
Since I've not found any real solution, I'm asking here.
Thanks.
I'm definitely convinced that this is caused by a parse bug. Same thing is said by a lot of unresolved bug reports I found at Parse.com.
I'm currently working with Parse 1.5.1:
The thing that I've seen is that without deviceToken the push aren't sent, and without the uniqueId we get the runtime error here above.
If I send the UniqueId immediately after the registration, a row without deviceToken is saved.
The solution for me, tested on Nexus 5, Nexus 4 and Sony xperia E:
In your Application class onCreate()
Parse.initialize(this, PARSE_APP_KEY_VALUE, PARSE_CLIENT_KEY_VALUE);
PushService.setDefaultPushCallback(getApplicationContext(), MainActivity.class);
final ParseInstallation installation = ParseInstallation.getCurrentInstallation();
final String androidId = Settings.Secure.getString(getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID);
// Post the uniqueId delayed
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
#Override
public void run() {
installation.put("UniqueId", androidId);
installation.saveInBackground(new SaveCallback() {
#Override
public void done(ParseException e) {
// Saved!
}
});
}
}, 10000
);
Working this way, I'm able to save correct rows (with uniqueId and deviceToken), and to send push notification! Cheers!
I was also facing this issue. I sort of solved it by calling the below method in my Activity's onCreate()
/**
* Initialize Push Messaging Service and subscribe to all-users channel
*/
private void initParsePushMessaging() {
ParseInstallation parseInstallation = ParseInstallation
.getCurrentInstallation();
//You might skip this if
if (ParseUser.getCurrentUser() != null) {
parseInstallation.put("user",
ParseUser.getCurrentUser());
}
if (parseInstallation.getObjectId() != null)
parseInstallation.saveInBackground(new SaveCallback() {
#Override
public void done(ParseException e) {
PushService.subscribe(getApplicationContext(),"channel_name",
MainHomeActivity.class);
}
});
}
Even though it didn't completely solve my problem but now my app doesn't hang and no more ANR's due to this Parse implementation. If i re install an app and run it now then the app creates a new installation record and remove's the last one. The only problem is that the channel_name is not subscribed on this run but on the next run the channel are successfully subscribed.
What worked for me to get rid of this exception was using saveEventually() instead of saveInBackground().
Here you have a link to my answer to a similar question.
I think that saveEventually() is a better option because it assures that the installation will always be saved, regardless of the netwwork availability. In contrast, with saveInBackground() there is a chance that the save fails due to no network connectivity. Also with saveEventually() you don't need to do any error checking, which you should do in a SaveCallback() with saveInBackground().
Had the exact same problem. I solved it by going to settings on my phone -> Apps -> your application name -> Force shutdown -> Uninstall.
Then in Android studio I went -> File -> Invalidate Caches / Restart -> Wait for the gradle to build again and then run the Application on my phone. Worked like a charm.
I started having this error when I enabled the Local Datastore. I don't know how to fix it. I'm looking at documentation, but have found nothing so far... the app doesn't crash, but nothing can be saved to the user object, apparently most of the time.
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): Failed to run command.
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): com.parse.ParseException: Parse::UserCannotBeAlteredWithoutSessionError
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.ParseCommand.onPostExecute(ParseCommand.java:334)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.ParseRequest$5.then(ParseRequest.java:321)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.ParseRequest$5.then(ParseRequest.java:318)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task$11.run(Task.java:481)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task.completeAfterTask(Task.java:477)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task.continueWithTask(Task.java:353)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task.continueWithTask(Task.java:364)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task$9.then(Task.java:410)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task$9.then(Task.java:402)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task$11.run(Task.java:481)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task$ImmediateExecutor.execute(Task.java:673)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task.completeAfterTask(Task.java:477)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task.access$400(Task.java:22)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task$7.then(Task.java:346)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task$7.then(Task.java:343)
05-03 02:17:24.350: E/ParsePinningEventuallyQueue(1110): at com.parse.Task.runContinuations(Task.java:510)
I managed to point out the code which produces the error. It has to do with using saveEventually() in the current user... it doesn't happen using saveinbackground()...
ParseUser cu = ParseUser.getCurrentUser();
if (cu != null) {
String locale = getResources().getConfiguration().locale.getDisplayName();
cu.put("locale", locale);
cu.put("version", ParseInstallation.getCurrentInstallation().getString("appVersion"));
cu.saveEventually(); //doesn't happen with cu.saveInBackground();
}
Parse Android Changelog
v1.5.1 — May 30, 2014
Fixed various bugs with Local
Datastore.
There were indeed some bugs with the last Parse Android SDK v1.5.0, but for me they got fixed with today's release of the version 1.5.1, you should check it out and try again.
I'm using solution of Scroll webview horizontally inside a ViewPager
it's looks very useful, I was reference ExtendedWebView in xml,
<ExtendedWebView
android:id="#+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
instance ExtendedWebView in .class,
LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
layout = mInflater.inflate(R.layout.lay1, null);
ExtendedWebView webView = (ExtendedWebView)layout.findViewById(R.id.webview);
but i got 'Error inflating class ExtendedWebView', so could anybody to help me to give me some ideas, thanks for your time and experience!
heres are entire stack trace,
12-27 22:14:44.263: E/AndroidRuntime(10824): FATAL EXCEPTION: main
12-27 22:14:44.263: E/AndroidRuntime(10824): android.view.InflateException: Binary XML file line #7: Error inflating class com.vv_package_name.ExtendedWebView
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
12-27 22:14:44.263: E/AndroidRuntime(10824): at com.vv_package_name.vv_main$ExtendedPagerAdapter.instantiateItem(vv_main.java:135)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.support.v4.view.PagerAdapter.instantiateItem(PagerAdapter.java:110)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:801)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.support.v4.view.ViewPager.populate(ViewPager.java:930)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.support.v4.view.ViewPager.populate(ViewPager.java:881)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1366)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.View.measure(View.java:8226)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.View.measure(View.java:8226)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.View.measure(View.java:8226)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.View.measure(View.java:8226)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.View.measure(View.java:8226)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.ViewRoot.performTraversals(ViewRoot.java:801)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.os.Handler.dispatchMessage(Handler.java:99)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.os.Looper.loop(Looper.java:123)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-27 22:14:44.263: E/AndroidRuntime(10824): at java.lang.reflect.Method.invokeNative(Native Method)
12-27 22:14:44.263: E/AndroidRuntime(10824): at java.lang.reflect.Method.invoke(Method.java:521)
12-27 22:14:44.263: E/AndroidRuntime(10824): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
12-27 22:14:44.263: E/AndroidRuntime(10824): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
12-27 22:14:44.263: E/AndroidRuntime(10824): at dalvik.system.NativeStart.main(Native Method)
12-27 22:14:44.263: E/AndroidRuntime(10824): Caused by: java.lang.ClassNotFoundException: com.vv_package_name.ExtendedWebView in loader dalvik.system.PathClassLoader[/data/app/com.vv_package_name-2.apk]
12-27 22:14:44.263: E/AndroidRuntime(10824): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
12-27 22:14:44.263: E/AndroidRuntime(10824): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
12-27 22:14:44.263: E/AndroidRuntime(10824): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
12-27 22:14:44.263: E/AndroidRuntime(10824): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
12-27 22:14:44.263: E/AndroidRuntime(10824): ... 33 more
if using WebView instead of ExtendedWebView, my code is working fine :)
You need to provide a full reference to the class, including the package.
For instance,
<org.example.myapp.ExtendedWebView
android:id="#+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
sorry i'm a noob, it's my problem, i put these extend webview code in main Activity class in one .class file...it should be save with a standalone .class file...:)
public class ExtendedWebView extends WebView {
Solved for me by using this in my XML:
<view
class="com.example.MainActivity$MyWebView"
android:id="#+id/web_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>