不工作:Android Studio 3.2 Canary11 + 3.2.0-alpha11 for kapt with com.android.databinding
Posted
技术标签:
【中文标题】不工作:Android Studio 3.2 Canary11 + 3.2.0-alpha11 for kapt with com.android.databinding【英文标题】:Not work: Android Studio 3.2 Canary11 + 3.2.0-alpha11 for kapt with com.android.databinding 【发布时间】:2018-09-29 03:31:07 【问题描述】:android Studio 3.2 Canary11
Gradle 工具 3.2.0-alpha11
kapt 的 com.android.databinding 不适用于 3.2.0-alpha11,无法构建/运行 apk。
同时,它最大适用于 3.2.0-alpha10
``` 任务 ':app:kaptGenerateStubsDevDebugKotlin' 执行失败。
无法解析配置“:app:kapt”的所有文件。 找不到 com.android.databinding:compiler:3.2.0-alpha11。 在以下位置搜索: 文件:/Users/xxxx/Library/Android/sdk/extras/m2repository/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom 文件:/Users/xxx/Library/Android/sdk/extras/m2repository/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar 文件:/Users/xxx/Library/Android/sdk/extras/google/m2repository/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom 文件:/Users/xxx/Library/Android/sdk/extras/google/m2repository/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar 文件:/Users/xxx/Library/Android/sdk/extras/android/m2repository/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom 文件:/Users/xxx/Library/Android/sdk/extras/android/m2repository/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://jcenter.bintray.com/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://jcenter.bintray.com/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://repo.maven.apache.org/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://repo.maven.apache.org/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://dl.google.com/dl/android/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://dl.google.com/dl/android/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://jcenter.bintray.com/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://jcenter.bintray.com/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://repo.maven.apache.org/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://repo.maven.apache.org/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://dl.google.com/dl/android/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://dl.google.com/dl/android/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://jcenter.bintray.com/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://jcenter.bintray.com/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://repo.maven.apache.org/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://repo.maven.apache.org/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://dl.google.com/dl/android/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://dl.google.com/dl/android/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://jcenter.bintray.com/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://jcenter.bintray.com/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://maven.fabric.io/public/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://maven.fabric.io/public/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar https://repo.maven.apache.org/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.pom https://repo.maven.apache.org/maven2/com/android/databinding/compiler/3.2.0-alpha11/compiler-3.2.0-alpha11.jar 要求: 项目:应用程序 ```
issues
【问题讨论】:
【参考方案1】:删除这一行
kapt 'com.android.databinding:compiler:3.2.0-alpha10'
【讨论】:
【参考方案2】:如果我删除了数据绑定的依赖,它就可以工作。 结案
不再需要链接com.android.databinding:compiler
,因为是android gradle插件版本,会自动导入。
【讨论】:
这是真的吗?因为如果我不添加依赖,它不会为绑定适配器生成BR
类。以上是关于不工作:Android Studio 3.2 Canary11 + 3.2.0-alpha11 for kapt with com.android.databinding的主要内容,如果未能解决你的问题,请参考以下文章
Android Studio 3.2 Preview 中的导航预览不可用
Android Studio 3.2 上的 AndroidX - 运行应用程序时出现验证错误
导入项目(Eclipse ADT、Gradle 等)选项在 Android Studio 2.3.2 中不退出