大佬教程收集整理的这篇文章主要介绍了删除 LeakCanary 反编译不相关的库文件,将文件从 .kt 转换为 .class,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图清理我的代码,因为 LeakCanary 库暴露了一些我无意中使用“@NotNull”而不是“@NonNull”的安卓注释。
当我清理完类(比如 30 多个类......)时,我完全删除了库:
// deBUGImplementation 'com.squareup.leakcanary:leakcanary-androID:2.5'
然后一个名为 CalendarVIEw.kt
https://github.com/kizitonwose/CalendarView.git(一个不错的可定制日历)的无关库(完全用 Kotlin 编写)的主 .kt 文件变为 CalendarVIEw.class
并且下面的消息出现在现在已转换的班级的顶部。
// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available
现在代码不起作用了。
编译器给我的错误如下:
class file for kotlin.jvm.functions.Function1 not found
整个错误:
ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1D:\Projects\....java:143: error: cAnnot access Function1
calendarVIEw.get().setMonthScrollListener(
^
class file for kotlin.jvm.functions.Function1 not found
如果我重新激活 LeakCanary 库,问题就会消失。
我真的不明白发生了什么......请帮忙!!
Tools > Kotlin > Configure Kotlin in Project > Android with Gradle and choose your Java module with Single module radio button SELEcted then SELEct your version and OK
我真的不知道,我的猜测是我开始使用 CalendarView 库,在我实现 LeakCanary 之后,所以没有出现错误。
鉴于我的环境并未真正准备好处理 Kotlin,LeakCanary 库修补了一些要求,因此,新的 CalendarView 库开始使用 LeakCanary 库中的那些依赖项。
以上是大佬教程为你收集整理的删除 LeakCanary 反编译不相关的库文件,将文件从 .kt 转换为 .class全部内容,希望文章能够帮你解决删除 LeakCanary 反编译不相关的库文件,将文件从 .kt 转换为 .class所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。