I am trying to implement the most basic example of google maps android api v2 example. But it crashes with the error:java.lang.NoClassDefFoundError: com.google.android.gms.R$sty
Please check if the "libs" folder containing the "android-support-v4.jar" exists in your project. Because you are using Android 2.2, you must have "libs " folder in your project root directory. If you have not that, just copy that jar file into your "libs" folder .
"android-support-v4.jar" is located in "/extras/android/compatibility/v4/android-support-v4.jar" under your drectory.
And before running your project, you must set your project Build target to "Google APIs", not Android x.x. version : Select your project and click Project > Properties > Project Build Target in Eclipse and select any "Google APIs ", and then run your project on your phone. If you use the emulator, also MUST set the AVD of the emulator to the any "Google APIs ".
Once more, you don't need to create the new Google Maps API key in order to test your project, Just use the default provided API key, which is shown as "Key for browser apps (with referers) "in your Google APIs Console.