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

Résolution de 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.

Vous développez un application android ou vous mettez votre projet à jour. A l’exécution vous rencontrez un problème de taille. Le message d’erreur que vous trouvez c’est la suivante :

 

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

 

Dans notre cas, cette erreur est provoquée lorsqu’on initialise notre view model avec la nouvelle méthode d’invocation proposée par google.

 

private val viewModel : MainViewModel by viewModels()

 

Dans cet article nous allons vous donner la solution qui nous a permis de résoudre le problème.

 

Comment installer Mysql dans 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 Cliquez pour tweeter

 

 

 

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

 

Pour résoudre ce problème il faut modifier le fichier gradle . Le problème semble nous montrer qu’il ya conflit de versions . Dans votre gradle, modifiez le fichier pour qu’il ressemble à ceci.

 

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = JavaVersion.VERSION_1_8
}

 

Exécutez la solution et l’erreur devrais normalement disparaître.

 

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

 

 

Abonnez vous à notre newsletter

* indicates required

 

Conclusion

 

Vous serez peut être intéressé par Perte de connexion internet dès qu’on connecte un casque bluetooth et Curved Space -maintenant disponible sur PC et 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 par fotomecky de Pixabay

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

un × deux =