java - 将 weka 与 android 一起使用时出现错误
问题描述
我试图用 android 添加 weka 但得到了这些错误。我应该说,当我运行包含我所有 weka 代码的类时,它运行得很好,但是当我使用其中一个活动调用这个类时,我得到了错误。
Invoke-customs 仅支持从 Android O (--min-api 26) 开始 Message{kind=ERROR, text=Invoke-customs 仅支持从 Android O (--min-api 26), sources=[Unknown source文件],工具名称=Optional.of(D8)}
我寻找了一个解决方案,我发现您必须将这些行放入 gradle
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
当我这样做时,错误已更改为:
引起:java.lang.IllegalAccessException:没有这样的方法:weka.gui.SimpleCLIPanel.lambda$initFinish$0()void/invokeSpecial
引起:java.lang.VerifyError:操作数堆栈上的类型错误
这是 gradle 中的整个 android 块
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
}
}
请问有什么帮助吗?
解决方案
推荐阅读
- .net - 检查文本框文本是否为某个文本
- linux - Docker/Rails - 权限被拒绝@rb_sysopen
- google-api - 有没有办法导出/下载/克隆自定义 Google 助理操作(如 .zip)?
- python - numpy.histogram 返回值的大小不同
- r - 使用大数据帧提高 foreach %dopar% 循环速度的方法
- css - Webpack 提取-css-chunks-webpack-plugin
- url - 如何将 URL 参数/变量添加到 Google 自定义搜索引擎结果
- azure - 当用户尝试使用 Azure 访问静态网站/CDN 的根域时,如何强制执行 WWW
- c - 构建 pslib 代码是否需要参数?
- python - 通过代码和激活链接验证电子邮件地址的优缺点是什么。姜戈