Last updated June 27, 2023 at 08:09 AM
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.
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.
ON THE SAME TOPIC
- 10 free software to learn to type quickly on the keyboard
- The class AppComponent is listed in the declarations of the NgModule AppModule, but is not a directive, a component, or a pipe
- 14 of the world's greatest programmers from the dawn of computing until today
- Never lose your subscriptions again with Password Manager
- Is your wireless mouse not working? Here are 4 really simple solutions to follow to fix the problem – Troubleshooting
- Tux Typing: the educational game that turns learning the keyboard into an adventure!
- Cash register – The essential solution to better manage your business
- Rent or buy your computer? possibility of renting with option to buy
- Become a good programmer: The keys to excel in the different fields of programming!
- The 10 things that annoy PC users the most
- Tizen OS – 12 Things You (Maybe) Didn't Know About This System
- HP All-in-One Desktop PC: The All-in-One Computer Starts Up but the Screen Displays Nothing
- Git linking local repository to remote repository – How to link your local repository to the remote repository to protect your project.
- 8 Examples of Infamous Malware
- Y2MATE – youtube video downloader and converter
- mbind: Operation not permitted – mysql – troubleshooting