房间持久化后支持库出错

Error in support lib after room persistence

我正在尝试使用 SDK 最小 16 的图书馆房间持久性。 在 gradle 中添加房间持久性后,出现以下错误: 如果我采用最后 2 行依赖项(来自 lib 室)编译正常。 求助!

 error: cannot access ActivityCompatApi23
public class MainActivity extends AppCompatActivity
       ^
  class file for android.support.v4.app.ActivityCompatApi23 not found
An exception has occurred in the compiler (1.8.0_05). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.NullPointerException
    at com.sun.tools.javac.comp.Check$Validator.visitSelect(Check.java:1301)
    at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1891)
    at com.sun.tools.javac.comp.Check$Validator.validateTree(Check.java:1350)
    at com.sun.tools.javac.comp.Check.validate(Check.java:1221)
    at com.sun.tools.javac.comp.Check.validate(Check.java:1218)
....

我的gradle是基本的:

    compileSdkVersion 25

    defaultConfig {
        applicationId "com.br.xxxx"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 45
        versionName "3.0.2"


dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    compile 'com.google.firebase:firebase-core:10.2.6'
    compile 'com.google.firebase:firebase-database:10.2.6'
    compile 'com.google.firebase:firebase-auth:10.2.6'
    compile 'com.google.firebase:firebase-appindexing:10.2.6'
    compile 'com.google.firebase:firebase-config:10.2.6'

    compile 'com.firebaseui:firebase-ui:1.2.0'
    compile 'com.firebase:geofire-java:2.1.1'

    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.github.PhilJay:MPAndroidChart:v2.2.0'
    compile 'com.github.amlcurran.showcaseview:library:5.4.3'
    compile 'com.andkulikov:transitionseverywhere:1.7.4'

    compile 'com.google.android.gms:play-services-maps:10.2.6'
    compile 'com.google.android.gms:play-services-location:10.2.6'


    compile 'com.google.maps.android:android-maps-utils:0.5'

    compile 'com.google.firebase:firebase-storage:10.2.6'

    compile 'com.firebaseui:firebase-ui-storage:0.6.0'
    compile 'com.jsibbold:zoomage:1.1.0'

    compile "android.arch.persistence.room:runtime:1.0.0"
    annotationProcessor "android.arch.persistence.room:compiler:1.0.0"

}
apply plugin: 'com.google.gms.google-services'

我在 Google 的问题跟踪器中添加了这个问题,他们回复说:

Room depends on 26.1 of support library, which is probably why it is broken because SupportLibrary does not promise interop between versions.

并添加:

You cannot fix and match support library versions. Please match whatever highest version you end up needing by your dependencies.

然后问题解决,Room + lib只支持26.1+版本的库

我的决赛gradle:

compileSdkVersion 26

    defaultConfig {
        applicationId "com.br.xxxx"

        minSdkVersion 16
        targetSdkVersion 26
        versionCode 45
        versionName "3.0.2"
    }

...

     repositories {
         maven { url 'https://maven.fabric.io/public' }
         maven { url 'https://maven.google.com' } }

     dependencies {
            compile fileTree(include: ['*.jar'], dir: 'libs')
            implementation 'com.android.support:appcompat-v7:26.1.0'

            compile 'com.google.firebase:firebase-core:10.2.6'
            compile 'com.google.firebase:firebase-database:10.2.6'
            compile 'com.google.firebase:firebase-auth:10.2.6'
            compile 'com.google.firebase:firebase-appindexing:10.2.6'
            compile 'com.google.firebase:firebase-config:10.2.6'

            compile 'com.firebaseui:firebase-ui:1.2.0'
            compile 'com.firebase:geofire-java:2.1.1'

            compile 'com.github.bumptech.glide:glide:3.7.0'
            compile 'com.github.PhilJay:MPAndroidChart:v2.2.0'
            compile 'com.github.amlcurran.showcaseview:library:5.4.3'
            compile 'com.andkulikov:transitionseverywhere:1.7.4'

            compile 'com.google.android.gms:play-services-maps:10.2.6'
            compile 'com.google.android.gms:play-services-location:10.2.6'

            compile 'com.google.maps.android:android-maps-utils:0.5'

            compile 'com.google.firebase:firebase-storage:10.2.6'

            compile 'com.firebaseui:firebase-ui-storage:0.6.0'
            compile 'com.jsibbold:zoomage:1.1.0'


            compile "android.arch.persistence.room:runtime:1.0.0"
            annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
}