在接入的MQTT项目中,使用的语音播报的播放器是需要java8支持的,在低版本的手机上运行是没有什么问题出现,但是在高版本的手机上一运行就报错了,错误如下:
Error:警告: [options] 未与 -source 1.7 一起设置引导类路径
注: [1] Wrote GeneratedAppGlideModule with: []
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithInstantRunForFengniaoDebug'.
> com.android.build.api.transform.TransformException: java.lang.SecurityException: java.lang.SecurityException: SHA-256 digest error for org/eclipse/paho/client/mqttv3/MqttMessage.class
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 37s
问题分析:
出现了这个问题的根本原因是sdk本身的bug,只能从其他方面是解决。
解决方案:
在项目的setting中,修改instance run的设置,修改如下图所示:
如果有勾选了箭头所指的选项,取消掉即可。这可以解决这个错误的问题,但是我觉得这不是最好的解决方法,如果有其他更好的解决方法,欢迎各位评论指出,谢谢。