When I use this 'dependencies', everything is fine. The app runs.
The app dependencies :
dependencies {
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'org.jsoup:jsoup:1.7.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
But when I Add a java module dependencies in this app it throws Error :
Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 1
Just like this
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "three.com.materialdesignexample"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':securitycode')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'org.jsoup:jsoup:1.7.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
My Java module dependencies has nothing
apply plugin: 'java'
dependencies {
}
So what should I do?
Console LOG
14:34:29.496 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"simple","text":"UNEXPECTED TOP-LEVEL EXCEPTION:","sources":[{}]}
AGPBI: {"kind":"simple","text":"java.lang.RuntimeException: Exception parsing classes","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.processClass(Main.java:752)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.access$1200(Main.java:85)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.processOne(Main.java:672)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.processAllFiles(Main.java:569)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.run(Main.java:275)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.main(Main.java:245)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.Main.main(Main.java:106)","sources":[{}]}
AGPBI: {"kind":"simple","text":"Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.parseClass(Main.java:764)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.access$1500(Main.java:85)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.processClass(Main.java:749)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\t... 12 more","sources":[{}]}
AGPBI: {"kind":"simple","text":"1 error; aborting","sources":[{}]}
14:34:29.497 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:dexDebug'
14:34:29.497 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :app:dexDebug FAILED
14:34:29.498 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :app:dexDebug (Thread[Daemon worker Thread 3,5,main]) completed. Took 8.047 secs.
14:34:29.498 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 3,5,main]] finished, busy: 8.506 secs, idle: 0.022 secs
14:34:29.499 [ERROR] [org.gradle.BuildExceptionReporter]
14:34:29.499 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
14:34:29.499 [ERROR] [org.gradle.BuildExceptionReporter]
14:34:29.499 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
14:34:29.499 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':app:dexDebug'.
14:34:29.499 [ERROR] [org.gradle.BuildExceptionReporter] > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 1
14:34:29.500 [ERROR] [org.gradle.BuildExceptionReporter]
14:34:29.500 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
14:34:29.501 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:dexDebug'.
14:34:29.501 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
14:34:29.501 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
14:34:29.501 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
14:34:29.502 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
14:34:29.502 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
14:34:29.502 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
14:34:29.502 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
14:34:29.502 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
14:34:29.502 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
14:34:29.503 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:310)
14:34:29.503 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
14:34:29.503 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
14:34:29.503 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
14:34:29.503 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
14:34:29.504 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
14:34:29.504 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
14:34:29.504 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
14:34:29.504 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
14:34:29.504 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
14:34:29.504 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
14:34:29.504 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
14:34:29.505 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
14:34:29.505 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
14:34:29.505 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
14:34:29.505 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
14:34:29.505 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:90)
14:34:29.505 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:54)
14:34:29.505 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
14:34:29.506 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
14:34:29.506 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
14:34:29.506 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:49)
14:34:29.506 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
14:34:29.506 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
14:34:29.506 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
14:34:29.506 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
14:34:29.506 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
14:34:29.507 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
14:34:29.507 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
14:34:29.507 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
14:34:29.507 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
14:34:29.507 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
14:34:29.507 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.Swapper.swap(Swapper.java:38)
14:34:29.507 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
14:34:29.507 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
14:34:29.508 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
14:34:29.508 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
14:34:29.508 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
14:34:29.508 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
14:34:29.508 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
14:34:29.508 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:71)
14:34:29.508 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
14:34:29.508 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
14:34:29.509 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
14:34:29.509 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
14:34:29.509 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
14:34:29.509 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
14:34:29.509 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
14:34:29.509 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
14:34:29.509 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.internal.UncheckedException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 1
14:34:29.509 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:45)
14:34:29.510 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:78)
14:34:29.510 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:243)
14:34:29.510 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
14:34:29.510 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:230)
14:34:29.510 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
14:34:29.510 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
14:34:29.510 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
14:34:29.510 [ERROR] [org.gradle.BuildExceptionReporter] ... 57 more
14:34:29.510 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 1
14:34:29.510 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:42)
14:34:29.511 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.builder.core.AndroidBuilder.convertByteCode(AndroidBuilder.java:1276)
14:34:29.511 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.builder.core.AndroidBuilder$convertByteCode$8.call(Unknown Source)
14:34:29.511 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.tasks.Dex.doTaskAction(Dex.groovy:165)
14:34:29.511 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.tasks.Dex.this$6$doTaskAction(Dex.groovy)
14:34:29.511 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.tasks.Dex$this$6$doTaskAction.callCurrent(Unknown Source)
14:34:29.511 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.tasks.Dex.taskAction(Dex.groovy:99)
14:34:29.511 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
14:34:29.511 [ERROR] [org.gradle.BuildExceptionReporter] ... 63 more
14:34:29.511 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.process.internal.ExecException: Process 'command 'D:\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 1
14:34:29.512 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:365)
14:34:29.512 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:40)
14:34:29.512 [ERROR] [org.gradle.BuildExceptionReporter] ... 70 more
14:34:29.512 [ERROR] [org.gradle.BuildExceptionReporter]
Set the JDK version Open your project in Android Studio and select File > Settings... > Build, Execution, Deployment > Build Tools > Gradle (Android Studio > Preferences... > Build, Execution, Deployment > Build Tools > Gradle on a Mac). Under Gradle JDK, choose the Embedded JDK option. Click OK.
Another best method to resolve this error is to try to delete the app. iml in your project directory and restart android studio. This will definitely work out and your error of “Module not specified” will be resolved.
I have JDK 8 also. In my case, I add:
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
to the Java library module and the project should compile and work fine.
Just Change java jdk version from 1.8 to 1.7 . Everything is OK!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With