Errors when using weka with android

不羁岁月 提交于 2019-12-11 07:20:04

问题


I tried to add weka with android but got these errors. I should say that when I run the class that contain all my weka code it runs perfectly but when I call this class using one of the activity I get the errors.

Invoke-customs are only supported starting with Android O (--min-api 26) Message{kind=ERROR, text=Invoke-customs are only supported starting with Android O (--min-api 26), sources=[Unknown source file], tool name=Optional.of(D8)}

I looked for a solution i found that you have to put these lines in gradle

        android { 
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}

when I did so the error has changed to :

Caused by: java.lang.IllegalAccessException: no such method: weka.gui.SimpleCLIPanel.lambda$initFinish$0()void/invokeSpecial

Caused by: java.lang.VerifyError: Bad type on operand stack

this is the whole android block in gradle

android {

compileSdkVersion 28
defaultConfig {
    applicationId "com.example.sulimanhassan.fakenewsdetection"
    minSdkVersion 15
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

Any help please ?

来源:https://stackoverflow.com/questions/53419376/errors-when-using-weka-with-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!