0

This is my Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.googleplus_1"
        minSdkVersion 10
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
        multiDexEnabled = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:7.0.0'
    compile 'com.google.gdata:core:1.47.1'
}

/*
configurations {
    all*.exclude group: 'com.android.support'
}

configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'
    all*.exclude group: 'com.google.android.gms', module: 'play-services'
}*/

When I Run the app I get this error:

UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space

however If I comment "compile 'com.google.gdata:core:1.47.1'" and the relevant code the error is gone.

Can you please help me out with this? Thanks

Green Apple
  • 101
  • 10
  • possible duplicate http://stackoverflow.com/questions/1596009/java-lang-outofmemoryerror-java-heap-space and http://stackoverflow.com/questions/37335/how-to-deal-with-java-lang-outofmemoryerror-java-heap-space-error-64mb-heap – Yurets Apr 23 '15 at 15:24
  • I guess these are not related. My code is minimal and should not cause the out of memory issue at the first place. – Green Apple Apr 23 '15 at 15:29

1 Answers1

1

I see you imported the whole play services api. In the documentation, it says you should use the dependencies for the specific apis you need, like google maps api.

http://developer.android.com/google/play-services/setup.html

OKTAY SEN
  • 26
  • 1