gradle-android-scala-plugin icon indicating copy to clipboard operation
gradle-android-scala-plugin copied to clipboard

Error:No such property: bootClasspath for class: com.android.builder.core.AndroidBuilder

Open GildedHonour opened this issue 9 years ago • 14 comments

I have this error:

Error:No such property: bootClasspath for class: com.android.builder.core.AndroidBuilder

I can't compile it.

GildedHonour avatar Dec 17 '15 07:12 GildedHonour

up

GildedHonour avatar Dec 22 '15 15:12 GildedHonour

Any update on this? This is using com.android.tools.build:gradle:1.5.0

gpampara avatar Dec 23 '15 13:12 gpampara

I had to change the gradle version to 1.3.1

JRosanowski avatar Dec 24 '15 09:12 JRosanowski

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.

nexoscp avatar Feb 16 '16 14:02 nexoscp

This is a duplicate of #73

upsuper avatar Feb 21 '16 03:02 upsuper

Please update plugin on jcenter with latest android plugin support.

dkovalkov avatar Aug 04 '16 21:08 dkovalkov

Why is this issues still there?

ashwinbhaskar avatar Aug 07 '16 15:08 ashwinbhaskar

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.. :(

pblandford avatar Aug 08 '16 08:08 pblandford

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.

xelnaga avatar Aug 08 '16 11:08 xelnaga

That worked - many thanks!

pblandford avatar Aug 08 '16 13:08 pblandford

@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:
...
...

dvg4000 avatar Aug 31 '16 14:08 dvg4000

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 avatar Aug 31 '16 14:08 xelnaga

@xelnaga, thank you very much! it's working. :+1:

dvg4000 avatar Sep 01 '16 06:09 dvg4000

when I change to yours Got an ERROR Plugin with id 'jp.leafytree.android-scala' not found.

lioliy avatar Oct 16 '16 07:10 lioliy