Android工作室给出了错误:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
我想在我的项目中添加Kotlin,并将其与Room数据库一起使用。但是在添加了所有的库之后,我得到了这个错误。这些都是编译器提
我在更新Android4.1.2至4.2.2之后收到此错误消息,但在将我的Android更新到4.1.2以上的任何版本后,都收到了此错误消息。
* What went wrong:
Execution failed for task ':core:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no err
I当我尝试实现一个Room数据库时,我得到了以下错误:
java.lang.RuntimeException: cannot find implementation for com.udacity.gradle.builditbigger.Database.HilarityUserDatabase. HilarityUserDatabase_Impl does not exist
at android.arch.persistence.room.Room.getGeneratedImplement
我正在努力为用Kotlin编写的项目增加空间,但我总是遇到这个错误。
用户数据类
@Entity
data class Users(
@PrimaryKey
val id: String? = "",
@ColumnInfo(name = "userFullName")
val name: String?,
@ColumnInfo(name = "userEmail")
val email: String?,
@ColumnInfo(name = "userPassword")
val password: String?,
让我们从一个问题开始:
> Task :app:kaptAppDebugUnitTestKotlin FAILED
/app/build/tmp/kapt3/stubs/appDebugUnitTest/com/pckg/TestAppComponent.java:77: error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this class because not all of its dependencies could be r
RoomDB和Kotlin合作是怎么回事?我一次又一次地尝试在Room Dao中使用挂起函数,但每次都会出现错误。我甚至效仿android代码库的例子。但它又显示了一个错误。如果我在Dao中写挂起的话,这个应用程序甚至不会构建。但是,如果我移除挂起关键字,它就会成功构建。
它显示了下面的错误:
error: Type of the parameter must be a class annotated with @Entity or a collection/array of it.
kotlin.coroutines.Continuation<? super kotlin.Unit&g
只有在导入房间库时才会发生错误。
导入kapt和ksp时没有问题,但只有在添加房间库时才会发生错误。
"“我听了这里说的话
下面是我的build.gradle文件
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt' // 추가
id 'com.google.devtools.ksp' version "1.5.31-1.0.0"
}
andr
我是科特林和安卓工作室的新手,我现在的问题是.
我正试着让Codelabs“android房间-带视图-kotlin”工作,在修复各种构建错误的同时,我认为我的build.gradle变得非常混乱!我通过添加依赖项纠正了Word.kt上一次构建失败。
kapt 'androidx.room:room-ktx:2.2.1'
下一次构建进一步深入到WordDao.kt,但由于相同类型的错误而失败。
WordDao.java:21: error: To use Coroutine features, you must add `ktx` artifact from Room as a
由于我未知的原因,一旦我将@Query添加到我的Room中,我的应用程序就无法构建。 我通过一步一步地做每一件事来找出它是@Query,并最终在添加@Query函数时达到了一个点,这导致了错误。 我得到的错误是: FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.inter
我有三个模块
应用程序模块
plugins {
id 'com.android.application'
id 'kotlin-android'
}
//..
域模块
plugins {
id 'java-library'
id 'kotlin'
}
//..
数据模块
plugins {
id 'java-library'
id 'kotlin'
id 'kotlin-kapt'
}
//..
我正在尝试在数据模块中添加房间
当我试图构建我的应用程序时,我得到了以下编译错误:
Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
com.example.persistence.AppDatabase, unresolved supertypes: androidx.room.RoomDatabase
持久性设置位于单独的Android模块( Persistence )中。
build.gradle
// Kotlin S
这就是我试图构建我的项目时所看到的。我没有改变任何东西,除了Android迫使我在“宣言”中加入什么,我不知道该怎么做。
Dao
@Dao
interface SubscriberDAO {
@Insert
suspend fun insertSubscriber(subscriber: Subscriber): Long
@Update
suspend fun updateSubscriber(subscriber: Subscriber): Int
@Delete
suspend fun deleteSubscriber(subscriber: Subscriber): I
我有一些数据类,其中包括他自己作为列表。Android显示了下一个错误:
ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1ANTLR Tool version 4.5.3 used for code generation does no
我得到了一个编译错误,我已经在下面描述。在类似的问题上,我尝试过不同的解决方案,但他们都不适合我。
请帮我处理这个。
我所犯的错误:-
(1)
error: Type of the parameter must be a class annotated with @Entity or a collection/array of it.
kotlin.coroutines.Continuation<? super kotlin.Unit> continuation);
(2)
error: Not sure how to handle insert method's retu
最近,我开始在我们的CircleCI构建中看到一个构建错误:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find semver4j-0.16.4-nodeps.jar (com.github.gundy:semver4j:0.16.4).
Searched in the following locations:
在我将我的项目迁移到那里之后,会出现一些错误,比如数据绑定等等,但是我已经解决了它,然后错误变成如下:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
我尝试过许多解决方案,比如将kotlin版本更新到1.4.20
我正在使用Room库,当我试图构建这个应用程序时,我会收到以下错误消息:
e: [kapt] An exception occurred: java.util.NoSuchElementException: Collection contains no element matching the predicate.
下面是一个更详细的错误消息:
FAILURE: Build failed with an exception
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> Comp
我有一个在windows操作系统中运行良好的项目,但当我切换我的笔记本电脑并在MacBook Pro M1中打开一个现有项目时。我无法在MacBook pro M1中运行现有的安卓项目。首先我得到了
任务执行失败:app:kaptDevDebugKotlin‘。>执行org.jetbrains.kotlin.gradle.internal.KaptExecution > java.lang.reflect.InvocationTargetException时发生故障(没有错误消息)
这个错误是由于我应用了一个修复程序,在Room数据库之前在库下面添加了一个修复程序,并且将我