1. 程式人生 > >AndroidStudio升級3.0後報錯,Annotation processors must be explicitly declared now

AndroidStudio升級3.0後報錯,Annotation processors must be explicitly declared now

報錯資訊顯示為butterknife的註解導致的

Error:Execution failed for task ':app:javaPreCompileDebug'.
> Annotation processors must be explicitly declared now.  The following dependencies on the compile classpath are found to contain annotation processor.  Please add them to the annotationProcessor configuration.
    - butterknife-7.0
.1.jar Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future. See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.

解決辦法:
在module的build.gradle新增一行配置即可

android {
    ...
    defaultConfig {
        ...
        //新增如下配置就OK了
        javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
    }
    ...
}

相關推薦

AndroidStudio升級3.0Annotation processors must be explicitly declared now

報錯資訊顯示為butterknife的註解導致的 Error:Execution failed for task ':app:javaPreCompileDebug'. > Annotation

Android Studio錯誤日誌-註解Annotation processors must be explicitly declared now.

contain pat rev ssp javac ase alter 配置 must 導入項目時,發現之前項目的butter knife報錯,用到註解的應該都會報錯Error:Execution failed for task ‘:app:javaPreCompileDe

vue-cli 3.0 建立的專案dev下能執行打包頁面空白

dev下執行時正常的,但在打包後就不正常了,如下圖報各種檔案找不到,原因是在html引入的img,js或css的路徑不對,如下:<link as=style href=/css/app.f9f2eaa0.css rel=preload> <link as=s

Python2.7升級3.0 HTMLTestrunner解決方法

html testrunner 無法運行 裝了python 3.0後會出現運行HTMLTestrunner報錯,因為裏面的腳本還是用的2.7版本上的 語法。現在將需要修改的地方總結如下: 打開你的HTMLTestruner.py文件:第94行,將import StringIO修改成import i

升級xcode 10:library not found for -lstdc++.6.0.9 && Multiple command

001 報錯 library not found for -lstdc++.6.0.9 因為專案中的sdk 需要 lstdc,但是xcode 10 升級後 刪除了該檔案 所以需要重新匯入這些檔案即可。 002 Multiple command Showi

php5.6編譯yaf3.0.6版本問題

tor set stream pointer 3.5 div tac highlight AC php5.6編譯yaf3.0.6 phpize 沒問題 ./configure --with-php-config=/usr/local/php5.6/bin/php-confi

ThinkPHP5.0網站模板檔案不存在:throw new TemplateNotFoundException('template not exists:' . $template, $te

ThinkPHP5.0網站報錯,模板檔案不存在   背景: 本地測試一切正常,網站上線後,提示模版檔案不存在,經過對“控制器”的除錯,可以確定是“指向”模板的程式碼存在異常 起初: //渲染 return $this->view->

原 AS升級3.1 編譯:The SourceSet 'instrumentTest' is not recognized by the Android Gradle Plugin.

AndroidStudio升級到3.1後編譯報錯:The SourceSet ‘instrumentTest’ is not recognized by the Android Gradle Plugin.專案中 gradle 配置sourceSets { main

Android開發:建立專案com.android.ide.common.process.ProcessException: Failed to execute aapt

情景:建立專案後報錯 com.android.ide.common.process.ProcessException:Failed to execute aapt 原因:在build.gradle檔案中, compileSdkVersion 和buildToolsVer

'com.android.tools.build:gradle:2.3.0' 版本解決Plugin used. Try disabling Instant Run (or updating. ..

今天下載路由框架原始碼進行閱讀的時候,gradle 報錯了,“Plugin used. Try disabling Instant Run (or updating either the IDE or the Gradle plugin to the latest vers

android studio 升級3.0,遇到的相關異常(6-7個bug)描述和解決辦法!

Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs fo

ASP.NET MVC修改名稱空間未能載入型別'WebApplication1.MvcApplication“

説明: この要求の処理に必要なリソースの解析中にエラーが発生しました。以下の解析エラーの詳細を確認し、ソース ファイルに変更を加えてください。 パーサー エラー メッセージ: 型 'WebApplic

Android Studio更新3.1

3.1 gradle 對依賴包及寄來工程的引用關鍵字發生改變:compile 改為 api,instrumentTest 改為 androidTest具體原因百度好了。https://www.jianshu.com/p/4e6bd83900b3升級3.1後build報錯,gr

paypal支付 上線(live)不能正確使用但沙盒模式下可正確使用

配置myapps後,使用Sandbox可正確的完成支付在應用上線後,myapps也就上線 應選擇為live選擇live後的clientId與 Secret進行程式碼的配置重要點要修改程式碼配置中的mod

pip更新到10.0 ImportError: cannot import name 'main'

ImportError: cannot import name ‘main’ pip更新很快,現在已經到了10.0版本了,有些庫需要用這個下載,但是很多朋友發現更新後一直報這個錯 ** Imp

Tomcat運行Annotation-specified bean name ‘KY_QT_T

Tomcat運行報錯Annotatio[org.springframework.web.context.ContextLoader]Context initialization failedorg.springframework.beans.factory.BeanDefinitionStoreExcepti

Tensorflow:ValueError: Stride must be > 0, but got 0 for '...' with input shapes: [...], [...]

完整錯誤報錯為:ValueError: Stride must be > 0, but got 0 for 'gradients/CON/de_conv8/conv2d_transpose_grad/Conv2D' (op: 'Conv2D') with input shapes: [96,1

python TypeError: string indices must be integers

info span 判斷 integer lte split error ret str 所以在讀取字典的時候,最好先判斷類型,然後再查看它是否已經有這樣的屬性: type(mydict) == type({}) #檢查不是字典 如果是字典,再看看有

Android studio 升級3.0各種解決方法

   最近把AS升級到3.2.1後老工程出現了一系列問題 總的來說, 不要隨便用最新的東西, SDK也好,AS也好,對老工程都不友好, 要等其他人躺坑躺的差不多再搞 我是先把gradle直接升級到了5.0, AS升級到了3.2.1 , SDK升到了28, 然後就

rabbitmq 3.7.0版本新增trace外掛新增以及解決方案(可用方案)

在建立rabbitmq叢集環境後,為了跟蹤訊息消費機制,新增了trace外掛,具體指令碼請參考: # 檢視已安裝的外掛 ./rabbitmq-plugins list ./rabbitmq-plugins enable rabbitmq_tracing ./rabbitmqctl trace