添加androidx.room:room-compiler:2.1.0-alpha05后,项目无法编译

时间:2019-03-14 23:31:54

标签: java android android-gradle android-room androidx

应用程序gradle文件和Project gradle文件。

错误:找不到符号类DataBindingComponent

    dependencies 
    {
        implementation 'androidx.room:room-runtime:2.1.0-alpha05'
        annotationProcessor 'androidx.room:room-compiler:2.1.0-alpha05'

    }
-----------------------------------------------------------------------------
    allprojects {
        repositories {
            jcenter()
            maven { url "https://jitpack.io" }
            google()
            maven { url "https://kotlin.bintray.com/kotlinx/" }
        }
    }

3 个答案:

答案 0 :(得分:2)

const express = require('express'); const path = require('path'); const bodyParser = require('body-parser'); const cors = require('cors'); const app = express(); app.use(cors()); // some route controllers const customRoute = require('./customRoute.controller'); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); // Custom routes app.use('/api/tags', customRoute); app.use(express.static(path.join(__dirname, 'dist'))); // Catch all other routes & return index file app.get('*', (req, res) => { res.sendFile(path.join(__dirname, 'dist/index.html')); }); module.exports = app; 添加到您的项目存储库中。

  

2.1.0-alpha05房间取决于kotlinx-metadata-jvm工件,该工件当前在Maven Central中不可用

Refer Official doc

答案 1 :(得分:0)

我摆脱了将gradle build插件升级到3.3.2的错误:

dependencies {
    classpath 'com.android.tools.build:gradle:3.3.2'
    classpath 'com.google.gms:google-services:4.2.0'
    classpath 'io.fabric.tools:gradle:1.27.1'
}

如果您一直使用io.fabric插件,该版本将产生一些警告(请参见API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders())。

答案 2 :(得分:0)

嘿,我遇到了类似的问题,这是显示的错误:

Searched in the following locations:
  - file:/Users/4leyam/Library/Android/sdk/extras/m2repository/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.0.5/kotlinx-metadata-jvm-0.0.5.pom
  - file:/Users/4leyam/Library/Android/sdk/extras/m2repository/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.0.5/kotlinx-metadata-jvm-0.0.5.jar
  - file:/Users/4leyam/Library/Android/sdk/extras/google/m2repository/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.0.5/kotlinx-metadata-jvm-0.0.5.pom
  - file:/Users/4leyam/Library/Android/sdk/extras/google/m2repository/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.0.5/kotlinx-metadata-jvm-0.0.5.jar
  - file:/Users/4leyam/Library/Android/sdk/extras/android/m2repository/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.0.5/kotlinx-metadata-jvm-0.0.5.pom
  - file:/Users/4leyam/Library/Android/sdk/extras/android/m2repository/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.0.5/kotlinx-metadata-jvm-0.0.5.jar
  - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.0.5/kotlinx-metadata-jvm-0.0.5.pom
  - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.0.5/kotlinx-metadata-jvm-0.0.5.jar
  - https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.0.5/kotlinx-metadata-jvm-0.0.5.pom
  - https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.0.5/kotlinx-metadata-jvm-0.0.5.jar
Required by:
    project :app > androidx.room:room-compiler:2.1.0-alpha05

我发现的临时解决方案是将room_version降级为

 def room_version = "2.1.0-alpha04"

请分享是否有更好的解决方案