java.lang.IllegalAccessError:预验证类中的类ref解析为意外实现谷歌地图

时间:2014-09-22 03:03:55

标签: java android google-maps-api-2

我知道这个错误有几个线程,但我找不到符合我情况的修复程序。 我目前正在处理一个" java.lang.IllegalAccessError:预验证类中的类ref被解析为意外实现"指向以下代码的错误

    private GeoPoint mapGeoCenter = new GeoPoint(0, 0);

现在我们已停止使用Google Maps API 1,但我们仍然有一些引用旧API的随机代码行。我认为这是问题的范围,但我的同事声称它对他很好,我的环境设置不正确。

从我从互联网上收集的内容是,当您引用两个相同的库时会发生此错误。但是根据我在build.gradle中的内容,我没有看到任何可以验证这确实是问题的东西。

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile files('jars/FLurry_3.2.2.jar')
compile files('jars/gson-2.2.4.jar')
compile files('jars/zxing.jar')
compile files('ant_lib/android-10/maps.jar')
compile files('libs/nineoldandroids-2.4.0.jar')


compile 'com.android.support:appcompat-v7:19.+'
androidTestCompile 'junit:junit:4.10'
androidTestCompile 'org.robolectric:robolectric:2.3'
compile project(':android-volley-master')

compile(name: 'library-2.4.1', ext: 'aar')

1 个答案:

答案 0 :(得分:0)

我遇到了这个错误,因为我将maps.jar包含为依赖项。取出maps.jar并针对Google API进行编译修复了它:

android {
compileSdkVersion "Google Inc.:Google APIs:21"
...
}