[英]Error adding library Room Persistence
我開始處理房間持久性
我在gradle中添加了房間,並出現以下錯誤:
錯誤:無法解決:annotationProcessor
href =“ openFile:C:/.../ app / build.gradle”>打開文件
當我同步gradle時出現此錯誤
我該如何解決這個問題?
這是gradle項目:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
應用程式gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
dataBinding {
enabled = true
}
defaultConfig {
applicationId "com.app.bob.app"
minSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:support-annotations:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.android.support:support-v4:25.3.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton:butterknife:8.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
compile 'com.android.support:cardview-v7:25.3.0'
compile 'android.arch.persistence.room:runtime: 1.0.0-alpha5'
annotationProcessor 'android.arch.persistence.room:compiler: 1.0.0-alpha5'
compile 'android.arch.lifecycle:runtime:1.0.0-alpha5'
compile 'android.arch.lifecycle:extensions:1.0.0-alpha5'
annotationProcessor 'android.arch.lifecycle:compiler:1.0.0-alpha5'
testCompile 'android.arch.persistence.room:testing:1.0.0-alpha5'
compile 'android.arch.persistence.room:rxjava2:1.0.0-alpha5'
}
從compile
值中刪除所有空格。 IOW,更換:
compile 'android.arch.persistence.room:runtime: 1.0.0-alpha5'
annotationProcessor 'android.arch.persistence.room:compiler: 1.0.0-alpha5'
與:
compile 'android.arch.persistence.room:runtime:1.0.0-alpha5'
annotationProcessor 'android.arch.persistence.room:compiler:1.0.0-alpha5'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.