guava が 21.0 で Error:Error converting bytecode to dex: Cause: Dex cannot parse version 52 byte code.

ライブラリ群を更新していると

あやしい Project Structure ダイアログを Experimental にしてライブラリ更新を正しく把握する

ビルドできない...


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.

gradleコンソールを眺めていると以下を発見.


com/google/common/io/InsecureRecursiveDeleteException references unknown class: java/nio/file/FileSystemException

下げます guava.


//compile 'com.google.guava:guava:21.0'
compile 'com.google.guava:guava:20.0'

いけた.

Java7向けのセットが残ってるんかな.

Issues · google/guava

java - Android: Dex cannot parse version 52 byte code - Stack Overflow