package test.test; import android.app.Activity; import android.os.Bundle; import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; public class TestAndrActivity extends MapActivity{ private MapView mapView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } } 

-

 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:enabled="true" android:apiKey="MY_API_KEY" /> </RelativeLayout> 

Gives an error:

E/AndroidRuntime(361): java.lang.RuntimeException: Unable to start activity ComponentInfo{test.test/test.test.TestAndrActivity}: android.view.InflateException: Binary XML file line #9: Error inflating class com.google.android.maps.MapView

and not only this ... The manifest includes:

 <uses-library android:name="com.google.android.maps" /> <uses-permission android:name="android.permission.INTERNET"/> 

Maybe someone came across. I will be very grateful.

    3 answers 3

    Take away

     xmlns:android="http://schemas.android.com/apk/res/android 

    in line 9.

    • removed. Errors: 04-13 04: 45: 11.117: E / AndroidRuntime (595): FATAL EXCEPTION: main 04-13 04: 45: 11.117: E / AndroidRuntime (595): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation 04-13 04: 45: 11.117: E / AndroidRuntime (595): at dalvik.system.DexFile.defineClass (Native Method) 04-13 04: 45: 11.117: E / AndroidRuntime (595): at dalvik.system.DexFile.loadClassBinaryName (DexFile.java:207) 04-13 04:45: 11.117: E / AndroidRuntime (595): at dalvik.system.PathClassLoader.findClass (PathClassLoader.java:200) ... .. ... ... - Alex Meraz
    • thanks for the link - it was there, it did not help ( - Alex Meraz
    • I did not come across this, but I realized that the problem was due to some kind of conflict, so check everything again or change it ... - Gorets
    • what to change? - Alex Meraz

    It is very similar that the emulator does not support the Google Map API. Create an emulator (AVD) where the target is "Google APIs"

    AVD on Google APIs

    • All levels of google API tried. all the same - Alex Meraz

    In AndroidManifest.xml, in the application tag, list uses-library android: name = "com.google.android.maps"

    If it doesn't help, do Project - Clean.

    Here the manual if you do everything as it is written, it works. Just be careful