Gradle 升级kapt“;数据绑定:编译器:XXX“-&燃气轮机;错误:找不到符号
Android Studio3.2,Gradle4.6 在我的build.gradle中:Gradle 升级kapt“;数据绑定:编译器:XXX“-&燃气轮机;错误:找不到符号,gradle,android-studio-3.0,Gradle,Android Studio 3.0,Android Studio3.2,Gradle4.6 在我的build.gradle中: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.BUTTER_KNIFE_VERSION = '8.8.1' ext.GLIDE_VERSION = '4.2.0' ext.KOTLIN_VER
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.BUTTER_KNIFE_VERSION = '8.8.1'
ext.GLIDE_VERSION = '4.2.0'
ext.KOTLIN_VERSION = '1.2.41'
ext.REALM_VERSION = '4.1.0'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "io.realm:realm-gradle-plugin:$REALM_VERSION"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
kapt "com.android.databinding:compiler:3.1.2"
kapt "com.android.databinding:compiler:3.1.4"
在我的应用程序/build.gradle中:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.BUTTER_KNIFE_VERSION = '8.8.1'
ext.GLIDE_VERSION = '4.2.0'
ext.KOTLIN_VERSION = '1.2.41'
ext.REALM_VERSION = '4.1.0'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "io.realm:realm-gradle-plugin:$REALM_VERSION"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
kapt "com.android.databinding:compiler:3.1.2"
kapt "com.android.databinding:compiler:3.1.4"
我的Android项目成功构建并运行。
很好
现在我升级到插件的最新版本:
buildscript {
ext.BUTTER_KNIFE_VERSION = '8.8.1'
ext.KOTLIN_VERSION = '1.2.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath "io.realm:realm-gradle-plugin:$REALM_VERSION"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
}
}
在app/build.gradle中:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.BUTTER_KNIFE_VERSION = '8.8.1'
ext.GLIDE_VERSION = '4.2.0'
ext.KOTLIN_VERSION = '1.2.41'
ext.REALM_VERSION = '4.1.0'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "io.realm:realm-gradle-plugin:$REALM_VERSION"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
kapt "com.android.databinding:compiler:3.1.2"
kapt "com.android.databinding:compiler:3.1.4"
项目成功生成,但运行项目时出现错误:
:app:kaptGenerateStubsDebugKotlin
e: myproject\app\build\generated\data_binding_base_class_source_out\debug\dataBindingGenBaseClassesDebug\out\com\myproject\databinding\AdvertisingBinding.java:25: error: cannot find symbol
protected AdvertisingBinding(DataBindingComponent _bindingComponent, View _root,
^
symbol: class DataBindingComponent
location: class AdvertisingBinding
我尝试了
使缓存无效/重新启动
,但没有帮助。相同的问题,没有解决yetI我突然遇到了相同的问题。指向导入语句的“错误:无法访问…”列表。Android Studio在使用Command-B时可以毫无问题地找到它们。