A Gradle plugin to support the Groovy language for building Android apps

Overview

Groovy language support for Android

Deprecated: This plugin has been deprecated in favor of Kotlin which has the full support of JetBrains and Google. The changes that go into each Android Plugin Version make it really hard for this plugin to keep up. As of Gradle 6.0 this plugin does not work.

This plugin adds Groovy Language support for Android applications and libraries.

Updates

As of 2.0.0 of this plugin only will work with the Android Gradle Plugin 3.0.0 and above. For support of lower version use 1.2.0.

There is an issues when using build tool 26+ and the Groovy jar. The current work around is to use proguard or to use JarJar to create a jar file that does not have invoke dynamic classes. See ZarZaring the Groovy Jar for Android 26+ to create your own jar and avoid having to run proguard. See Github Issue for more details.

Quick Start

Use a lazybones template from grooid-template

Usage

Edit your build.gradle file to contain the following:

buildscript {
  repositories {
    jcenter()
  }

  dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0'
    classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:2.0.1'
  }
}

apply plugin: 'com.android.application'
apply plugin: 'groovyx.android'

The latest version of the Groovy Android Plugin can be found here

You must choose which version of Groovy you use. Android support is available in starting at the 2.4.x releases. You will need to add the following repository to your build.gradle file:

repositories {
  jcenter()
}

Then you can start using Groovy by adding the groovy dependency with the grooid classifier:

dependencies {
  compile 'org.codehaus.groovy:groovy:2.4.12:grooid'
}

Full list of releases can be found here here. Then use the assembleDebug gradle task to test out your build and make sure everything compiles.

Should you want to test development versions of the plugin, you can add the snapshot repository and depend on a SNAPSHOT:

buildscript {
  repositories {
    jcenter()
    maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
  }
}
  dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0'
    classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:2.0.2-SNAPSHOT'
  }
}

Go here to see what the latest SNAPSHOT version is.

Where to put sources?

Groovy sources may be placed in src/main/groovy, src/test/groovy, src/androidTest/groovy and any src/${buildVariant}/groovy configured by default. A default project will have the release and debug variants but these can be configured with build types and flavors. See the android plugin docs for more about configuring different build variants.

Extra groovy sources may be added in a similar fashion as the android plugin using the androidGroovy.sourceSets block. This is especially useful for sharing code between the different test types, and also allows you to add Groovy to an existing project. For example

androidGroovy {
  sourceSets {
    main {
      groovy {
        srcDirs += 'src/main/java'
      }
    }
  }
}

would add all of the Java files in src/main/java directory to the Groovy compile task. These files will be removed from the Java compile task, instead being compiled by GroovyC, and will allow for the Java sources to be referenced in the Groovy sources (joint compilation). Please note, that you may need to also add these extra directories to the Java source sets in the android plugin for Android Studio to recognize the Groovy files as source.

Writing Groovy Code

This plugin has been successfully tested with Android Studio and will make no attempts to add support for other IDEs. This plugin will let you write an application in Groovy but it is recommended, for performance, memory and battery life, that you use @CompileStatic wherever possible.

Details can be found on Melix’s blog and here for more technical details

Including Groovy Libraries

In order to include libraries written in groovy that include the groovy or groovy-all jars, you will need to exclude the groovy dependency allowing the grooid jar to be the one to be compiled against.

For example to use the groovy-xml library you would simply need to do exclude the group org.codehaus.groovy.

compile ('org.codehaus.groovy:groovy-xml:2.4.3') {
    exclude group: 'org.codehaus.groovy'
}

Skipping Groovy Compile

As of version 1.2.0 only build types/build flavors with groovy sources included in them will have the groovy compile task added. If you would like to skip the groovy compilation tasks on older versions or on newer version wish to skip them in build types that have groovy sources you can use the following to disable the groovy compiler task.

tasks.whenTaskAdded { task ->
  if (task.name == 'compileDebugGroovyWithGroovyc') { # (1)
    task.enabled = false
  }
}
  1. Disables groovy compilation only for the debug build type, simply replace compileDebugGroovyWithGroovyc with whichever compilation task you would like skip to disable it.

Configuring the Groovy compilation options

The Groovy compilation tasks can be configured in the androidGroovy block using the options block:

androidGroovy {
  options {
    configure(groovyOptions) {
      encoding = 'UTF-8'
      forkOptions.jvmArgs = ['-noverify'] // maybe necessary if you use Google Play Services
    }
  }
}

See GroovyCompile for more options. See Example Application for an example of using these settings to enable custom compilation options.

Only Use GroovyC

For integration with plain java projects or for working with generated files (such as BuildConfig) it may be desirable to only have GroovyC run in order to have Java files reference Groovy files. This is roughly the equivalent of placing all java source files into the groovy source directory (including auto generated files like BuildConfig). In order to only have GroovyC run simply set the flag skipJavaC in the androidGroovy block to true.

androidGroovy {
  skipJavaC = true
}

Annotation Processing

As of 1.2.0 Release annotation processing is configured by default.

Previous versions would require javaAnnotationProcessing to be set to true.

androidGroovy {
  options {
    configure(groovyOptions) {
      javaAnnotationProcessing = true
    }
  }
}

Android packagingOptions

Groovy Extension Modules and Global transformations both need a file descriptor in order to work. Android packaging has a restriction related to files having the same name located in the same path.

If you are using several Groovy libraries containing extension modules and/or global transformations, Android may complain about those files.

You can simply add the following rule:

android {
  packagingOptions {
      exclude 'META-INF/services/org.codehaus.groovy.transform.ASTTransformation'
      exclude 'META-INF/services/org.codehaus.groovy.runtime.ExtensionModule'
      // you may need to exclude other files if you get "duplicate files during packaging of APK"
      exclude 'META-INF/groovy-release-info.properties'
      exclude 'META-INF/LICENSE'
  }
}

There are no problems excluding global transformation descriptors because those are only used at compile time, never at runtime.

The problem comes with module extensions. Unless you statically compile classes using extension modules with @CompileStatic they won’t be available at runtime and you’ll get a runtime exception.

There is an alternative. The emerger gradle plugin will add excludes for you and merges all extension module descriptors into a single file which will be available at runtime.

Groovy Community

Have questions, want to learn more!? Come ask questions or help others in #android in the Groovy Community Slack groovycommunity.com[Sign-Up Here]

Comments
  • Dagger Annotation Processor Crashes When Building With Groovy

    Dagger Annotation Processor Crashes When Building With Groovy

    I've created the a sample Gradle project to demonstrate the problem

    1. Download the zip
    2. Extract
    3. Modify the local.properties to point at your Android SDK
    4. ./gradlew build --stacktrace
        :preBuild
        :compileDebugNdk
        :preDebugBuild
        :checkDebugManifest
        :prepareDebugDependencies
        :compileDebugAidl
        :compileDebugRenderscript
        :generateDebugBuildConfig
        :generateDebugAssets UP-TO-DATE
        :mergeDebugAssets
        :generateDebugResValues UP-TO-DATE
        :generateDebugResources
        :mergeDebugResources
        :processDebugManifest
        :processDebugResources
        :generateDebugSources
        :compileDebugJava
        :compileDebugGroovy
        warning: [options] bootstrap class path not set in conjunction with -source 1.6
        :compileDebugGroovy FAILED
    
        FAILURE: Build failed with an exception.
    
        * What went wrong:
        Execution failed for task ':compileDebugGroovy'.
        > java.lang.NoSuchMethodError: com.google.common.collect.Queues.newArrayDeque()Ljava/util/ArrayDeque;
    
        * Try:
        Run with --info or --debug option to get more log output.
    
        * Exception is:
        org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileDebugGroovy'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.Main.doAction(Main.java:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
        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:30)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)
        Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: com.google.common.collect.Queues.newArrayDeque()Ljava/util/ArrayDeque;
        at com.sun.tools.javac.main.Main.compile(Main.java:469)
        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:42)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:35)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler$2$1.compile(ApiGroovyCompiler.java:112)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:122)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:47)
        at org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonServer.execute(CompilerDaemonServer.java:53)
        at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
        at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
        Caused by: java.lang.NoSuchMethodError: com.google.common.collect.Queues.newArrayDeque()Ljava/util/ArrayDeque;
        at dagger.internal.codegen.InjectBindingRegistry.<init>(InjectBindingRegistry.java:68)
        at dagger.internal.codegen.ComponentProcessor.init(ComponentProcessor.java:99)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:517)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:614)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:707)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
        at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
        at com.sun.tools.javac.main.Main.compile(Main.java:439)
        ... 11 more
    

    I've uploaded logs at the --debug log level for your references.

    Oddly enough, if you were to move the AndroidModule.java file form src/main/groovy to src/main/java this project compiles with no issues. I've uploaded logs at the --debug log level for this case as well.

    Do you have any ideas for what might be causing this issue?

    Thanks for your help.

    opened by Sarev0k 32
  • Kotlin Support

    Kotlin Support

    Hey team, When using Kotlin version 1.0.4 or higher (1.0.3 worked) during the :app:compileDebugGroovyWithGroovyc i get the following error:

    error: package {package name where kotlin class is in} does not exist
    

    Any ideas if there's something i can do to get this working?

    opened by tehras 25
  • Update compatibility for build-tools-2.2.0-alpha6

    Update compatibility for build-tools-2.2.0-alpha6

    -Bumps build tools version so it works with currently newest alpha of build tools (hopefully it will work with final 2.2.0) -globalScope property for some reason returned TransformGlobalScope instead of GlobalScope. Calling getGlobalScope() seems to return value that we want. -Please verify whether I've updated FullCompilationSpec correctly.

    opened by Naitbit 19
  • Support for Android Gradle Plugin Version 3.0.0

    Support for Android Gradle Plugin Version 3.0.0

    The plugin is not compatible with the last Android Gradle Plugin Version (3.0.0-rc1) Seems that on that version they remove some method and the plugin fails when trying to access to the Kotlin output directory. I have added more tests that reproduce the error, but I don't know how to fix it maybe with some help ;) You can see the branch that I have created with that tests: https://github.com/JcMinarro/groovy-android-gradle-plugin/tree/tests-that-fail-with-android-plugin-version-3.0.0-rc1

    And here is the failure log:

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':myosn:compileExternalTestingDebugUnitTestGroovyWithGroovyc'.
    > Cannot get property 'kotlinOutputDir' on null object
    
    * Try:
    Run with --info or --debug option to get more log output.
    
    * Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':myosn:compileExternalTestingDebugUnitTestGroovyWithGroovyc'.
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
            at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
            at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
            at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
            at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
            at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
            at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
            at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
            at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
            at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
            at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
            at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
            at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
            at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
            at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
            at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
            at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
            at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
            at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:59)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:128)
            at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
            at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
            at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
            at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
            at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:46)
            at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
            at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
            at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:314)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
            at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:204)
            at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:134)
            at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:109)
            at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
            at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
            at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
            at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
            at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
            at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
            at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
            at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
            at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
            at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
            at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
            at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
            at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
            at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
            at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
            at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
            at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
            at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
            at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
            at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
            at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
            at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
            at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
            at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
            at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
            at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
            at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
            at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
            at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
            at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
            at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
            at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
            at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
            at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
            at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
            at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
            at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
            at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
            at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
            at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
            at org.gradle.util.Swapper.swap(Swapper.java:38)
            at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
            at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
            at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
            at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
            at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
            at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
            at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
            at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
            at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
            at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
            at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
            at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
            at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
            at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
            at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    Caused by: java.lang.NullPointerException: Cannot get property 'kotlinOutputDir' on null object
            at groovyx.GroovyAndroidPlugin.getKotlinClassFiles(GroovyAndroidPlugin.groovy:282)
            at groovyx.GroovyAndroidPlugin$_processVariantData_closure3$_closure8.doCall(GroovyAndroidPlugin.groovy:164)
            at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:700)
            at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:673)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
            at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
            ... 102 more
    
    
    * Get more help at https://help.gradle.org
    
    opened by JcMinarro 18
  • Unsupported major.minor version 52.0

    Unsupported major.minor version 52.0

    This error appears when I try to build the project. Here's the project-level build.gradle file:

    // 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.5.0'
            classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.7'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    And this is the app build.gradle file:

    apply plugin: 'com.android.application'
    apply plugin: 'groovyx.grooid.groovy-android'
    
    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.1"
    
        defaultConfig {
            applicationId "com.my.package.name"
            minSdkVersion 9
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        productFlavors {
            men {
                applicationId "com.my.firstappid"
                versionName "1.0-men"
            }
            women {
                applicationId "com.my.secondappid"
                versionName "1.0-women"
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.1.1'
        compile 'com.android.support:design:23.1.1'
        compile 'org.codehaus.groovy:groovy:2.4.5:grooid'
    }
    

    Moving the apply plugin: 'groovyx.grooid.groovy-android' line between the two files doesn't help. I'm on OS X/Android Studio 1.5.1. Java version:

    $ javac -version
    javac 1.7.0_79
    
    opened by realmhamdy 18
  • Plugin not working against android plugin 1.4.x-beta

    Plugin not working against android plugin 1.4.x-beta

    Google released 1.4.0-beta2 (2015/09/15) http://tools.android.com/tech-docs/new-build-system

    and it's crashing while looking for https://github.com/groovy/groovy-android-gradle-plugin/blob/master/src/main/groovy/groovyx/grooid/GroovyAndroidPlugin.groovy#L19

    Stacktrace

    Caused by: groovy.lang.MissingPropertyException: No such property: bootClasspath for class: com.android.builder.core.AndroidBuilder
        at groovyx.grooid.GroovyAndroidPlugin$__clinit__closure10.doCall(GroovyAndroidPlugin.groovy:19)
        at groovyx.grooid.GroovyAndroidPlugin.getRuntimeJars(GroovyAndroidPlugin.groovy:154)
        at groovyx.grooid.GroovyAndroidPlugin$getRuntimeJars$1.call(Unknown Source)
        at groovyx.grooid.GroovyAndroidPlugin$_attachGroovyCompileTask_closure5_closure19.doCall(GroovyAndroidPlugin.groovy:102)
        at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:554)
        at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:535)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    
    opened by pjakubczyk 16
  • Cant use this plugin to write unit tests.

    Cant use this plugin to write unit tests.

    I was interested in using this plugin to unit test code however it does not seem to work at all.

    I followed instructions here to set up the project http://tools.android.com/tech-docs/unit-testing-support

    However i can only get java unit tests working.

    opened by djmittens 14
  • Cannot get property 'moduleVersion' on null object

    Cannot get property 'moduleVersion' on null object

    There is a proble in my project, could you help me ?

    E:\code\git\GridviewDemo>gradle assembleDebug

    FAILURE: Build failed with an exception.

    • Where: Build file 'E:\code\git\GridviewDemo\app\build.gradle' line: 3

    • What went wrong: A problem occurred evaluating project ':app'.

      Cannot get property 'moduleVersion' on null object

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED

    Total time: 4.663 secs

    opened by msdx 13
  • Build failed for groovy code

    Build failed for groovy code

    Hi

    Android studio 1.5.1. fails building simple project, with groovy classes included.

    app.gradle file follows:

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.5.0'
            classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.7'
        }
    }
    
    
    apply plugin: 'com.android.application'
    
    apply plugin: 'groovyx.grooid.groovy-android'
    
    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"
    
        defaultConfig {
            applicationId "farago.com.reader"
            minSdkVersion 19
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    
        //packagingOptions {
            // workaround for http://stackoverflow.com/questions/20673625/android-gradle-plugin-0-7-0-duplicate-files-during-packaging-of-apk
            //exclude 'META-INF/LICENSE.txt'
            //exclude 'META-INF/groovy-release-info.properties'
        //}
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.1.1'
        compile 'com.android.support:design:23.1.1'
        compile 'org.bouncycastle:bcprov-jdk16:1.45'
        //compile 'org.codehaus.groovy:groovy:2.4.5:grooid'
    
    }
    

    In build I get error Error:Execution failed for task ':app:compileDebugGroovyWithGroovyc'.

    No such property: bootClasspath for class: com.android.build.gradle.AppPlugin

    I tried to include latest versions of all components, but build still fails.

    can you recommend a setup, that works? maybe some specific versions of studio, java / plugins?

    thx a lot

    Marek

    opened by marek-kuticka 12
  • update Groovy compilation task's classpath first when execute it

    update Groovy compilation task's classpath first when execute it

    Update Groovy compilation task's classpath first, to use the latest classpath which may be updated by other tasks. This assume groovyCompile execute after javaCompile.

    opened by bai-jie 12
  • Deprecation warning when used with Gradle 4.10.x or Android Plugin 3.3.x

    Deprecation warning when used with Gradle 4.10.x or Android Plugin 3.3.x

    Enabling the plugin triggers the following message when Android Gradle plugin 3.3 is used. (In my case, 3.3.0-alpha13)

    16:51:03.116 [DEBUG] [groovyx.GroovyAndroidPlugin] Project has com.android.build.gradle.LibraryExtension_Decorated@367efc09 as an extension
    16:51:03.117 [DEBUG] [groovyx.GroovyAndroidPlugin] Processing variant debug
    16:51:03.117 [WARN] [org.gradle.api.Project] WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
    It will be removed at the end of 2019.
    For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
    
    To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
    

    Unfortunately, just adding the recommended option does not show the stacktrace.

    opened by AstralStorm 11
  • Plugin incompatible with Gradle 8.0

    Plugin incompatible with Gradle 8.0

    What kind of issue is this?

    • [ ] Question. This issue tracker is not the place for questions. If you want to ask how to do something, or to understand why something isn't working the way you expect it to, use Stack Overflow with the android-groovy tag.

    • [ ] Bug report. If you’ve found a bug, spend the time to write a failing test. Bugs with tests get fixed. See here for some example tests.

    • [x] Feature Request. Start by telling us what problem you’re trying to solve. Often a solution already exists! Don’t send pull requests to implement new features without first getting our support. Sometimes we leave features out on purpose to keep the project small.

    Hello, I recently updated my project to Gradle 7 and found out I still get deprecation warnings. After running my build with --warning-mode all I have seen:

    The AbstractCompile.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the destinationDirectory property instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.3.3/userguide/upgrading_version_7.html#compile_task_wiring

    Which may be caused by usage of destinationDir in groovy-android-gradle-plugin. Apparently Gradle has deprecated destinationDir in compile task.

    The feature request would be to make the plugin use Gradle 7 for build and being compatible with Gradle 8.

    opened by dariuszseweryn 1
  • Failed to apply plugin [id 'groovyx.android']

    Failed to apply plugin [id 'groovyx.android']

    What kind of issue is this?

    • [ ] Question. Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'groovyx.android']

    • [ ] Bug report. Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'groovyx.android']

    • [ ] form https://github.com/moz1q1/SocksDroid

    • [ ] Feature Request. apply plugin: 'groovyx.android' classpath 'com.android.tools.build:gradle:3.0.0' //https://github.com/groovy/groovy-android-gradle-plugin // classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6' classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:2.0.1'

    opened by mosentest 3
  • Groovy error when using Mint Android SDK plugin and other libraries

    Groovy error when using Mint Android SDK plugin and other libraries

    EDIT: I modified my gradle to follow the instructions for "Use the Android SDK without MINT instrumentation" instead of "with" and it seems to be building now with no conflicts

    What kind of issue is this?

    • [ x] Bug report. If you’ve found a bug, spend the time to write a failing test. Bugs with tests get fixed. See here for some example tests.

    Hello,

    I am not sure if this is more Mint or Groovy related, but thought I would also try here - I am using the Mint SDK for my Android project per these instructions: https://docs.splunk.com/Documentation/MintAndroidSDK/5.2.x/DevGuide/AddSplunkMINTtoyourproject

    It has been working great. However, I am getting build errors in two cases that I believe are due to a line of code in the Mint SDK which is related to groovy. When I comment out "apply plugin: 'com.splunk.mint.gradle.android.plugin'" in my app level gradle, the app builds successfully.

    1. I imported a new module that utilizes Lambda expressions and Java 8.

    org.gradle.api.GradleException: The type java.lang.invoke.LambdaMetafactory cannot be resolved. It is indirectly referenced from required .class files at com.splunk.mint.gradle.android.AspectjCompile.compile(AspectjCompile.groovy:73)

    1. When I try to install Firebase Performance Monitoring:

    Expecting .,<, or ;, but found firebaseperf while unpacking <K:Ljava/lang/Object;>Lcom/google/android/gms/internal/firebase-perf/zzw<TK;>; org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':usbSerialExamples:compileDebugMINTInstrumentation'. at com.splunk.mint.gradle.android.AspectjCompile.compile(AspectjCompile.groovy:73) at

    opened by derrickrc 0
  • No Compilation Error, Can't debug

    No Compilation Error, Can't debug

    I am using this groovy plugin in Android Studio 2.3.3. It doesn't show any compilation error. Most of the times debug doesn't work. When it works, then I can't evaluate expression.

    opened by viratshukla 1
  • Build failure: signature-polymorphic method called without --min-sdk-version >= 26

    Build failure: signature-polymorphic method called without --min-sdk-version >= 26

    I am getting a strange bug when building, even with a fresh project. The error only occurs when groovy is being compiled. Here is the module's build.gradle:

    buildscript {
    	repositories {
    		jcenter()
    	}
    	
    	dependencies {
    		classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0'
    	}
    }
    
    apply plugin: 'com.android.application'
    apply plugin: 'groovyx.android'
    
    androidGroovy {
    	options {
    		configure(groovyOptions) {
    			javaAnnotationProcessing = true
    		}
    	}
    }
    
    android {
    	compileSdkVersion 25
    	buildToolsVersion "25.0.2"
    	defaultConfig {
    		applicationId "io.nwh.myapplication"
    		minSdkVersion 15
    		targetSdkVersion 25
    		versionCode 1
    		versionName "1.0"
    		testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    	}
    	buildTypes {
    		release {
    			minifyEnabled false
    			proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    		}
    	}
    }
    
    dependencies {
    	compile fileTree(dir: 'libs', include: ['*.jar'])
    	androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    		exclude group: 'com.android.support', module: 'support-annotations'
    	})
    	compile 'com.android.support:appcompat-v7:25.3.1'
    	testCompile 'junit:junit:4.12'
    	compile 'com.android.support.constraint:constraint-layout:1.0.2'
    	compile 'org.codehaus.groovy:groovy:2.4.7:grooid'
    }
    

    And here is the project's build.gralde:

    
    buildscript {
    	repositories {
    		jcenter()
    	}
    	dependencies {
    		classpath 'com.android.tools.build:gradle:2.4.0-alpha5'
    	}
    }
    
    allprojects {
    	repositories {
    		jcenter()
    	}
    }
    
    task clean(type: Delete) {
    	delete rootProject.buildDir
    }
    

    I am using Gradle version 3.4.1. Here is the output from building:

    $ gradle installDebug
    :app:preBuild UP-TO-DATE
    :app:resolveDebugDependencies
    :app:preDebugBuild
    :app:checkDebugManifest
    :app:prepareDebugDependencies
    :app:compileDebugAidl
    :app:compileDebugRenderscript
    :app:generateDebugBuildConfig
    :app:generateDebugResValues
    :app:handleDebugMicroApk
    :app:generateDebugResources
    :app:mergeDebugResources
    :app:processDebugManifest
    :app:processDebugResources
    :app:generateDebugSources
    :app:incrementalDebugJavaCompilationSafeguard
    :app:javaPreCompileDebug
    :app:compileDebugJavaWithJavac
    :app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
    :app:compileDebugGroovyWithGroovyc
    warning: [options] bootstrap class path not set in conjunction with -source 1.7
    1 warning
    :app:compileDebugNdk NO-SOURCE
    :app:compileDebugSources
    :app:mergeDebugShaders
    :app:compileDebugShaders
    :app:generateDebugAssets
    :app:mergeDebugAssets
    :app:transformClassesWithDexBuilderForDebug
    warning: Ignoring InnerClasses attribute for an anonymous inner class
                                                                          (groovyjarjarantlr.build.ANTLR$1) that doesn't come with an
    associated EnclosingMethod attribute. This class was probably produced by a
    compiler that did not target the modern .class file format. The recommended
    solution is to recompile the class from source, using an up-to-date compiler
    and without specifying any "-target" type options. The consequence of ignoring
    this warning is that reflective operations on this class will incorrectly
    indicate that it is *not* an inner class.
    Unable to pre-dex 'C:\Users\Nathan\.gradle\caches\modules-2\files-2.1\org.codehaus.groovy\groovy\2.4.7\b4b263e2106bac49c2eb21f6737f9b6e45e24a4a\groovy-2.4.7-grooid.jar' to 'C:\Users\Nathan\Documents\Flags2\app\build\intermediates\transforms\dexBuilder\debug\jars\40000\10\groovy-2.4.7-grooid_5a2004fbc80cc406e9adac10d01fb1c4aeb1d6e6.jar'
    Dex: Error converting bytecode to dex:WithDexBuilderForDebug
    Cause: signature-polymorphic method called without --min-sdk-version >= 26
        UNEXPECTED TOP-LEVEL EXCEPTION:
    signature-polymorphic method called without --min-sdk-version >= 26
    
    java.lang.RuntimeException: com.android.dx.cf.code.SimException: signature-polymorphic method called without --min-sdk-version >= 26
            at com.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:183)
            at com.android.builder.dexing.DexArchiveBuilder.processOutputs(DexArchiveBuilder.java:95)
            at com.android.builder.dexing.DexArchiveBuilder.convert(DexArchiveBuilder.java:78)
            at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransformCallable.lambda$cacheMissAction$0(DexArchiveBuilderTransformCallable.java:240)
            at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransformCallable$$Lambda$1022/1324664455.run(Unknown Source)
            at com.android.builder.utils.FileCache.lambda$createFile$1(FileCache.java:260)
            at com.android.builder.utils.FileCache$$Lambda$1033/1397556199.call(Unknown Source)
            at com.android.builder.utils.FileCache.lambda$null$5(FileCache.java:443)
            at com.android.builder.utils.FileCache$$Lambda$1089/840087435.accept(Unknown Source)
            at com.android.builder.utils.SynchronizedFile.doActionWithMultiProcessLocking(SynchronizedFile.java:265)
            at com.android.builder.utils.SynchronizedFile.write(SynchronizedFile.java:232)
            at com.android.builder.utils.FileCache.lambda$queryCacheEntry$6(FileCache.java:415)
            at com.android.builder.utils.FileCache$$Lambda$1037/1858463036.accept(Unknown Source)
            at com.android.builder.utils.SynchronizedFile.doActionWithMultiProcessLocking(SynchronizedFile.java:265)
            at com.android.builder.utils.SynchronizedFile.read(SynchronizedFile.java:215)
            at com.android.builder.utils.FileCache.queryCacheEntry(FileCache.java:391)
            at com.android.builder.utils.FileCache.createFile(FileCache.java:273)
            at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransformCallable.getFromCacheAndCreateIfMissing(DexArchiveBuilderTransformCallable.java:187)
            at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransformCallable.call(DexArchiveBuilderTransformCallable.java:149)
            at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransformCallable.call(DexArchiveBuilderTransformCallable.java:53)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: com.android.dx.cf.code.SimException: signature-polymorphic method called without --min-sdk-version >= 26
            at com.android.dx.cf.code.Simulator$SimVisitor.visitConstant(Simulator.java:684)
            at com.android.dx.cf.code.BytecodeArray.parseInstruction(BytecodeArray.java:764)
            at com.android.dx.cf.code.Simulator.simulate(Simulator.java:101)
            at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:790)
            at com.android.dx.cf.code.Ropper.doit(Ropper.java:745)
            at com.android.dx.cf.code.Ropper.convert(Ropper.java:350)
            at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:285)
            at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:141)
            at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:95)
            at com.android.builder.dexing.DexArchiveBuilderCallable.translateClass(DexArchiveBuilderCallable.java:87)
            at com.android.builder.dexing.DexArchiveBuilderCallable.call(DexArchiveBuilderCallable.java:70)
            at com.android.builder.dexing.DexArchiveBuilderCallable.call(DexArchiveBuilderCallable.java:40)
            ... 6 more
    :app:transformClassesWithDexBuilderForDebug FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
    > com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.builder.utils.FileCache$FileCreatorException: com.android.builder.dexing.DexArchiveBuilder$DexBuilderException: Unable to convert input to dex archive.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 7.949 secs
    

    I also tried copying the sample app and got the same error.

    opened by nathanwharvey 29
Releases(RELEASE_2_0_1)
  • RELEASE_2_0_1(Feb 19, 2019)

    • Fixed compilation issue where running with --debug would fail the build (#169)
    • Updated to use getJavaCompileProvider instead of deprecated getJavaCompile (#167)
    Source code(tar.gz)
    Source code(zip)
  • RELEASE_2_0_0(Nov 20, 2017)

  • RELEASE_1_2_0(Jun 7, 2017)

    • Added support for annotation processing (#142)
    • Disabled groovy task for when there are no groovy sources
    • Kotlin Support - Kotlin plugin applied before Groovy plugin will allow the Groovy compiler to know about the Kotlin source files. (#139)
    • Dropped (offical) support for Android Gradle Plugin Versions < 1.5.0. These plugins should continue to work but no intentional tests are being run to ensure continuing support in future releases.

    Binaries available here

    Source code(tar.gz)
    Source code(zip)
  • RELEASE_1_1_0(Sep 21, 2016)

  • RELEASE_1_0_0(Jun 24, 2016)

    • Completed docs and java docs.
    • Renamed plugin id from 'groovyx.grooid.groovy-android' to 'groovyx.android'
    • Renamed plugin name from 'groovy-android-gradle-plugin' to 'gradle-groovy-android-plugin'
    Source code(tar.gz)
    Source code(zip)
  • RELEASE_0_3_10(Mar 22, 2016)

  • RELEASE_0_3_9(Feb 29, 2016)

    • GroovyCompile's targetCompatibility and sourceCompatibility are automatically set based off of JavaCompile's
    • Custom groovy sourceSets added. Java directories may be used to java be joint compiled with groovy
    • Added flag in androidGroovy to skip JavaCompile and have GroovyCompile to all compilation.
    Source code(tar.gz)
    Source code(zip)
  • RELEASE_0_3_8(Feb 2, 2016)

  • RELEASE_0_3_7(Jan 13, 2016)

  • RELEASE_0_3_6(Jan 13, 2016)

  • RELEASE_0_3_5(Jan 21, 2015)

    • Moved to Groovy organization
    • renamed from 'me.champeau.gradle.groovy-android' to 'groovyx.grooid.groovy-android'
    • Support for plugin version 0.14
    • Support for plugin version 1.0.0
    • Add support for build type specific source directory
    Source code(tar.gz)
    Source code(zip)
  • RELEASE_0_3_4(Jan 21, 2015)

Owner
Groovy programming language
Groovy is an alternative language for the JVM with a concise Java-friendly syntax, dynamic and static features, powerful DSL capabilities
Groovy programming language
IntelliJ-based IDEs Protobuf Language Plugin that provides Protobuf language support.

IntelliJ Protobuf Language Plugin Reference Inspired by protobuf-jetbrains-plugin and intellij-protobuf-editor. Descriptor IntelliJ-based IDEs Protobu

Kanro 72 Dec 7, 2022
Gradle Replace In Place (GRIP): a gradle plugin to update your documentation or any file with a simple gradle task

GRIP (Gradle Replace In-Place) A gradle tool to update some values in your (documentation) files by running a task. (inspired by Knit) Directives Inse

Grégory Lureau 2 Oct 18, 2022
IntelliJ language plugin for the Kipper programming language 🦊

Kipper IntelliJ Plugin The language plugin for the Kipper programming language, which provides language support for the JetBrains IntelliJ platform. T

Luna 1 Jun 17, 2022
Ownership-gradle-plugin - Gradle code ownership verification plugin

Gradle code ownership verification plugin A gradle plugin that will verify owner

null 4 Dec 15, 2022
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.

Gradle Play Publisher Gradle Play Publisher is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and

null 3.9k Dec 30, 2022
Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Central, Corporate staging/snapshot servers and local Maven repositories).

GradleMavenPush Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Cen

 Vorlonsoft LLC 21 Oct 3, 2022
A Candid language plugin that provide a complete support to efficiently edit .did files.

IntelliJ Candid Language Plugin A Candid language plugin that provide a complete support to efficiently edit .did files. Candid is an interface descri

Maxime Bonvin 9 Dec 3, 2022
Gradle plugin which helps you analyze the size of your Android apps.

Ruler Ruler is a Gradle plugin which helps you analyze the size of your Android apps. Motivation App size is an important metric which directly correl

Spotify 913 Dec 28, 2022
IntelliJ plugin that provides some useful utilities to support the daily work with Gradle.

IntelliJ Gradle Utilities Plugin This IntelliJ plugin provides some useful utilities to support the daily work with Gradle. It's available on the offi

Marcel Kliemannel 6 Jul 29, 2022
A Leiningen plugin for building Clojure/Android projects

lein-droid A Leiningen plugin to simplify Clojure development for Android platform. It acts as a build-tool for Clojure/Android projects. Usage First

Clojure/Android 643 Dec 15, 2022
[Deprecated] Android Studio IDE support for Android gradle unit tests. Prepared for Robolectric.

#[Deprecated] Google has finally released a proper solution for unit testing. Therefore this plugin will no longer be activlty maintained. android-stu

Evan Tatarka 236 Dec 30, 2022
The soon-to-be-official plugin of V language for IntelliJ

intellij-vlang Template ToDo list Create a new IntelliJ Platform Plugin Template project. Get familiar with the template documentation. Verify the plu

Ned 11 Dec 29, 2022
Gradle plugin which downloads and manages your Android SDK.

DEPRECATED This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the

Jake Wharton 1.4k Dec 29, 2022
Add a different ribbon to each of your Android app variants using this gradle plugin. Of course, configure it as you will

Easylauncher gradle plugin for Android Modify the launcher icon of each of your app-variants using simple gradle rules. Add ribbons of any color, over

Mikel 960 Dec 18, 2022
A Gradle Plugin that removes unused resources in Android projects.

#Lint Cleaner Plugin Removes unused resources reported by Android lint including strings, colors and dimensions. Depracated As of Android Studio 2.0+

Marco RS 705 Nov 25, 2022
A Gradle plugin for providing your secrets to your Android project.

Secrets Gradle Plugin for Android A Gradle plugin for providing your secrets securely to your Android project. This Gradle plugin reads secrets from a

Google 560 Jan 8, 2023
A powerful Gradle Plugin to help you demonstrate your android app

English | 简体中文 sample-gradle-plugin ?? A powerful Gradle Plugin to help you demonstrate your android app. We often write demo applications that contai

Yoo Zhou 12 Nov 5, 2022
A Gradle plugin to report the number of method references in your APK on every build.

Dexcount Gradle Plugin A Gradle plugin to report the number of method references in your APK, AAR, or java module. This helps you keep tabs on the gro

Keepsafe 3k Dec 29, 2022