![](/img/trans.png)
[英]While I migrate from Android to AndroidX , Error in implementing google play services in my projects. What might be the solution?
[英]Error when I Migrate my project to androidx?
我成功地將我的項目遷移到 androidx。
在我構建我的項目后,它在構建文件夾中發生錯誤。
錯誤:
`D:\jp\ft\FileTransfer\app\build\generated\ap_generated_sources\debug\out\me\pengtao\filetransfer\MainActivity_ViewBinding.java:4: error: package android.support.annotation does not exist import android.support.注釋.CallSuper; ^ D:\jp\ft\FileTransfer\app\build\generated\ap_generated_sources\debug\out\me\pengtao\filetransfer\MainActivity_ViewBinding.java:5: error: package android.support.annotation does not exist import android.support.注釋.UiThread; ^
D:\jp\ft\FileTransfer\app\build\generated\ap_generated_sources\debug\out\me\pengtao\filetransfer\PopupMenuDialog_ViewBinding.java:4: error: package android.support.annotation does not exist import android.support.annotation .CallSuper; ^ D:\jp\ft\FileTransfer\app\build\generated\ap_generated_sources\debug\out\me\pengtao\filetransfer\PopupMenuDialog_ViewBinding.java:5: error: package android.support.annotation does not exist import android.support.注釋.UiThread; ^ D:\jp\ft\FileTransfer\app\build\generated\ap_generated_sources\debug\out\me\pengtao\filetransfer\MainActivity_ViewBinding.j ava:22:錯誤:找不到符號 @UiThread ^ 符號:class UiThread 位置:ZA2F2ED4F8EBC2CBB4C21A29DC40 MainActivity_ViewBinding 其中 T 是一個類型變量:T 擴展在 class MainActivity_ViewBinding 中聲明的 MainActivity
D:\jp\ft\FileTransfer\app\build\generated\ap_generated_sources\debug\out\me\pengtao\filetransfer\MainActivity_ViewBinding.j `ava:42: 錯誤:找不到符號@CallSuper ^ 符號:class CallSuper 位置:ZA2F2ED4F8EBC2CBB4C21A29DC40AB61 MainActivity_ViewBinding 其中 T 是一個類型變量:T 擴展在 class MainActivity_ViewBinding 中聲明的 MainActivity
D:\jp\ft\FileTransfer\app\build\generated\ap_generated_sources\debug\out\me\pengtao\filetransfer\PopupMenuDialog_ViewBin ding.java:25: error: cannot find symbol @UiThread ^ symbol: class UiThread location: class PopupMenuDialog_ViewBinding其中 T 是類型變量: T 擴展在 class PopupMenuDialog_ViewBinding 中聲明的 PopupMenuDialog
D:\jp\ft\FileTransfer\app\build\generated\ap_generated_sources\debug\out\me\pengtao\filetransfer\PopupMen
uDialog_ViewBinding.java:64: error: cannot find symbol
@CallSuper
^
symbol: class CallSuper
location: class PopupMenuDialog_ViewBinding<T>
where T is a type-variable:
T extends PopupMenuDialog declared in class PopupMenuDialog_ViewBinding
8 errors
> Task :app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 3m 33s
17 actionable tasks: 9 executed, 8 up-to-date
我該如何解決這個問題?
AndroidX 和 Butterknife 僅適用於 9.0.0-SNAPSHOT 或更高版本
您可以在 build.gradle 中更新您的定義,如下所示
butterknife : "com.jakewharton:butterknife:10.2.1",
butterknifeCompiler: "com.jakewharton:butterknife-compiler:10.2.1",
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.