无法完成gradle执行。原因是空的。 65K方法限制

时间:2015-06-03 20:50:05

标签: android build.gradle

这是app module的de build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.my.app"
    minSdkVersion 10
    targetSdkVersion 22
    versionCode 19
    versionName "1.6.2"

}
buildTypes {
    release {
        minifyEnabled false
        debuggable false;
        proguardFiles getDefaultProguardFile('proguard-android.txt'),  'proguard-rules.pro'
    }
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
}

repositories {
    maven { url 'http://dl.bintray.com/madcyph3r/maven/'  }
    maven { url 'http://dl.bintray.com/amulyakhare/maven' }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile "com.google.android.gms:play-services:7.5.0"
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.android.support:recyclerview-v7:21.0.0'
    compile 'net.glxn.qrgen:android:2.0'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'de.madcyph3r:materialDrawer:1.1.1@aar'
    compile 'com.google.maps.android:android-maps-utils:0.3.4'
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.google.zxing:core:3.2.0'
    compile 'me.dm7.barcodescanner:zxing:1.7'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'org.apache.commons:commons-io:1.3.2'
    compile files('libs/GraphView-4.0.1.jar')
    compile files('libs/mpandroidchartlibrary-2-1-0.jar')
    compile files('libs/bitcoinj-core-0.12.3-bundled.jar')

}

这是项目的build.gradle

// Top-level build file where you can add configuration options common to      all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'
        classpath 'com.google.gms:google-services:1.3.0-beta1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

我正在尝试使用Google云消息传递,我已经按照https://developers.google.com/cloud-messaging/android/client中的所有步骤进行了操作,但是当我将gradle文件与项目同步时,我得到了这个:

Failed to complete gradle execution. Cause: [empty]

我尝试实施此解决方案:Android Studio: failed to complete gradle execution, cause is empty和其他类似解决方案但结果相同。

这个问题可以解决什么问题?有人发生过这个吗?

提前Thaanks !!

1 个答案:

答案 0 :(得分:0)

我找到了解决方案:

问题不在于GCM。当我尝试编译应用程序时出现问题。我用了命令;

gradlew assembleDebug --stacktrace

我抛出了这个错误:

Unable to execute dex : method ID not in [0 , 0xFFFF ] : 65536.

我已经解决了Google在此描述的步骤: Building Apps with Over 65K Methods