Getting “Caused by: java.lang.VerifyError:”

前端 未结 6 1277
时光取名叫无心
时光取名叫无心 2020-11-28 15:30

I created an android application which is used as library in another android application. I used some third party jars in the android app which acts as a library. When I lin

相关标签:
6条回答
  • 2020-11-28 15:59

    In Eclipse, go to the Project properties -> Java Build Path. Select the Order and Export Tab and check your third party jars.

    0 讨论(0)
  • 2020-11-28 16:04

    The same error occurred to me, as I tried to catch the exception SQLDataException on v.8 API device as the corresponding class is not included in the v.8 API (the error did not occur in v.14 devices, where that class is included). In fact, SQLDataException.class is not present only in the android.jar of v.8 API, while it is included in the v.14 API. So I replaced the exception SQLDataException with the exception SQLException (whose SQLDataException is a subclass) and my app now runs fine on both API's devices.

    0 讨论(0)
  • 2020-11-28 16:05

    Removing all the jar files from the /libs folder and then adding them again followed by cleaning the project and building it fixed for me.

    0 讨论(0)
  • 2020-11-28 16:10

    That can be caused by something in the jar accessing something in Java that's not in the Android SDK. Look in LogCat for the exception and it may tell you what it's missing. If you have the sources for the 3rd party jar, try including them directly into your project; that will help pin down the problem.

    You also need to run your jar file through the "dx" tool that comes with the sdk.

    0 讨论(0)
  • 2020-11-28 16:13

    If you are using ant, then you should add all your external jars to the following dir "libs" and also add following line in a new file: ant.properties: jar.libs.dir=libs

    0 讨论(0)
  • 2020-11-28 16:15

    If you are getting a VerifyError after building a release version of your app using ProGuard, it might be related to some optimization issue. Refer to the documentation, which essentially suggests disabling optimization using -dontoptimize.

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