1

The error in the title appears in Android Studio as a warning bar above all my code: Error

Android Studio version: 1.1.0
Kotlin plugin version for Android Studio: 0.11.91.AndroidStudio.4
build.gradle file that seems to be using all the most recent versions of the Kotlin libraries:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "ca.amandeep.simpletransit"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile('com.squareup.retrofit:converter-simplexml:1.9.0') {
        exclude module: 'stax'
        exclude module: 'stax-api'
        exclude module: 'xpp3'
    }
    compile 'com.squareup.okhttp:okhttp:2.3.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
    compile 'com.google.guava:guava:18.0'
    compile 'com.facebook.stetho:stetho:1.0.1'
    compile 'com.facebook.stetho:stetho-okhttp:1.0.1'
    compile 'com.jakewharton.timber:timber:2.7.1'
    compile 'io.reactivex:rxkotlin:0.21.0'
    compile 'io.reactivex:rxandroid:0.24.0'
    compile 'com.github.techfreak:wizardpager:1.0.0'
}
buildscript {
    ext.kotlin_version = '0.11.91.1'
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
        classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
    }
}
repositories {
    mavenCentral()
}

apply plugin: 'com.jakewharton.hugo'
Amandeep Grewal
  • 1,801
  • 3
  • 19
  • 30

2 Answers2

1

I think they wrongly packaged this version. There is an issue about that on github :

https://github.com/ReactiveX/RxKotlin/issues/18

Maybe you should ping it.

tbruyelle
  • 12,895
  • 9
  • 60
  • 74
1

This issue was resolved with the RxKotlin release for Kotlin M12. And it is no longer a problem.

About the error message...

The "unsupported format" error comes when the ABI version number of the class files created by Kotlin does not match the expected used by the Kotlin compiler. This is no longer an issue with Kotlin 1.0 Betas since the ABI number will not change again for 1.0. But, there will be one forced recompile at 1.0 release candidate to ensure no old compiler bugs affect libraries or code and everything is rebuilt clean. Afterwards no issues such as this will exist.

Therefore if a library is not up to date with the same ABI, or hits this last "1.0 recompile" you may run into a similar error. The solution is always to find the updated library.

More about this in the Kotlin 1.0 Beta 4 announcement "What's Next" section:

After the Beta period is over, there will an RC and then 1.0.

We would really like to make sure that no code compiled with pre-release versions of Kotlin are kept around after 1.0, so the RC compiler will force recompilation of all the old code. We will coordinate with library maintainers outside JetBrains to make sure that all the widely-used libraries will be recompiled in time.

We’ll also take the opportunity to remove some legacy at this point:

  • remove all the deprecations that we have accumulated in the process of evolving our libraries,
  • remove all the deprecations from the generated code (you might not have heard of those, but they exist!),
  • get rid of some legacy bytecode peculiarities that were found during the beta,
  • move some of the stdlib code around so that the packages there have more structure.

After that point, the only compatible changes to the standard library are deprecations and additions (this does not include reflection APIs). We are running an open review for the library API to make sure we haven’t missed anything important.

Jayson Minard
  • 84,842
  • 38
  • 184
  • 227