当前位置:网站首页>Kotlin之 Databinding 异常
Kotlin之 Databinding 异常
2022-07-07 02:14:00 【梦想改变生活】
最近在试用Kotlin +JetPack 组件开发项目,遇到一个比较奇怪的问题,就是在试用Databinding 的时候,编译文件时,没有任何报错,但是会出现BR 文件报错。查了官网原理是 Kotlin 在使用Databinding 的时候,需要配置kapt 插件。
Error:(6, 26) Unresolved reference: databinding
解决办法:
1、project build.gradle 中配置:
buildscript {
ext.kotlin_version ='1.7.0'
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.2"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url 'https://jitpack.io' }
}
}
//核心:
ext.kotlin_version ='1.7.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0"
2、app build.gradle 中配置:
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
kapt {
generateStubs = true
}
搞定收工,还有问题请留言~
边栏推荐
- dolphinscheduler3. X local startup
- Knight defeats demon king (Backpack & DP)
- 基本Dos命令
- 693. Travel sequencing
- Unable to debug screen program with serial port
- What are the classic database questions in the interview?
- 微信小程序隐藏video标签的进度条组件
- 博士申请 | 上海交通大学自然科学研究院洪亮教授招收深度学习方向博士生
- LM small programmable controller software (based on CoDeSys) Note 23: conversion of relative coordinates of servo motor operation (stepping motor) to absolute coordinates
- uniapp开发小程序如何使用微信云托管或云函数进行云开发
猜你喜欢

ICML 2022 | explore the best architecture and training method of language model

LM small programmable controller software (based on CoDeSys) Note 23: conversion of relative coordinates of servo motor operation (stepping motor) to absolute coordinates
![[opencv] morphological filtering (2): open operation, morphological gradient, top hat, black hat](/img/45/f3b960e3c56f50674b0e6374cba705.png)
[opencv] morphological filtering (2): open operation, morphological gradient, top hat, black hat

JWT 认证

Doctoral application | Professor Hong Liang, Academy of natural sciences, Shanghai Jiaotong University, enrolls doctoral students in deep learning

2022 Android interview essential knowledge points, a comprehensive summary

【OpenCV】形态学滤波(2):开运算、形态学梯度、顶帽、黑帽
![[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)](/img/77/bd80ed602208be6a9ef8be60c6ad06.png)
[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)

Developers don't miss it! Oar hacker marathon phase III chain oar track registration opens

Several key steps of software testing, you need to know
随机推荐
力扣62 不同路径(从矩阵左上到右下的所有路径数量) (动态规划)
MySQL卸载文档-Windows版
3531. Huffman tree
安装mongodb数据库
C面试24. (指针)定义一个含有20个元素的double型数组a
雷特智能家居龙海祁:从专业调光到全宅智能,20年专注成就专业
字符串常量与字符串对象分配内存时的区别
Calculation model FPS
How to keep accounts of expenses in life
Redis (II) - redis General Command
UIC(组态UI工程)公版文件库新增7款行业素材
Qtthread, one of many methods of QT multithreading
直击2022ECDC萤石云开发者大会:携手千百行业加速智能升级
Test the foundation of development, and teach you to prepare for a fully functional web platform environment
哈趣投影黑马之姿,仅用半年强势突围千元投影仪市场!
Tkinter window selects PCD file and displays point cloud (open3d)
tkinter窗口选择pcd文件并显示点云(open3d)
「解析」FocalLoss 解决数据不平衡问题
C language interview to write a function to find the first public string in two strings
c语言(结构体)定义一个User结构体,含以下字段: