java.lang.IllegalAccessError:在pre-验证类级裁判决定执行意外增加应用程序兼容性,以稳定的应用后, [英] java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation after adding AppCompat to stable application

查看:893
本文介绍了java.lang.IllegalAccessError:在pre-验证类级裁判决定执行意外增加应用程序兼容性,以稳定的应用后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已经现在的工作了几个月稳定的应用程序,并添加appcompat_v7支持材料题材一切后,去了废话。我只是改变了我的活动ActionBarActivity和主题Theme.AppCompat

I have my stable app that's been working for months now, and after adding appcompat_v7 to support Material theme everything went to crap. I just changed my Activities to ActionBarActivity and the theme to Theme.AppCompat

在所有其他运行我得到

java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation

里面随机文库或不相关的意见执行的任意点。它需要一个干净的构建和卸载让它重新工作。

inside a random library or in arbitrary points of execution not related to views. It requires a clean build and uninstall to get it to work again.

java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
            at java.lang.reflect.Field.getAnnotation(Native Method)
            at java.lang.reflect.Field.getAnnotation(Field.java:212)
            at com.j256.ormlite.android.DatabaseTableConfigUtil.configFromField(DatabaseTableConfigUtil.java:243)
            at com.j256.ormlite.android.DatabaseTableConfigUtil.fromClass(DatabaseTableConfigUtil.java:50)
            at com.j256.ormlite.db.SqliteAndroidDatabaseType.extractDatabaseTableConfig(SqliteAndroidDatabaseType.java:76)
            at com.j256.ormlite.dao.DaoManager.createDao(DaoManager.java:67)
            at com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper.getDao(OrmLiteSqliteOpenHelper.java:279)

编辑:

行为飘忽不定的最好的。它可能会或可能不会建立和正常运行。我最好的猜测是,appcompat_v7不喜欢我们的多DEX或具有配置摇篮不pre-DEX库。

Behaviour is erratic at best. It may or may not build and run correctly. My best guess is that appcompat_v7 doesn't like our config with multi-dex or having Gradle to not pre-dex libraries.

推荐答案

您应该包括在主DEX所有的注解类。

You should include all your annotation classes in main dex.

症状是不同的,但解决的办法是一样的这个问题:结果
如何计算摆在你的主-DEX-列表文件哪些类?结果
有一个脚本可以生成它。我写了一个博文展示了如何使用吧。

The symptom is different, but the solution is the same as for this question:
How do you calculate which classes to put in your main-dex-list file?
There's a script that can generate it for you. I wrote a blogpost that shows how to use it.

更新(2014年10月31日):结果
摇篮插件v0.14.0现在可以自动进行。这里见我的回答

Update (10/31/2014):
Gradle plugin v0.14.0 now does it automatically. See my answer here.

这篇关于java.lang.IllegalAccessError:在pre-验证类级裁判决定执行意外增加应用程序兼容性,以稳定的应用后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆