我正在尝试将我的eclipse项目导入Android studio.SO我删除了所有的GCM代码并为FCM创建代码。但是当我创建Build APK时,它会向我显示以下错误,如
Error:UNEXPECTED TOP-LEVEL ERROR:
Error:java.lang.OutOfMemoryError: GC overhead limit exceeded
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
我的gradle文件包含以下依赖项和库。
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "mi.nashik.online"
minSdkVersion 15
targetSdkVersion 23
versionCode 16
versionName "1.9.6"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile ('com.android.support:appcompat-v7:23.4.0')
{
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'com.android.support'
exclude group: 'com.android.support', module: 'support-v4'
}
compile ('com.google.android.gms:play-services:9.0.2'){
exclude group: 'com.android.support'
exclude group: 'com.google.guava'
}
compile 'com.google.code.gson:gson:2.1'
compile 'com.google.protobuf:protobuf-java:2.2.0'
compile files('libs/google-api-client-1.10.3-beta.jar')
compile files('libs/google-api-client-android2-1.10.3-beta.jar')
compile files('libs/google-http-client-1.10.3-beta.jar')
compile files('libs/google-http-client-android2-1.10.3-beta.jar')
compile files('libs/google-oauth-client-1.10.1-beta.jar')
compile files('libs/jackson-core-asl-1.9.4.jar')
compile files('libs/jsr305-1.3.9.jar')
compile files('libs/library-1.2.2.jar')
compile 'com.squareup.picasso:picasso:2.5.0'
compile files('libs/slider.jar')
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.firebase:firebase-analytics:9.0.2'
compile ('com.google.firebase:firebase-core:9.0.2')
{
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
compile ('com.google.firebase:firebase-messaging:9.0.2'){
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
compile files('libs/universal-image-loader-1.9.3-SNAPSHOT.jar')
compile files('libs/urlimageviewhelper-1.0.4.jar')
}
apply plugin: 'com.google.gms.google-services'
答案 0 :(得分:1)
更新您的gradle.properties
文件
org.gradle.jvmargs=-Xms256m -Xmx1024m