android - Error converting bytecode to dex whilte running in real device -
i updated kolin version 1.1.4-2 , start running project in real device it's showing error ->
module:app build.gradle file add last time targetcompatibility in dependency it's not work @ all. whenever run in device it's showing above error->
apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compilesdkversion 26 buildtoolsversion "26.0.1" defaultconfig { applicationid "com.company.projectname" minsdkversion 17 targetsdkversion 26 versioncode 2 versionname "1.1" testinstrumentationrunner "android.support.test.runner.androidjunitrunner" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(include: ['*.jar'], dir: 'libs') androidtestcompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version" compile 'com.android.support:appcompat-v7:26.+' compile 'com.google.android.gms:play-services-ads:11.0.4' compile 'com.android.support.constraint:constraint-layout:1.0.2' testcompile 'junit:junit:4.12' } project build.gradle file ->
// top-level build file can add configuration options common sub-projects/modules. buildscript { ext.kotlin_version = '1.1.4-2' repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // note: not place application dependencies here; belong // in individual module build.gradle files } } apply plugin: 'kotlin' allprojects { repositories { jcenter() } } repositories { mavencentral() } compilekotlin { kotlinoptions { jvmtarget = "1.8" } } compiletestkotlin { kotlinoptions { jvmtarget = "1.8" } } please tell me how solve it.
the error tells change target , source compatibilities 1.7 in library's sub-module. why can't change that?
i think asks change this:
compilekotlin { kotlinoptions { jvmtarget = "1.8" } } compiletestkotlin { kotlinoptions { jvmtarget = "1.8" } } to this:
compilekotlin { kotlinoptions { jvmtarget = "1.7" } } compiletestkotlin { kotlinoptions { jvmtarget = "1.7" } } 
Comments
Post a Comment