- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我现在面临一个问题超过 3 天,我无法解决。
自从我开始在 Android 上使用 Kotlin,我停止使用“annotationProcessor”并开始使用“kapt”,直到我开始构建一个 Android Instant App,当我将“kapt”添加到像 Glide 这样的任何依赖项时,所有的东西都可以很好地使用 kapt或 ButterKnife Gradle 总是显示找不到方法 kapt() 的错误
Could not find method kapt() for arguments [com.github.bumptech.glide:compiler:4.7.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.demo.instantapptest.app"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation project(':feature')
implementation project(':base')
}
apply plugin: 'com.android.feature'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
baseFeature true
defaultConfig {
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
api 'com.android.support:appcompat-v7:28.0.0'
api 'com.android.support.constraint:constraint-layout:1.1.3'
application project(':app')
feature project(':feature')
implementation "android.arch.lifecycle:extensions:1.1.1"
kapt "android.arch.lifecycle:compiler:1.1.1"
implementation 'com.github.bumptech.glide:glide:4.7.1'
kapt 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.google.dagger:dagger:2.15.0'
kapt 'com.google.dagger:dagger-compiler:2.15.0'
implementation 'com.jakewharton:butterknife:9.0.0-rc2'
kapt 'com.jakewharton:butterknife-compiler:9.0.0-rc2'
}
apply plugin: 'com.android.feature'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation project(':base')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.android.instantapp'
dependencies {
implementation project(':feature')
implementation project(':base')
}
apply plugin: 'kotlin-android'
最佳答案
就我而言,我失踪了
apply plugin: 'kotlin-kapt'
关于android - 找不到参数的方法 kapt(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53823451/
我最近从 Android Studio 2.3 更新到 3.0,和 kotlin 1.1.4 到 1.1.51。 现在我在我的 gradle 控制台中看到了这条消息: 'kapt.generateSt
我对 Android 中引入的与 Kotlin 相关的最新注释处理器有点困惑,它是 “卡普特” 问题 : 什么是 kapt(kotlin 注释处理工具)及其用例? 或者什么 apply plugin:
我使用 Algolia 开发了一个带有搜索界面的 Android 应用程序。 为此,我遵循本指南 InstantSearch但是当我添加 kapt "androidx.lifecycle:lifecy
昨天,我的 Android Studio 无缘无故开始显示以下消息: Gradle sync failed: org/jetbrains/kotlin/kapt/idea/KaptGradleMode
我的项目之前一直运行良好,直到我升级到 API 28并重构为 Androidx .首先我认为我必须解决问题代码,因为重构后 Unresolved reference 代码太多。在我解决了很多问题后,我
出于某种原因,Kapt 提示我的一个模块上没有启用增量编译。但是,我认为没有理由不应该这样做。 运行 core:kaptKotlin 时的警告信息 [WARN] Incremental annotat
我决定在 android 中启动一个项目,目前我遇到了这个错误。我有另一个由必须匹配 gradle 版本的数据绑定(bind)依赖项产生的。修复该问题后,当我尝试构建我的项目时,我仍然收到这个其他错误
我现在面临一个问题超过 3 天,我无法解决。 自从我开始在 Android 上使用 Kotlin,我停止使用“annotationProcessor”并开始使用“kapt”,直到我开始构建一个 And
我在我的 android 应用程序中使用 dagger2。即使没有错误,它也不会生成 Dagger 组件类。 我在设置中启用了注释处理器并重新启动了我的 android studio,但这对我不起作用
我已经使用 kapt 编写了一个代码生成器,并在使用 maven 编译 kotlin 的项目中使用它。 我发现在 Kotlin 的编译阶段之后调用了 kapt 生成器,这使我无法在同一项目中使用 ko
我看过 this answer和本网站上的其他人并使用谷歌,但我还没有找到适合这个问题的答案。这是最新版本的 KAPT 列出的剩余非增量注释处理器: Incremental annotation pr
我尝试使用 kapt和 vertx-Codegen生成我的服务。但输出路径是 /build/generated/source/kapt/main/ .我要 /src/main/generated/ .
我不明白为什么 kotlin 注释处理器无法解析这些参数。 我的 build.gradle.kts 的相关部分 plugins { id("kotlin-kapt") } android {
在 Kotlin 1.3.30 中添加了对增量注释处理的支持:https://blog.jetbrains.com/kotlin/2019/04/kotlin-1-3-30-released/ 根据文
我正在使用 Kotlin、Databinding 和 Room 开发一个 android 项目。 有时构建失败并显示错误消息,其中不包含有关究竟出了什么问题的信息,除了它与注释处理器有关(可能有很多原
我有以下项目结构 root-project │ build.gradle.kts │ └───multiplatform-project │ │ build.gradle.kts │
当我尝试使用 dagger 2 构建项目时,出现 ArrayIndexOutOfBoundsException , Kotlin Coroutines和 Java 8。当我使用 Java 9 或 Ja
我想指示我的 Kotlin 注释处理器更改生成的类的输出目录。 我想从我的 Gradle 构建脚本中更改 kapt.kotlin.generated争论。我尝试了以下方法无济于事。 不起作用,路径不会
我为注释处理写了一个小库。使用 Gradle 将其编译为 jar 文件并添加到 android 项目中。在 build.gradle app lvl 中我添加了: dependencies { /
我正在尝试开发 Kotlin AnnotationProcessor 库,但我不明白为什么会出现此错误: Error:Execution failed for task ':app:javaPreCo
我是一名优秀的程序员,十分优秀!