AndroidStudioのKotlinバージョンアップ?でビルドは通るけどテストしようとすると落ちるように……

Actorの話をする予定だったのがupdateのサジェスチョンをホイホイ通したらスクリーンショットをとろうとして起動するとエラーを吐くように。

 

エラーメッセージは以下

Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
...while parsing kotlin/collections/CollectionsJRE8Kt.class

 

build.gradleがjre8だと失敗するのでjre7を指定すれば直る

// compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

 

本来のネタはまた明日…