Skip to content Skip to sidebar Skip to footer

How To Resolve This Error Vfy: Unable To Resolve Virtual Method

I am using android studio 2.0 and in last time I upgrade jdk 7 to jdk 8 and I'm making some changes to file gradle but now I am getting this error E/InstantRun: Could not find slic

Solution 1:

If you check in runtime the Android version you can safely ignore this warnings. It just means that you have a reference to a method which is not available on that platform where you code currently runs on. You just need to make sure that you don't use newer APIs on older platforms. Normally lint will warn you if you do something wrong in release builds. As long you keep that in mind you don't need to worry about it.

Just as an example for such an runtime switch:

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    // You can use here an API which was added in Lollipop.
}

Solution 2:

this is normal according to google Android engineers.

Refer to https://code.google.com/p/android/issues/detail?id=198567

This happens when you compile against a higher api level than the deployed device api level. The logs are indicating that, some of the methods are not available and the virtual machine is going to replace them with the alternative implementation.

Br, Nick

Solution 3:

I have the same warnings and then fatal NoClassDefFoundError. The issue can go from dex generated files in multi-dex mode of android-plugin. All classes that couldn't be found were in one package. The package was split between 2 dex-files. A solution is generating MainDexList file where I included only unresolved classes which were joined to one dex-file. For more details see also here.

Post a Comment for "How To Resolve This Error Vfy: Unable To Resolve Virtual Method"