eclipse Java.lang.verifyerror 如何修复甚至找出根本原因?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16764584/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java.lang.verifyerror how do I fix or even find out the root cause?
提问by Edmund Rojas
Currently going through a nightmare attempting to fix a java.lang.verifyerror, was having issues with eclipse so I decided to uninstall and reinstall it, everything seemed normal until I tried to launch the app, thats when I noticed that I couldnt launch the app anymore, everytime I try to lauch it it crashes and gives me this error, however I have no clue what is causing it as the error log gives me little clues and I cant find any concrete answers on the internet, can anyone tell me what is wrong based on my logcat? any help will go a long way thanks
目前正在经历一场尝试修复 java.lang.verifyerror 的噩梦,Eclipse 有问题,所以我决定卸载并重新安装它,一切似乎都很正常,直到我尝试启动该应用程序,那是当我注意到我无法启动该应用程序时不再,每次我尝试启动它时它都会崩溃并给我这个错误,但是我不知道是什么导致了它,因为错误日志给了我很少的线索,我在互联网上找不到任何具体的答案,谁能告诉我是什么错误基于我的 logcat?任何帮助都会大有帮助,谢谢
05-26 23:11:45.391: E/AndroidRuntime(624): FATAL EXCEPTION: main
05-26 23:11:45.391: E/AndroidRuntime(624): java.lang.VerifyError: com/vineline/second/OTweetApplication
05-26 23:11:45.391: E/AndroidRuntime(624): at java.lang.Class.newInstanceImpl(Native Method)
05-26 23:11:45.391: E/AndroidRuntime(624): at java.lang.Class.newInstance(Class.java:1319)
05-26 23:11:45.391: E/AndroidRuntime(624): at android.app.Instrumentation.newApplication(Instrumentation.java:957)
05-26 23:11:45.391: E/AndroidRuntime(624): at android.app.Instrumentation.newApplication(Instrumentation.java:942)
05-26 23:11:45.391: E/AndroidRuntime(624): at android.app.LoadedApk.makeApplication(LoadedApk.java:477)
05-26 23:11:45.391: E/AndroidRuntime(624): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3909)
05-26 23:11:45.391: E/AndroidRuntime(624): at android.app.ActivityThread.access00(ActivityThread.java:122)
05-26 23:11:45.391: E/AndroidRuntime(624): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1184)
05-26 23:11:45.391: E/AndroidRuntime(624): at android.os.Handler.dispatchMessage(Handler.java:99)
05-26 23:11:45.391: E/AndroidRuntime(624): at android.os.Looper.loop(Looper.java:137)
05-26 23:11:45.391: E/AndroidRuntime(624): at android.app.ActivityThread.main(ActivityThread.java:4340)
05-26 23:11:45.391: E/AndroidRuntime(624): at java.lang.reflect.Method.invokeNative(Native Method)
05-26 23:11:45.391: E/AndroidRuntime(624): at java.lang.reflect.Method.invoke(Method.java:511)
05-26 23:11:45.391: E/AndroidRuntime(624): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-26 23:11:45.391: E/AndroidRuntime(624): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-26 23:11:45.391: E/AndroidRuntime(624): at dalvik.system.NativeStart.main(Native Method)
回答by G. Blake Meike
This is a problem with ADT v22. It is pretty hard to fix. There are some suggestions here: The CommonsBlog - Don't Manually Modify Your Eclipse Build Path... Except Now for R22(thanks to StreetsOfBoston and CommonswareGuy)
这是 ADT v22 的问题。很难修复。这里有一些建议:CommonsBlog - 不要手动修改你的 Eclipse 构建路径......现在除了 R22(感谢 StreetsOfBoston 和 CommonswareGuy)
回答by Konstantin Yovkov
So, as far as I'm aware, Android uses a different class file format and if you are running a third party JAR/Java files, you have to first run them through the dx
tool that ships with the Android SDK.
因此,据我所知,Android 使用不同的类文件格式,如果您正在运行第三方 JAR/Java 文件,则必须首先通过dx
Android SDK 附带的工具运行它们。
Other possible reason may probably be some method in a java.lang
class that is not supported on the Android SDK level you are using (for instance, String.isEmpty()
).
其他可能的原因可能是java.lang
您正在使用的 Android SDK 级别不支持类中的某些方法(例如,String.isEmpty()
)。
回答by Zeus
If the answer by @G. Blake Meike doesn't work for you for whatever reason, here's another way of fixing it.
如果@G 的答案。无论出于何种原因,Blake Meike 都不适合您,这是修复它的另一种方法。
- Right Click Project > Build Path > Configure Build Path
- Click on Android on left
- On right select any other Target Name/API other than 4.2.2 since it seems that's with problems.
- Hit OK (At this point it rebuilds your projects with the selected API)
- Run the Application
- 右键单击项目>构建路径>配置构建路径
- 点击左侧的安卓
- 在右侧选择 4.2.2 以外的任何其他目标名称/API,因为这似乎有问题。
- 点击 OK(此时它会使用选定的 API 重建您的项目)
- 运行应用程序
Hope that helps.
希望有帮助。
回答by jettimadhuChowdary
I just enabled the 3rd party library in the "Import and export" TAB of configuring build path.
我刚刚在配置构建路径的“导入和导出”选项卡中启用了第 3 方库。