VFY: unable to resolve virtual method

前端 未结 3 940
囚心锁ツ
囚心锁ツ 2021-01-17 10:27

I am using Jackson in my android app.

I have added these two jars in my build-path:

jackson-core-asl-1.0.0.jar
jackson-mapper-asl-1.0.0.jar


        
相关标签:
3条回答
  • 2021-01-17 10:42

    In my case, this solution cannot work.
    Check the code format of jar file is fit as JDK 1.6,
    I found this issue via changing my lib code format from 1.7 to 1.6, and this issue would be solved.

    1. To add a external jar on eclipse for Android Project, we can do as this :
      . Project properties -> Java Build Path -> Libraries then add those External Jar file.
      . Project properties -> Java Build Path -> Order & Export then checked those External Jar file.
      You can clean & re-build the target project to see the apk file size and test those functions in external jar.

    2. To add a external jar on eclipse for Android Project, we can do as this :
      . copy the jar file to libs of android project, and done.

      For #1, it is easy to handle multi-projects for one libs.
      For #2, it is easy to use and no configure required.

      That's all.
    0 讨论(0)
  • 2021-01-17 10:45

    This can also happen if you have code calling methods that don't exist in the current device OS version.

    For example, if somewhere in your app you call Settings.Global.getFloat(String) - which was added in api 17 - and the current device is running api 15, you will see this warning in your logs.

    There will be a crash if you actually try to invoke this method. There is no problem if you don't call this method. So make sure you always check the current version before calling this.

        private float getAnimationSetting(ContentResolver contentResolver,
                                          String setting) throws Settings.SettingNotFoundException {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
                return getAnimationSettingJB(contentResolver, setting);
            } else {
                return getAnimationSettingLegacy(contentResolver, setting);
            }
        }
    
        private float getAnimationSettingLegacy(ContentResolver contentResolver,
                                                String setting) throws Settings.SettingNotFoundException {
            return Settings.System.getFloat(contentResolver, setting);
        }
    
        @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
        private float getAnimationSettingJB(ContentResolver contentResolver,
                                            String setting) throws Settings.SettingNotFoundException {
            return Settings.Global.getFloat(contentResolver, setting);
        }
    
    0 讨论(0)
  • 2021-01-17 11:04

    I had a similar problem; assuming you're using Eclipse, try the following:

    1. Right click on your project
    2. Go to Build Path > Configure Build Path...
    3. Click on the "Order and Export" tab
    4. Check the boxes next to your jars, then click OK
    5. Clean and Build your project, then see if it works.

    Hopefully that works.

    0 讨论(0)
提交回复
热议问题