0

I realize that similar questions have been asked multiple times here, but with everything I found on stackoverflow, I can't get Google maps v2 to work on Android using Eclipse.

This is in my manifest file:

   <uses-sdk
    android:minSdkVersion="16"
    android:targetSdkVersion="21" />

<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name="com.my.app.activity.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <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="....." />
</application>

This is in my main activity:

    @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
            .getMap();  }

This is the layout file:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
    android:id="@+id/map"
    android:name="com.google.android.gms.maps.MapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

I added the google-play-services_lib to the project via project/properties/android/Library.

What I get is Eclipse showing a heap overflow. My eclipse.ini has

-XX:MaxPermSize=2048m
-Xms512m
-Xmx2048m

What happens is my Eclipse screen goes dark, Eclipse doesn't respond, and finally reports "GC overhead limit exceeded" and "Unhandled event loop exception". It never actually starts the app. This happened both on Eclipse Kepler and Eclipse Luna. I'm at a loss :-)

edit: I created a new empty android project, I followed the steps in https://developers.google.com/maps/documentation/android/start and I get the same error.

Unable to execute dex: GC overhead limit exceeded
GC overhead limit exceeded

and

conversion to Dalvik failed
Christine
  • 5,617
  • 4
  • 38
  • 61
  • http://stackoverflow.com/a/20919250/1318946 – Pratik Butani Nov 18 '14 at 11:53
  • Yes, that's why I included those lines from my eclipse.ini. In the mean time I've set them to even higher values, to no avail. – Christine Nov 18 '14 at 12:06
  • Have you reset eclipse and adb.exe – Pratik Butani Nov 18 '14 at 12:10
  • I have replaced Eclipse Kepler by Luna, I have created a new project in a new workspace. I have rebooted my computer between tries, I have been trying to get this to work for days now. I have now switched to Android Studio, but I don't like Android Studio very much. I'd rather stick to Eclipse. – Christine Nov 18 '14 at 12:14
  • Okay, Its nice but you have to change and try again. That problem is occurred only for that Memory size given in `eclipse.ini` Try please. Good Luck – Pratik Butani Nov 18 '14 at 12:18

0 Answers0