61
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper ‘-jvm-target’ option

Last updated at Posted at 2019-10-09

AndroidStudioでの勉強中、以下のエラーが出て困ったので忘れないようにまとめ。

Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper ‘-jvm-target’ option

##設定変更
メニューバーより、「Android Studio」→「Preferences」で表示される設定画面の
「Kotlin Compiler」にあるTarget JVM version を1.8に
スクリーンショット 2019-10-09 10.34.02.png

……ただ、この方法だとうまく行かない。

##build.gradleファイル変更
build.gradle(Module: app)のandroid部分に以下を追記

    kotlinOptions {
        jvmTarget = '1.8'
    }

追加したら、右上に表示される「Sync Now」を押下。
スクリーンショット 2019-10-09 10.49.37.png

こっちならできた!

###参考
https://android.benigumo.com/20190731/cannot-inline-bytecode-built-with-jvm-target-1-8-into-bytecode-that-is-being-built-with-jvm-target-1-6-please-specify-proper-jvm-target-option/

61
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
61
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?