gradle-android-scala-plugin
gradle-android-scala-plugin copied to clipboard
Error:No such property: bootClasspath for class: com.android.builder.core.AndroidBuilder
I have this error:
Error:No such property: bootClasspath for class: com.android.builder.core.AndroidBuilder
I can't compile it.
up
Any update on this? This is using com.android.tools.build:gradle:1.5.0
I had to change the gradle version to 1.3.1
Property "bootClasspath" doesn't exist anymore. Instead there is an helper method with the same name but different signature:
https://android.googlesource.com/platform/tools/build/+/master/builder/src/main/java/com/android/builder/AndroidBuilder.java
static List<String> getBootClasspath(SdkParser sdkParser)
a SdkParser instance could be retrieved via
https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/BasePlugin.groovy#316 getSdkParser()
A change in
https://github.com/saturday06/gradle-android-scala-plugin/blob/master/src/main/groovy/jp/leafytree/gradle/AndroidScalaPlugin.groovy#L216
from
scalaCompileTask.classpath = javaCompileTask.classpath + project.files(androidPlugin.androidBuilder.bootClasspath)
to
scalaCompileTask.classpath = javaCompileTask.classpath + project.files(AndroidBuilder.getBootClasspath(androidPlugin.sdkParser))
should do the trick.
This is a duplicate of #73
Please update plugin on jcenter with latest android plugin support.
Why is this issues still there?
I can see a fix has been committed a while back but it it going to released soon? I'm stuck using gradle 1.3.1 till this is resolved.. :(
Unsure where the original author of the plugin is, but the pull request / fork below contains some tweaks to make the plugin work with the current android studio (2.1.2) and the version of gradle it uses (2.10)
https://github.com/saturday06/gradle-android-scala-plugin/pull/87 https://github.com/xelnaga/gradle-android-scala-plugin
You can checkout the source to your local machine and build the jar yourself with ./gradle clean assemble
Copy the jar produced to your project lib directory and add it as a library dependency in your root build.gradle as below:
` dependencies {
classpath 'com.android.tools.build:gradle:2.1.2',
fileTree(dir: 'lib', include: ['gradle-android-scala-plugin-1.5-SNAPSHOT.jar'])
}
`
Im using it with the latest build tools and Android studio just fine.
That worked - many thanks!
@xelnaga, @pblandford, could you please show how build.gradle and app/build.gradle should look like?
with such files:
build.gradle (root)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2',
fileTree(dir: 'app/libs', include: ['gradle-android-scala-plugin-1.5-SNAPSHOT.jar'])
}
}
allprojects {
repositories {
jcenter()
}
}
and app/build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:2.1.2"
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.5-SNAPSHOT"
}
}
apply plugin: 'com.android.application'
apply plugin: 'jp.leafytree.android-scala'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
...
...
i'm getting error:
Error:Could not find jp.leafytree.gradle:gradle-android-scala-plugin:1.5-SNAPSHOT.
Searched in the following locations:
...
...
You should not have the buildscript block in app/build.gradle at all.
The remainder looks correct, but you should obviously have the jar at whatever location your fileTree is specifying.
Be advised that latest Android Studio 2.1 release unfortunately does not play nice with Scala due to an incompatibility between the Gradle version's scala code and the IntelliJ version they are using for that release.
I've worked around the issue by going straight to the Android Studio 2.2 beta 3 release using the changes I've made on this branch.
https://github.com/xelnaga/gradle-android-scala-plugin/tree/2.2
My gradle files look like the following...
/build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-beta3',
fileTree(dir: 'lib', include: ['gradle-android-scala-plugin-2.2-SNAPSHOT.jar'])
}
}
allprojects {
repositories {
jcenter()
}
} ...
app/build.gradle
apply plugin: 'com.android.application' apply plugin: 'jp.leafytree.android-scala'
repositories {
maven {
url "https://jitpack.io"
}
maven {
url "http://jcenter.bintray.com"
}
}
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
....
Those repos may not necessarily be needed.
The gradle version now used is 2.14.1
@xelnaga, thank you very much! it's working. :+1:
when I change to yours Got an ERROR Plugin with id 'jp.leafytree.android-scala' not found.