gradle error "Execution failed for task ':app:compileDebugJava' " while build groovy in android studio -
I found an error while creating zero code in Android studio. Error message
C: \ Users \ Administrator \ Desktop \ Lytestll0 \ apps \ src \ main \ java \ Gzzhe \ com \ lytest110 \ MainActivity.java: 41: error: can not symbol Find Log.d ("lytest110", GroovyTest.getMsg ()); ^ Icons: parameter groveest test: class main activity 1 error failed: app: compilation debuggro fail: failed with build exception.
My build.gradle:
buildscript {{treasures jcenter ()} {dependence classpath 'com.android.tools.build:gradle:0.13 .2 'Classpath' m Champio Gradell: Gradli-Groove-Android-plugin: 0.3.4 '// Note: Do not depend on your application here; They are individual modules build.gradle files}} All Project {repositories {jcenter ()}}
App build.gradle in directory:
Apply plugin: 'com.android.application' plugin apply: 'me.champeau.gradle.groovy- Android "Android {compileSdkVersion 19 buildToolsVersion" 19.1.0 "defaultConfig {applicationId" gzzhe.com.lytest110 "minSdkVersion 14 targetSdkVersion 19 versionCode 1 versionName "1.0"} {buildTypes release {runProguard false proguardFiles getDefaultProguardFile ( 'ProGuard-android.txt'), 'proguard-rules.pro'}}} {dependency compile files ( 'libs / Groovy -2.4.0 beta files compiled Do ('libs / android-support-v4.jar') sync The file tree (includes: ['* .jar'], dir: 'libs') // compilation 'com.android support: support-v4: 19. +'}
- I put groovy file I main / Groovy / package / name directory nto.
- Groovy is annotated with @CompileStatic.
this problem Has been surprised for several days.
By your error it seems that you are calling Groovy class with Java Android Groovy Plugin Readme According to it it says
Groovy source should be found in source / main / groove. Note that the plugin is Groovy plugin in Gradle, that Java classes that belong to the Groovy classes themselves referred to reference Groovy classes, if you want to follow the behavior of that means, then those Java classes should get inside the src / Main / Groove also (this is called composite compilation).
So you put your main activity in your main menu. / Main / groovy / package / name directory
Comments
Post a Comment