Obsolete
Status Update
Comments
gi...@gmail.com <gi...@gmail.com> #2
The debugger always highlights the last line with code on it before returning from a method. It doesn't actually execute the "return -1" in that case, even though it appears to do so. Check the return value you get from the method.
de...@gmail.com <de...@gmail.com> #3
what does Eclipse do if you debug the same code running on Sun's JVM?
ar...@gmail.com <ar...@gmail.com> #4
If I try debug the same code in eclipse like normal Java application on Sun's JVM everything is OK, it work as I expect, problem is only if I debug android application.
de...@gmail.com <de...@gmail.com> #5
yeah, if i run this on the RI i don't see the apparent step to "return -1" but on dalvik i do. looking at the dex file, it's obvious that dx has done this to us by compiling all three returns into one (instruction 0x7):
0001f4: |[0001f4] HelloWorld.f:()I
000204: 1211 |0000: const/4 v1, #int 1 // #1
000206: 3a01 0900 |0001: if-ltz v1, 000a // +0009
00020a: 1300 0a00 |0003: const/16 v0, #int 10 // #a
00020e: 3d00 0300 |0005: if-lez v0, 0008 // +0003
000212: 0f00 |0007: return v0
000214: 1200 |0008: const/4 v0, #int 0 // #0
000216: 28fe |0009: goto 0007 // -0002
000218: 12f0 |000a: const/4 v0, #int -1 // #ff
00021a: 28fc |000b: goto 0007 // -0004
catches : (none)
positions :
0x0000 line=8
0x0001 line=10
0x0003 line=11
0x0005 line=12
0x0007 line=18
0x0008 line=15
0x000a line=18
locals :
0x0005 - 0x0007 reg=0 count I
0x0008 - 0x000a reg=0 count I
0x0001 - 0x000c reg=1 row I
i'd guess the debug information for that instruction gets overwritten each time we compile a return, leaving us reporting the final return to the debugger. this is shit, and should be fixed, but sadly this isn't something i can fix in jdwp.
0001f4: |[0001f4] HelloWorld.f:()I
000204: 1211 |0000: const/4 v1, #int 1 // #1
000206: 3a01 0900 |0001: if-ltz v1, 000a // +0009
00020a: 1300 0a00 |0003: const/16 v0, #int 10 // #a
00020e: 3d00 0300 |0005: if-lez v0, 0008 // +0003
000212: 0f00 |0007: return v0
000214: 1200 |0008: const/4 v0, #int 0 // #0
000216: 28fe |0009: goto 0007 // -0002
000218: 12f0 |000a: const/4 v0, #int -1 // #ff
00021a: 28fc |000b: goto 0007 // -0004
catches : (none)
positions :
0x0000 line=8
0x0001 line=10
0x0003 line=11
0x0005 line=12
0x0007 line=18
0x0008 line=15
0x000a line=18
locals :
0x0005 - 0x0007 reg=0 count I
0x0008 - 0x000a reg=0 count I
0x0001 - 0x000c reg=1 row I
i'd guess the debug information for that instruction gets overwritten each time we compile a return, leaving us reporting the final return to the debugger. this is shit, and should be fixed, but sadly this isn't something i can fix in jdwp.
op...@gmail.com <op...@gmail.com> #6
i've raised internal bug 36949180 for this.
la...@gmail.com <la...@gmail.com> #7
I got about 40 crashes over the weekend, all from Android 4.0.4. There were no crashes before that. It started November 26, 2014. I'm using AdMob.
java.lang.NoClassDefFoundError: android/os/AsyncTask
at android.webkit.WebView.setupPackageListener(WebView.java:1311)
at android.webkit.WebView.access$10600(WebView.java:354)
at android.webkit.WebView$PrivateHandler.handleMessage(WebView.java:10144)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4945)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
java.lang.NoClassDefFoundError: android/os/AsyncTask
at android.webkit.WebView.setupPackageListener(WebView.java:1311)
at android.webkit.WebView.access$10600(WebView.java:354)
at android.webkit.WebView$PrivateHandler.handleMessage(WebView.java:10144)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4945)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
1g...@gmail.com <1g...@gmail.com> #8
Does the bug also occur in Android Studio?
When will the bug be fixed??
When will the bug be fixed??
de...@gmail.com <de...@gmail.com> #9
dx still has this bug, but its replacement jack does not:
http://tools.android.com/tech-docs/jackandjill
as work on dx is effectively stopped, marking this obsolete.
as work on dx is effectively stopped, marking this obsolete.
in...@gmail.com <in...@gmail.com> #10
[Comment deleted]
op...@gmail.com <op...@gmail.com> #11
Just run into this issue today,
Tested it with Jack -> does not happen
since :
"The Jack toolchain is deprecated,"
https://developer.android.com/guide/platform/j8-jack.html
https://android-developers.googleblog.com/2017/03/future-of-java-8-language-feature.html
I cannot trust my tools now :(
will it be fixed?
Tested it with Jack -> does not happen
since :
"The Jack toolchain is deprecated,"
I cannot trust my tools now :(
will it be fixed?
mo...@gmail.com <mo...@gmail.com> #12
op...@gmail.com <op...@gmail.com> #13
It is very funny. Because of this issue is closed I created new one, which was closed like duplication of another one, which was closed as duplication of this one. Circle is finished :-(
I hope that somebody still working on it.
I hope that somebody still working on it.
1g...@gmail.com <1g...@gmail.com> #14
Tomáš is correct to highlight a silly circularity here; Jack is no longer the replacement so this seems like it should still be valid.
in...@gmail.com <in...@gmail.com> #15
This has been fixed in the new Dexer of which we announced preview availability today: https://android-developers.googleblog.com/2017/08/next-generation-dex-compiler-now-in.html
Please give D8 a try and let us know your experience!
Please give D8 a try and let us know your experience!
mo...@gmail.com <mo...@gmail.com> #16
I tried to use D8 and the problem with debugger is really fixed.
I tried to use it also for one beta release of my app, I have just 200 beta testers
And one of them wrote me that he is not able to install this build.
He has Lenovo device with non oficial Cyanogen ROM:
Device: P70
romInfo: cm_P70-userdebug 5.1.1 LMY49J fd77b65ea8 test-keys
romFingerprint: Lenovo/cm_P70/P70:5.1.1/LMY49J/fd77b65ea8:userdebug/test-keys
So probably not a big deal, but I will just for sure wait before bigger release of this new D8.
I tried to use it also for one beta release of my app, I have just 200 beta testers
And one of them wrote me that he is not able to install this build.
He has Lenovo device with non oficial Cyanogen ROM:
Device: P70
romInfo: cm_P70-userdebug 5.1.1 LMY49J fd77b65ea8 test-keys
romFingerprint: Lenovo/cm_P70/P70:5.1.1/LMY49J/fd77b65ea8:userdebug/test-keys
So probably not a big deal, but I will just for sure wait before bigger release of this new D8.
in...@gmail.com <in...@gmail.com> #17
mo...@gmail.com <mo...@gmail.com> #18
Yes, it was also error 504 during installing from Play
mo...@gmail.com <mo...@gmail.com> #19
I didn't implement workaround as described here. I didn't notice the call Class.forName("android.os.AsyncTask") must be into APPLICATION onCreate() and not in every Activity onCreate() as I did.
I will try again. I hope it works.
I will try again. I hope it works.
in...@gmail.com <in...@gmail.com> #20
Thanks monachil...@gmail.com
I update Google Play SDK up to rev.21 and added workaround into Application#onCreate()
After day I have no warning about error on devices under android 2.3.X
I update Google Play SDK up to rev.21 and added workaround into Application#onCreate()
After day I have no warning about error on devices under android 2.3.X
mo...@gmail.com <mo...@gmail.com> #21
Same for me. No errors today, I think it's solved.
Thank you all!
Thank you all!
qq...@gmail.com <qq...@gmail.com> #22
[Comment deleted]
qq...@gmail.com <qq...@gmail.com> #23
[Comment deleted]
qq...@gmail.com <qq...@gmail.com> #24
[Comment deleted]
qq...@gmail.com <qq...@gmail.com> #25
Still got the error though I use it in handler and send message onStart, I think the best workaround is to paste AsyncTask in project.(Maybe ModernAsyncTask is better than AsyncTask? ModernAsyncTask is able to Solve the concurrent problem at the same time?)
private Handler handler = new Handler() {
public void handleMessage(Message msg) {
switch (msg.what) {
case HANDLE_UPDATE:
updateTask = new UpdateTask();
updateTask.execute();
break;
default:
break;
}
}
};
public void onStart() {
super.onStart();
Message msg = handler.obtainMessage(HANDLE_UPDATE);
handler.sendMessage(msg);
}
private class UpdateTask extends AsyncTask<Void, Void, Void> {
protected Void doInBackground(Void... params) {
updateData();
return null;
}
protected void onPostExecute(Void result) {
updateUi();
}
}
private Handler handler = new Handler() {
public void handleMessage(Message msg) {
switch (msg.what) {
case HANDLE_UPDATE:
updateTask = new UpdateTask();
updateTask.execute();
break;
default:
break;
}
}
};
public void onStart() {
super.onStart();
Message msg = handler.obtainMessage(HANDLE_UPDATE);
handler.sendMessage(msg);
}
private class UpdateTask extends AsyncTask<Void, Void, Void> {
protected Void doInBackground(Void... params) {
updateData();
return null;
}
protected void onPostExecute(Void result) {
updateUi();
}
}
do...@gmail.com <do...@gmail.com> #26
Same for me
jj...@gmail.com <jj...@gmail.com> #27
We received a bugreport with this problem earlier today. The user mentioned using a Samsung Galaxy Ace (old budget phone with ultra-low specs) and as we happened to have one of those available managed to reproduce the crash.
Rather than just adding adding
private void FixNoClassDefFoundError81083() {
try {
Class.forName("android.os.AsyncTask");
}
catch(Throwable ignore) {}
}
to Application.onCreate() as a workaround and crossing fingers until the next feature I checked the log and found the two following lines:
W/GooglePlayServicesUtil? Google Play services out of date. Requires 6587000 but found 6111012
E/GooglePlayServicesUtil? GooglePlayServices not available due to error 2
The Galaxy Ace only has 190mb available for apps of which most is eaten up by pre-installed apps. After uninstalling all other apps and clearing the data of Google Play services (did someone say user-friendly?) I was finally able to update GPs which solved the crash problem without the dirty codefix posted above. Since we can't expect our users to empty their device of apps we've added the code as well. Spamming themhttp://developer.android.com/google/play-services/setup.html#ensure won't work if they lack the space to do so.
Most likely this bug only occured in the 6111012 version and has been fixed by now. Could someone confirm this?
Rather than just adding adding
private void FixNoClassDefFoundError81083() {
try {
Class.forName("android.os.AsyncTask");
}
catch(Throwable ignore) {}
}
to Application.onCreate() as a workaround and crossing fingers until the next feature I checked the log and found the two following lines:
W/GooglePlayServicesUtil? Google Play services out of date. Requires 6587000 but found 6111012
E/GooglePlayServicesUtil? GooglePlayServices not available due to error 2
The Galaxy Ace only has 190mb available for apps of which most is eaten up by pre-installed apps. After uninstalling all other apps and clearing the data of Google Play services (did someone say user-friendly?) I was finally able to update GPs which solved the crash problem without the dirty codefix posted above. Since we can't expect our users to empty their device of apps we've added the code as well. Spamming them
Most likely this bug only occured in the 6111012 version and has been fixed by now. Could someone confirm this?
qi...@gmail.com <qi...@gmail.com> #28
DEVICES
HTC_Desire_2 android 4.0.3
HTC One V android 4.0.3
HTC Desire 200 android 4.0.3
Fatal Exception: java.lang.NoClassDefFoundError
android/os/AsyncTask
java.lang.NoClassDefFoundError: android/os/AsyncTask
at android.webkit.WebView.setupPackageListener(WebView.java:1356)
at android.webkit.WebView.access$11000(WebView.java:365)
at android.webkit.WebView$PrivateHandler.handleMessage(WebView.java:10432)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:4987)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
HTC_Desire_2 android 4.0.3
HTC One V android 4.0.3
HTC Desire 200 android 4.0.3
Fatal Exception: java.lang.NoClassDefFoundError
android/os/AsyncTask
java.lang.NoClassDefFoundError: android/os/AsyncTask
at android.webkit.WebView.setupPackageListener(WebView.java:1356)
at android.webkit.WebView.access$11000(WebView.java:365)
at android.webkit.WebView$PrivateHandler.handleMessage(WebView.java:10432)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:4987)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
ve...@gmail.com <ve...@gmail.com> #29
Hi I have received an error which is mentioned below...
java.lang.NoClassDefFoundError: com.thetransactioncompany.jsonrpc2.JSONRPC2Request
at com.example.admin.serverjson.MainActivity.onCreate(MainActivity.java:27)
at android.app.Activity.performCreate(Activity.java:5933)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Please anyone help me for this error.Thanks in advance
java.lang.NoClassDefFoundError: com.thetransactioncompany.jsonrpc2.JSONRPC2Request
at com.example.admin.serverjson.MainActivity.onCreate(MainActivity.java:27)
at android.app.Activity.performCreate(Activity.java:5933)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Please anyone help me for this error.Thanks in advance
th...@gmail.com <th...@gmail.com> #30
I experienced the same sort of exception but that happened with the AsyncTaskLoader$Loader:
Fatal Exception: java.lang.NoClassDefFoundError: android.support.v4.content.AsyncTaskLoader$LoadTask
at android.support.v4.content.AsyncTaskLoader.onForceLoad(AsyncTaskLoader.java:113)
at android.support.v4.content.Loader.forceLoad(Loader.java:218)
at android.support.v4.content.CursorLoader.onStartLoading(CursorLoader.java:121)
at android.support.v4.content.Loader.startLoading(Loader.java:198)
at android.support.v4.app.LoaderManagerImpl$LoaderInfo.start(LoaderManager.java:265)
at android.support.v4.app.LoaderManagerImpl.installLoader(LoaderManager.java:513)
at android.support.v4.app.LoaderManagerImpl.createAndInstallLoader(LoaderManager.java:500)
at android.support.v4.app.LoaderManagerImpl.initLoader(LoaderManager.java:553)
If I use the same workaround (Class.forName), the problem will be gone.
Fatal Exception: java.lang.NoClassDefFoundError: android.support.v4.content.AsyncTaskLoader$LoadTask
at android.support.v4.content.AsyncTaskLoader.onForceLoad(AsyncTaskLoader.java:113)
at android.support.v4.content.Loader.forceLoad(Loader.java:218)
at android.support.v4.content.CursorLoader.onStartLoading(CursorLoader.java:121)
at android.support.v4.content.Loader.startLoading(Loader.java:198)
at android.support.v4.app.LoaderManagerImpl$LoaderInfo.start(LoaderManager.java:265)
at android.support.v4.app.LoaderManagerImpl.installLoader(LoaderManager.java:513)
at android.support.v4.app.LoaderManagerImpl.createAndInstallLoader(LoaderManager.java:500)
at android.support.v4.app.LoaderManagerImpl.initLoader(LoaderManager.java:553)
If I use the same workaround (Class.forName), the problem will be gone.
sa...@google.com <sa...@google.com> #31
Thank you for your feedback. We assure you that we are doing our best to address the issue reported, however our product team has shifted work priority that doesn't include this issue. For now, we will be closing the issue as won't fix obsolete. If this issue currently still exists, we request that you log a new issue along with latest bug report here https://goo.gl/TbMiIO .
ni...@gmail.com <ni...@gmail.com> #32
Having that issue in late 2022, no idea what to do
Description
The crash occurs only on API Level 10 devices (the app supports 9+)
The very same version of the app had been running fine over several weeks before the crashes started. This makes me think that the problem is caused by some over-the-air update that was pushed to Android 2.3 devices recently.
I use AdMob mediation (which is now part of the Google Play Services library) and several other ad network SDKs in my app.
I suspect the Google Play Services library to be causing the crash, as it is the only part of the app that, to my knowledge, is likely to be updated over-the-air (and this would not be the first time a buggy update causes crashes).
STACK:
java.lang.NoClassDefFoundError: com.myapp.MyClassExtendingAsyncTask
at com.myapp.x.run(SourceFile:417)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3859)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:647)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.myapp.MyClassExtendingAsyncTask in loader dalvik.system.PathClassLoader[/data/app/com.myapp-1.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
... 10 more