[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-28 Thread Denis Souza
> 0 (CONTENT_URI) in Landroid/provider/ContactsContract$CommonDataKinds$Phone; ContactsContract is an Android 2.0 class. It won't work on earlier versions. I have an app that uses the contacts API also and solve the problem with something like this: public abstract class ContactManager { public

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-21 Thread DanH
Probably true on Android, not universally true. Would fail on standard Java, like I said, if -Xfuture were specified. On Oct 21, 5:27 pm, fadden wrote: > On Oct 20, 11:10 am, DanH wrote: > > > The wrapper class example is defective if the verifier is > > "conventional" -- doesn't have the  swiz

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-21 Thread fadden
On Oct 20, 11:10 am, DanH wrote: > The wrapper class example is defective if the verifier is > "conventional" -- doesn't have the  swizzle you describe since 1.6. It works because the code does something like: if (version is 2.0 or later) use wrapped stuff else feature not available,

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-20 Thread DanH
(Though only, I suppose, if -Xfuture is specified/defaulted.) On Oct 20, 1:10 pm, DanH wrote: > The wrapper class example is defective if the verifier is > "conventional" -- doesn't have the  swizzle you describe since 1.6. > > On Oct 20, 12:53 pm, fadden wrote: > > > On Oct 19, 6:47 pm, DanH w

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-20 Thread DanH
The wrapper class example is defective if the verifier is "conventional" -- doesn't have the swizzle you describe since 1.6. On Oct 20, 12:53 pm, fadden wrote: > On Oct 19, 6:47 pm, DanH wrote: > > > Even if you never actually execute the code that's causing the > > problem, the verifier will r

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-20 Thread fadden
On Oct 19, 6:47 pm, DanH wrote: > Even if you never actually execute the code that's causing the > problem, the verifier will reject it, since it's doing a static check > and can't tell what code is or isn't executed. That's a pretty concise explanation of the difference between 1.6 and 2.0. In

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-19 Thread DanH
Like I said ... Even if you never actually execute the code that's causing the problem, the verifier will reject it, since it's doing a static check and can't tell what code is or isn't executed. If you want to include some code in your application that is optionally loaded (because it's not comp

Re: [android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-19 Thread Alex Xin
Thank you! Now I know where I can get those messages. 10-20 09:18:14.973: WARN/dalvikvm(210): VFY: unable to resolve static field 0 (CONTENT_URI) in Landroid/provider/ContactsContract$CommonDataKinds$Phone; 10-20 09:18:14.982: WARN/dalvikvm(210): VFY: rejecting opcode 0x62 at 0x0012 10-20 09:18:

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-19 Thread DanH
Right ***above*** the exception trace should be some arcane-looking messages with "VFY" in them. On Oct 19, 6:36 pm, Alex Xin wrote: > Hi, thanks for helping me, here's the logcat, you could see it crashes prior > to call my onCreate() method. > > 10-20 07:32:27.490: ERROR/AndroidRuntime(204): ja

Re: [android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-19 Thread Alex Xin
Hi, thanks for helping me, here's the logcat, you could see it crashes prior to call my onCreate() method. 10-20 07:32:27.490: ERROR/AndroidRuntime(204): java.lang.VerifyError: xcxin.mysecret.mainSecretActivity 10-20 07:32:27.490: ERROR/AndroidRuntime(204): at java.lang.Class.newInstanceImpl(N

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-19 Thread fadden
On Oct 19, 2:25 am, Alex Xin wrote: > I have an app that runs perfect on 2.2 and 2.2 but always getting > VerifyError on 1.6 while startup, I don't think that my app cannot run under > 1.6 because I don't call any APIs that don't support 1.6. Post the output from logcat. Right above the exceptio

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-19 Thread DanH
Keep in mind that there are also Java version dependencies and library dependencies. I don't know what Java versions may correspond to what Android versions, but you can't eg, compile with a Java 6 targeted javac and expect to run on a Java 5 JDK. And in some cases you can run into trouble if you

Re: [android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-19 Thread Tom Gibara
Yes. Temporarily changing the "Project Build Target" in the project's android properties (assuming you're using eclipse) should highlight any unexpected Java source incompatibilities. Tom. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To

Re: [android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-19 Thread Kostya Vasilyev
Unfortunately, setting minsdk version in the manifest doesn't cause any sort of validation against that platform version. So the OP's problem could easily be caused by him using an API that doesn't exist prior to 2.x -- Kostya 19.10.2010 16:29, Tom Gibara пишет: Actually, you should build a

Re: [android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-19 Thread Tom Gibara
Actually, you should build against a version of the platform that has all of the features that your application can use. This is often not the same as the earliest version on which it will run. Tom. -- You received this message because you are subscribed to the Google Groups "Android Developers"

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-19 Thread DanH
What did you compile against? You should always compile/build against the earliest version you hope to run on. On Oct 19, 4:25 am, Alex Xin wrote: > Hi, > > I have an app that runs perfect on 2.2 and 2.2 but always getting > VerifyError on 1.6 while startup, I don't think that my app cannot run