Error:FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:t

今日份遇到的 bug :

Error:注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithInstantRunForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Failed to find byte code for android/view/View$OnScrollChangeListener

* 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 35s

经过一番努力之后,bug变成了这样。。。:

Error:FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithInstantRunForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Failed to find byte code for android/view/View$OnScrollChangeListener

* 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 29s

最后还是被我弄好了;

下面给出我简单暴力的方法,打开项目的 gradle,如下图:

将 gradle 降低版本即可,我是改为了 gradle:3.0.1 编译就好了。如果不知道改为哪个版本,就新建一个项目,看看是什么版本的,直接改为相应的版本即可。

还有一种解决方法,就是升级 gradle ,费时,想要了解的点击下面的链接:https://blog.csdn.net/wuqingsen1/article/details/84189995

猜你喜欢

转载自blog.csdn.net/wuqingsen1/article/details/84190093
今日推荐