Tencent / tinker

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.
Other
17.11k stars 3.33k forks source link

找不到com.tencent.tinker.anno.Keep的类文件 #1510

Closed Nccssa closed 3 years ago

Nccssa commented 3 years ago

Issue/提问须知

在提交issue之前,我们应该先查询是否已经有相关的issue以及常见问题。提交issue时,我们需要写明issue的原因,以及编译或运行过程的日志(加载进程以及Patch进程)。issue需要以下面的格式:


异常类型:编译异常

tinker版本:1.9.14.10

gradle版本:5.4.1

是否使用热更新SDK: 如 TinkerPatch SDK 或者 Bugly SDK

系统:如:Mac

堆栈/日志:

> Task :app:compileDebugJavaWithJavac FAILED
Gradle may disable incremental compilation as the following annotation processors are not incremental: tinker-android-anno-1.9.14.10.jar (com.tencent.tinker:tinker-android-an
no:1.9.14.10).
Consider setting the experimental feature flag android.enableSeparateAnnotationProcessing=true in the gradle.properties file to run annotation processing in a separate task a
nd make compilation incremental.
错误: 无法访问Keep
  找不到com.tencent.tinker.anno.Keep的类文件
1 个错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Yinzeyu commented 3 years ago

需要添加 api('com.tencent.tinker:tinker-android-anno-support:1.9.14.10') 解决 找不到com.tencent.tinker.anno.Keep的类文件 问题

Nccssa commented 3 years ago

需要添加 api('com.tencent.tinker:tinker-android-anno-support:1.9.14.10') 解决找到com.tencent.tinker.anno.Keep的类文件问题

感谢回复, image在库文件里也没有发现

Yinzeyu commented 3 years ago

anno 里面没有 必须得是anno-support 才有

Nccssa commented 3 years ago

anno里面没有必须得是anno-support才有

api("com.tencent.tinker:tinker-android-lib:${TINKER_VERSION}") { changing = true }
api("com.tencent.tinker:tinker-android-loader:${TINKER_VERSION}") { changing = true }
annotationProcessor("com.tencent.tinker:tinker-android-anno-support:${TINKER_VERSION}") { changing = true }
compileOnly("com.tencent.tinker:tinker-android-anno-support:${TINKER_VERSION}") { changing = true }

已可以正常引用,另外一个问题是 没有自动生成InCallApplication 类(使用 Rebulid Project)

企业微信截图_16111370087616

这个感觉是 SampleApplicationLike 没有使用,onBaseContextAttached 方法没有执行。