views:

535

answers:

2

Hi,

I have a project in Android and I want to add MapView to it. I did the following:

  1. Downloaded the Google APIs revision 3.
  2. Added the maps.jar library to my project
  3. Added the MapView to an activity
  4. Created new Virtual Device with target the Google APIs (not the normal target Android 1.5)
  5. Started the project

When I try to reach the activity with the map view, I get

....................

12-16 20:57:44.620: ERROR/AndroidRuntime(792): Caused by: java.lang.IllegalAccessError: cross-loader access from pre-verified class

12-16 20:57:44.620: ERROR/AndroidRuntime(792): at dalvik.system.DexFile.defineClass(Native Method)

12-16 20:57:44.620: ERROR/AndroidRuntime(792): at dalvik.system.DexFile.loadClass(DexFile.java:193)

............

What am I doing wrong?

+1  A: 

If using Eclipse, make sure that you don't have multiple references to the maps.jar on your Project Build Path. This includes any direct reference to the maps.jar, or implicit reference through the Google APIs Library (Google APIs [Android 1.5]). In fact, only having the Google APIs Library on your Project Build Path should be sufficient.

http://andmobidev.blogspot.com

dyerjo
10x for the answer. I'll keep that in mind.
Danail
A: 

Hi im new to android and im getting the same error as mentioned by danail.... and im not able to understand the explanation provided by dyerjo.. plssss explain it clearly...

wavesamir