【问题标题】:Failed to complete gradle execution. Cause is empty. 65K Methods Limit未能完成 gradle 执行。原因是空的。 65K 方法限制
【发布时间】:2015-08-18 06:33:06
【问题描述】:

这是应用模块的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 和其他类似的解决方案,但结果相同。

有什么办法可以解决这个问题?有人出过这种事吗?

提前致谢!!

【问题讨论】:

  • 这是否会影响您尝试使用 Android Studio 构建的其他项目(不涉及 GCM)?
  • 不,我已经创建了其他应用程序,Android Studio 编译正常
  • 感谢@koh 的回答!!

标签: android build.gradle


【解决方案1】:

我找到了解决办法:

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

gradlew assembleDebug --stacktrace

我抛出了这个错误:

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

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

【讨论】:

  • 为简单起见,请在此处列出要点...因为链接内容可能会随着时间而改变..
猜你喜欢
  • 1970-01-01
  • 2015-02-09
  • 2017-06-02
  • 1970-01-01
  • 2023-03-23
  • 1970-01-01
  • 1970-01-01
  • 2015-06-18
  • 1970-01-01
相关资源
最近更新 更多