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

Resolution of 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.

You develop an android application or you update your project. At runtime you encounter a major problem. The error message you find is as follows:

 

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

 

In our case, this error is caused when we initialize our view model with the new invocation method proposed by google.

 

private val viewModel: MainViewModel by viewModels ()

 

In this article we will give you the solution that allowed us to solve the problem.

 

How to install Mysql in ubuntu 20.04 lts

 

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 Click to tweet

 

 

 

Solution for 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

 

To solve this problem you have to modify the gradle. The problem seems to show us that there is a conflict of versions. In your gradle, edit the file to look like this.

 

compileOptions {sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8} kotlinOptions {jvmTarget = JavaVersion.VERSION_1_8}

 

Run the solution and the error should normally go away.

 

All In One WP Security - ERROR: Access from your IP address has been blocked for security reasons. Please contact the administrator

 

 

Subscribe to our newsletter

* Indicates required

 

Conclusion

 

You may be interested in Loss of internet connection as soon as you connect a bluetooth headset et Curved Space - now available on PC and consoles - 2021

 

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
Image by fotomecky from Pixabay

Leave comments

Your email address will not be published. Required fields are marked with *

seven + 15 =