【发布时间】:2015-09-29 12:39:44
【问题描述】:
- Gradle 构建:工作正常。
- 重建项目:工作正常。
- 清洁项目:工作正常。
- 运行:显示如下:
错误:任务 ':app:dexDebug' 执行失败。 > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_71\bin\java.exe'' 没有完成-零退出值
详细错误:
信息:Gradle 任务 [:app:assembleDebug] :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72300Library UP-TO-DATE :app:prepareComAndroidSupportMediarouterV72220Library UP-TO-DATE :app:prepareComAndroidSupportMultidex101Library UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72220Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42300Library UP-TO-DATE :app:prepareComCrashlyticsSdkAndroidAnswers102Library UP-TO-DATE :app:prepareComCrashlyticsSdkAndroidBeta102Library UP-TO-DATE :app:prepare ComCrashlyticsSdkAndroidCrashlytics210Library UP-TO-DATE :app:prepareComDigitsSdkAndroidDigits180Library UP-TO-DATE :app:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServices810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppinvite810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppstate810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesCast810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesDrive810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesFitness810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGames810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGcm810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesLocation810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMaps810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesNearby810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPanorama810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesSafetynet810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesVision810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWallet810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWearable810Library UP-TO-DATE :app:prepareComTwitterSdkAndroidTweetComposer090Library UP-TO-DATE :app:prepareComTwitterSdkAndroidTweetUi150Library UP-TO-DATE :app:prepareComTwitterSdkAndroidTwitter180Library UP-TO-DATE :app:prepareComTwitterSdkAndroidTwitterCore150Library UP-TO-DATE :app:prepareIoFabricSdkAndroidFabric135Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl 最新 :app:compileDebugRenderscript 最新 :app:generateDebugBuildConfig 最新 :app:generateDebugAssets 最新 :app:mergeDebugAssets 最新 :app:generateDebugResValues 最新 :app:generateDebugResources 最新 :app:mergeDebugResources 最新 :app:processDebugManifest 最新 :app:fabricGenerateResourcesDebug :app:processDebugResources :app:generateDebugSources :app:processDebugJavaRes 最新 :app:compileDebugJavaWithJavac 最新 :app:compileDebugNdk 最新 :app:compileDebugSources 最新 :app:collectDebugMultiDexComponents 最新 :app:packageAllDebugClassesForMultiDex 最新 :app:shrinkDebugMultiDexComponents 最新 :app:createDebugMainDexClassList UP-TO-DATE :app:dexDebug 错误:无法创建 Java 虚拟机。 错误:发生了致命异常。程序将会退出。 最大堆大小无效:-Xmx4g 指定的大小超过了最大可表示大小。 错误:任务“:app:dexDebug”执行失败。 com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_71\bin\java.exe'' 完成非零退出值 1 信息:构建失败 信息:总时间:12.312 秒 信息:1个错误 信息:0 个警告 信息:在控制台中查看完整的输出
我在“quickblox”的 lib 文件夹中添加了 3 个 jar 文件。我已经参考了与我的问题相关的所有帖子,但我无法成功构建该项目。我也启用了
multiDexEnabled 真
我的构建 Gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.0'
defaultConfig {
applicationId "xxx.xxx.xxx"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.code.gson:gson:2.3'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.retrofit:retrofit-mock:1.9.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:multidex:1.0.0'
compile('com.crashlytics.sdk.android:crashlytics:2.1.0@aar') {
transitive = true;
}
compile('com.twitter.sdk.android:twitter:1.8.0@aar') {
transitive = true;
}
compile files('libs/quickblox-android-sdk-chat-2.3.1.jar')
compile files('libs/quickblox-android-sdk-core-2.3.1.jar')
compile files('libs/quickblox-android-sdk-messages-2.3.1.jar')
}
【问题讨论】:
-
尝试将targetSdkVersion设置为compileVersion
-
@Unii 谢谢你的回复。我刚刚尝试将targetSdkVersion更改为complileVersion。现在它向我显示“找不到 Gradle DSL 方法:compileVersion()'
标签: java android gradle build.gradle