[英]Build error ,Gradle -> Error:Execution failed for task ':app:preDexDebug'. > org.gradle.process.internal.ExecException:
I use Android Studio. 我使用Android Studio。
Module App: 模块应用:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '22.0.1'
compileOptions {
encoding "UTF-8"
}
defaultConfig {
applicationId "com.my.app"
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName '1'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile files('libs/volley.jar')
compile 'com.google.android.gms:play-services:7.5.0'
}
Project com.my.app 项目com.my.app
// 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.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
But I get this error: 但是我得到这个错误:
error : Error:Execution failed for task ':app:preDexDebug'.
org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Program
Files\Java\jdk1.8.0_45\bin\java.exe''
With gradlew compileDebug --stacktrace : 使用gradlew compileDebug --stacktrace:
* Exception is:
org.gradle.execution.TaskSelectionException: Task 'compileDebug' is ambiguous in
root project 'BillionsOfPeople'. Candidates are: 'compileDebugAidl', 'compileDe
bugAndroidTestAidl', 'compileDebugAndroidTestJava', 'compileDebugAndroidTestNdk'
, 'compileDebugAndroidTestRenderscript', 'compileDebugAndroidTestSources', 'comp
ileDebugJava', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugSourc
es', 'compileDebugUnitTestJava', 'compileDebugUnitTestSources'.
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
gradlew compileDebug : gradlew compileDebug:
FAILURE: Build failed with an exception. 失败:构建失败,发生异常。
- What went wrong: Task 'compileDebug' is ambiguous in root project 'MyApp'. 出了什么问题:根项目“ MyApp”中的任务“ compileDebug”不明确。 Candidates are: 'compileDebugAidl', 'compileDebugAndroidTestAidl', 'compileDebugAndroidTest Java', 'compileDebugAndroidTestNdk', 'compileDebugAndroidTestRenderscript', 'com pileDebugAndroidTestSources', 'compileDebugJava', 'compileDebugNdk', 'compileDeb ugRenderscript', 'compileDebugSources', 'compileDebugUnitTestJava', 'compileDebu gUnitTestSources'. 候选对象为:'compileDebugAidl','compileDebugAndroidTestAidl','compileDebugAndroidTest Java','compileDebugAndroidTestNdk','compileDebugAndroidTestRenderscript','comileDebugAndroidTestSources','compileDebugJava','compileDebugNdk','compileDeb ugRenderSource',' 'compileDebu gUnitTestSources'。
NOTE: I cannot run sdk manager. 注意:我无法运行sdk管理器。
I think the problem is the value of your applicationId
in the build.gradle
. 我认为问题在于build.gradle
applicationId
的值。 It should contain the fully qualified package name of your application because it will be the identifier used by the system to install your app. 它应包含您的应用程序的标准软件包名称,因为它将是系统用于安装您的应用程序的标识符。 "/**/" looks like a really conflicting name for the dex packaging. “ / ** /”看起来像是dex包装的真正冲突的名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.