小编Ege*_*han的帖子

错误:[MissingType]:元素“xxxxx.AppDatabase.room”引用不存在的类型

错误:[MissingType]:元素“xxxxx.AppDatabase.room”引用不存在的类型

当我尝试编译代码时,出现标题中提到的错误。看来我的房间有问题导致了这个问题。Kotlin kapt 给出了这个错误。我该如何解决?

项目级别 Gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {


    ext.kotlin_version = '1.5.31'
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
        classpath 'com.google.gms:google-services:4.3.10'

        def nav_version = "2.3.5"
        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url 'https://jitpack.io' …
Run Code Online (Sandbox Code Playgroud)

android kotlin android-room

14
推荐指数
1
解决办法
5631
查看次数

标签 统计

android ×1

android-room ×1

kotlin ×1