I'm using this technique to make release builds ask for keystore passwords, but lately the Android Studio editor for build.gradle
complains:
Cannot resolve symbol 'groovy'
for the line:
import groovy.swing.SwingBuilder
It didn't used to complain. The command line build ./gradlew assembleRelease
still works. It's only AS that can't import groovy.
This is with Android Studio 2.3.1, Gradle 3.3, Android Gradle plugin 2.3.1.
Is there some AS configuration to make it happy?
Amazingly enough, the import error doesn't keep AS from making debug builds, and build.gradle doesn't try to use Swing in a debug build.
Starting with Gradle 6.x, gradle no longer embeds a copy of groovy-all
, so groovy-swing
is not included.
https://docs.gradle.org/current/userguide/upgrading_version_6.html#groovy_modularization
This can be solved by adding e.g. org.codehaus.groovy:groovy-swing:3.0.9
to your buildscript
in your top-level build.gradle
file.
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'org.codehaus.groovy:groovy-swing:3.0.9'
}
}
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