Android的新手,我试图在我的应用程序中使用谷歌 Map api v2 . 我收到消息'无法执行dex:Java堆空间' . 就像所有的帖子一样,我在eclipse.ini文件中增加了Xmx值512,1024,8000,应用程序仍然崩溃 . 似乎增加这个 Value 对其他所有人都有效 .

的eclipse.ini

-startup

plugins / org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar --launcher.library plugins / org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807-product com.android.ide .eclipse.adt.package.product --launcher.XXMaxPermSize512M -showsplash com.android.ide.eclipse.adt.package.product --launcher.XXMaxPermSize512m --launcher.defaultAction openFile -vm c:\ Program Files \ Java \ jre7 \ bin \ client \ jvm.dll vmargs -Dosgi.requiredJavaVersion = 1.7 -Xms512m -Xmx1024m -Declipse.buildId = v22.3.0-887826

-XX:MaxPermSize = 512M

表现

<meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyBTld_xjcyXpHO1Dl1CrdL817o_IZ_VTHQ" />


    <activity android:name="com.example.dcparksnew.library.google_play_services_lib" />

XML

<?xml version="1.0" encoding="utf-8"?>
<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/maptext"
    android:textSize="24sp"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_gravity="center" />

<fragment
    android:id="@+id/map"
    class="com.google.android.gms.maps.MapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>