亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將 Kotlin 文件添加到舊的 android java 項目?

如何將 Kotlin 文件添加到舊的 android java 項目?

慕尼黑5688855 2021-12-22 18:50:10
我正在嘗試基于 ODK Collect 構建一個 android 應用程序。ODK Collect 應用程序是用 Java 編寫的。我想使用 Kotlin 進行開發。我使用 android studio 新活動向導添加了一個基于 Kotlin 的空活動。當我嘗試編譯時,出現以下錯誤;Executing tasks: [:collect_app:assembleDebug]> Configure project :collect_appCould not find google-services.json while looking in [src/nullnull/odkCollectRelease, src/odkCollectRelease/nullnull, src/nullnull, src/odkCollectRelease, src/nullnullOdkCollectRelease]registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)collect_app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.google.dagger:dagger-android-processor:2.16', 'com.google.dagger:dagger-compiler:2.16', 'com.jakewharton:butterknife-compiler:8.8.1', 'com.google.dagger:dagger-compiler:2.16'.'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin'kapt.generateStubs' is not used by the 'kotlin-kapt' pluginODK 收集應用程序:https : //github.com/opendatakit/collect
查看完整描述

2 回答

?
Smart貓小萌

TA貢獻1911條經驗 獲得超7個贊

此問題已在 Kotlin 版本 1.3.20 中修復。


查看完整回答
反對 回復 2021-12-22
?
夢里花落0921

TA貢獻1772條經驗 獲得超6個贊

這里有一些事情可以嘗試在每個之后重建。讓我知道事情的后續。

嘗試單擊工具菜單 -> Kotlin -> 在項目中配置 Kotlin。

嘗試點擊工具菜單 -> Kotlin -> 配置 Kotlin 插件更新

嘗試添加

apply plugin: 'kotlin-kapt'

嘗試單擊文件 -> 使緩存無效/重新啟動

更新 添加到 build.gradle

kapt { generateStubs = true }


查看完整回答
反對 回復 2021-12-22
  • 2 回答
  • 0 關注
  • 203 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號