Incompatibility with 1.6?

133 views
Skip to first unread message

Máté Rémiás

unread,
Dec 27, 2011, 4:29:19 PM12/27/11
to actionba...@googlegroups.com
Hi,

I see bug reports like this

0java.lang.VerifyError: android.support.v4.app.FragmentActivity
1at java.lang.Class.newInstanceImpl(Native Method)
2at java.lang.Class.newInstance(Class.java:1472)
3at android.app.Instrumentation.newActivity(Instrumentation.java:1097)
4at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
5at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
6at android.app.ActivityThread.access$2100(ActivityThread.java:116)
7at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
8at android.os.Handler.dispatchMessage(Handler.java:99)
9at android.os.Looper.loop(Looper.java:123)
10at android.app.ActivityThread.main(ActivityThread.java:4203)
11at java.lang.reflect.Method.invokeNative(Native Method)
12at java.lang.reflect.Method.invoke(Method.java:521)
13at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
14at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
15at dalvik.system.NativeStart.main(Native Method)

only from 1.6 users with ABS v3.5. does anyone have an idea what this could be?

Jake Wharton

unread,
Dec 27, 2011, 10:24:58 PM12/27/11
to actionba...@googlegroups.com
You need the few lines above that exception to see exactly what the problem is. Basically you're referencing a method or class that doesn't exist on API 4. This shouldn't be caused by ABS specifically as far as I know all its references to newer methods are wrapped in static classes (which are lazily loaded).

Fire up a 1.6 emulator and visit the problem activity and you should get the error right away. Pay attention to the four or so lines that come before the exception to find out exactly what caused the VerifyError.

---
Jake Wharton
http://about.me/jakewharton

Máté Rémiás

unread,
Jan 1, 2012, 1:42:58 PM1/1/12
to actionba...@googlegroups.com
actually this happens when the activity gets created, so I cannot debug it as it is. maybe I'll just drop 1.6 compatibility...

Fabien

unread,
Jan 1, 2012, 5:07:21 PM1/1/12
to actionba...@googlegroups.com
I have the same problem when I launch my application on a 1.6 Android emulator :

01-01 22:06:49.840: E/AndroidRuntime(216): Uncaught handler: thread
main exiting due to uncaught exception
01-01 22:06:49.870: E/AndroidRuntime(216): java.lang.VerifyError:
android.support.v4.app.FragmentActivity
01-01 22:06:49.870: E/AndroidRuntime(216): at
java.lang.Class.newInstanceImpl(Native Method)
01-01 22:06:49.870: E/AndroidRuntime(216): at
java.lang.Class.newInstance(Class.java:1472)
01-01 22:06:49.870: E/AndroidRuntime(216): at
android.app.Instrumentation.newActivity(Instrumentation.java:1097)
01-01 22:06:49.870: E/AndroidRuntime(216): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
01-01 22:06:49.870: E/AndroidRuntime(216): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
01-01 22:06:49.870: E/AndroidRuntime(216): at
android.app.ActivityThread.access$2100(ActivityThread.java:116)
01-01 22:06:49.870: E/AndroidRuntime(216): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
01-01 22:06:49.870: E/AndroidRuntime(216): at
android.os.Handler.dispatchMessage(Handler.java:99)
01-01 22:06:49.870: E/AndroidRuntime(216): at
android.os.Looper.loop(Looper.java:123)
01-01 22:06:49.870: E/AndroidRuntime(216): at
android.app.ActivityThread.main(ActivityThread.java:4203)
01-01 22:06:49.870: E/AndroidRuntime(216): at
java.lang.reflect.Method.invokeNative(Native Method)
01-01 22:06:49.870: E/AndroidRuntime(216): at
java.lang.reflect.Method.invoke(Method.java:521)
01-01 22:06:49.870: E/AndroidRuntime(216): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
01-01 22:06:49.870: E/AndroidRuntime(216): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
01-01 22:06:49.870: E/AndroidRuntime(216): at
dalvik.system.NativeStart.main(Native Method)

Jake Wharton

unread,
Jan 1, 2012, 10:43:03 PM1/1/12
to actionba...@googlegroups.com
Two of these have been corrected on the dev branch on GitHub. I have one or two unrelated things to fix before I release 3.5.1.

Again, I need the lines that occur above the actual exception which tell you exactly what the VerifyError was caused by in order to fix it. I'll try testing a few demos on the 1.6 emulator regardless and see what turns up.

Fabien

unread,
Jan 2, 2012, 2:57:31 AM1/2/12
to actionba...@googlegroups.com
You are right, there is a previous exception (hasFeature not found) :

01-02 07:56:10.180: E/dalvikvm(248): Could not find method
android.view.Window.hasFeature, referenced from method
android.support.v4.app.FragmentActivity.hasFeature
01-02 07:56:10.180: W/dalvikvm(248): VFY: unable to resolve virtual
method 2537: Landroid/view/Window;.hasFeature (I)Z
01-02 07:56:10.180: W/dalvikvm(248): VFY: rejecting opcode 0x6e at 0x000a
01-02 07:56:10.180: W/dalvikvm(248): VFY: rejected
Landroid/support/v4/app/FragmentActivity;.hasFeature (J)Z
01-02 07:56:10.180: W/dalvikvm(248): Verifier rejected class
Landroid/support/v4/app/FragmentActivity;
01-02 07:56:10.189: W/dalvikvm(248): Class init failed in newInstance
call (Lcom/mypackage/activity/MainActivity;)
01-02 07:56:10.189: D/AndroidRuntime(248): Shutting down VM
01-02 07:56:10.189: W/dalvikvm(248): threadid=3: thread exiting with
uncaught exception (group=0x4001aa28)
01-02 07:56:10.189: E/AndroidRuntime(248): Uncaught handler: thread


main exiting due to uncaught exception

01-02 07:56:10.200: E/AndroidRuntime(248): java.lang.VerifyError:
android.support.v4.app.FragmentActivity
01-02 07:56:10.200: E/AndroidRuntime(248): at
java.lang.Class.newInstanceImpl(Native Method)
01-02 07:56:10.200: E/AndroidRuntime(248): at
java.lang.Class.newInstance(Class.java:1472)
01-02 07:56:10.200: E/AndroidRuntime(248): at
android.app.Instrumentation.newActivity(Instrumentation.java:1097)
01-02 07:56:10.200: E/AndroidRuntime(248): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
01-02 07:56:10.200: E/AndroidRuntime(248): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
01-02 07:56:10.200: E/AndroidRuntime(248): at
android.app.ActivityThread.access$2100(ActivityThread.java:116)
01-02 07:56:10.200: E/AndroidRuntime(248): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
01-02 07:56:10.200: E/AndroidRuntime(248): at
android.os.Handler.dispatchMessage(Handler.java:99)
01-02 07:56:10.200: E/AndroidRuntime(248): at
android.os.Looper.loop(Looper.java:123)
01-02 07:56:10.200: E/AndroidRuntime(248): at
android.app.ActivityThread.main(ActivityThread.java:4203)
01-02 07:56:10.200: E/AndroidRuntime(248): at
java.lang.reflect.Method.invokeNative(Native Method)
01-02 07:56:10.200: E/AndroidRuntime(248): at
java.lang.reflect.Method.invoke(Method.java:521)
01-02 07:56:10.200: E/AndroidRuntime(248): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
01-02 07:56:10.200: E/AndroidRuntime(248): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
01-02 07:56:10.200: E/AndroidRuntime(248): at
dalvik.system.NativeStart.main(Native Method)
01-02 07:56:10.200: I/dalvikvm(248): threadid=7: reacting to signal 3
01-02 07:56:10.240: I/dalvikvm(248): Wrote stack trace to '/data/anr/traces.txt'

Jake Wharton

unread,
Jan 2, 2012, 3:12:39 AM1/2/12
to actionba...@googlegroups.com
Ok great. That's one of the ones that I have fixed. I should be releasing v3.5.1 tomorrow which will fix this. If you're desperate you can just download the dev branch from GitHub and use it.

Fabien

unread,
Jan 2, 2012, 3:18:33 AM1/2/12
to actionba...@googlegroups.com

Thank you Jake. I'll wait ;).

Máté Rémiás

unread,
Jan 2, 2012, 6:46:53 PM1/2/12
to actionba...@googlegroups.com
thanks, I can wait too :)

Fabien

unread,
Jan 4, 2012, 2:53:26 AM1/4/12
to actionba...@googlegroups.com
3.5.1 : it works on Android 1.6. Thank you !
Reply all
Reply to author
Forward
0 new messages