The latest Android Studio 0.2.8 (I/O Preview) is not compatible with the latest Kotlin 0.6.33 plugin -- am I missing something or is this a known problem?
It's a known problem. Will be addrest early next week. Sorry for the inconvenience
I ran into that issue yesterday, trying to install 0.6.69 (the first one with the gradle plugin working with android libs I believe). I managed to get a simple project working by installing version 0.6.319 of the kotlin plugin, and setting graddle to pick up 0.6.179 (the latest one in maven). I've had troubles with 0.6.179 with object classes (singletons) though, so if you are using that feature, this might not work for you. Maybe we could get 0.6.319 pushed to maven?
The latest one in Maven is 0.6.317, does that work?
I've never used Maven, have no idea how to install a plugin from it, sorry.
Yes, The 0.6.317 plugin installs fine, and it builds correctly. I haven't found any problem with that version yet.
If you are using Android Studio, you must be using gradle to build.
When you have something like this in you build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath ‘org.jetbrains.kotlin:kotlin-gradle-plugin:0.6.317’
classpath ‘com.android.tools.build:gradle:0.5.+’
}
}
It actually fetches the kotlin gradle plugin from maven.
Here’s an example of gradle.build using 0.6.317:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath ‘org.jetbrains.kotlin:kotlin-gradle-plugin:0.6.317’
classpath ‘com.android.tools.build:gradle:0.5.+’
}
}
apply plugin: ‘android’
apply plugin: ‘kotlin-android’
repositories {
mavenCentral()
}
android {
compileSdkVersion 17
buildToolsVersion “17.0.0”
defaultConfig {
minSdkVersion 14
targetSdkVersion 18
}
sourceSets {
main.java.srcDirs += ‘src/main/kotlin’
}
}
dependencies {
compile ‘com.android.support:support-v4:13.0.0’
compile ‘org.jetbrains.kotlin:kotlin-stdlib:0.6.317’
}
To install the plugin (what is going to be used to parse the files in studio), you have to first download it from the build server:
http://teamcity.jetbrains.com/repository/download/bt345/92304:id/kotlin-plugin-0.6.317.zip
Then, go to File/Settings/Plugins/Install plugin from disk and select the kotlin-plugin-0.6.317.zip that you just downloaded.
Restart Android Studio and you should be all set.
Thank you for your help, I followed your instructions blindly and have successfully compiled and run the Kotlin version of Hello World using Kotlin plugin 0.6.317 under Android Studio 0.2.8.
New plugin (0.6.350) deployed to the central plugin repository
Could we get 0.6.350 on maven then please? I like to have the build use the same version as the ide.
Deployment in progress