2017-12-09 4 views
0

Ich versuche, die Bibliothek Raumpersistenz zu verwenden, mit SDK min 16. Nachdem ich Raumpersistenz in Großbuchstaben hinzugefügt habe, bekomme ich den Fehler unten: wenn ich die letzten 2 Zeilen der Abhängigkeit nehme (aus dem lib room) kompilieren normal. Hilfe!Fehler in der Unterstützung lib nach Raumpersistenz

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) 
.... 

mein gradle ist einfach:

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' 
+0

wo 'kompilieren‚com.android.support: appcompat-v7: 25.0.2'' in Ihrem gradle? Sie müssen Support-Repository in Gradle hinzufügen. –

+0

und fügen Sie 'google()' in Ihrem Repository auf Projektebene hinzu. –

+0

Sogar das Kompilieren von "com.android.support:appcompat-v7:25.0.2" und maven {url "https://maven.google.com"} ist weiterhin möglich. Ich habe ein Projekt von Grund auf neu erstellt, ohne Abhängigkeit und auch mit minSdk16Version. Ich konnte nur mit minSdkVersion 20 kompilieren. Aber in der Raumdokumentation gibt es keine solche SDK 20-Anforderung. –

Antwort

1

Ich habe das Problem in den Google-Tracker Ausgabe und sie antwortete:

Zimmer auf 26,1 von Support-Bibliothek abhängt, was wahrscheinlich ist, warum es ist kaputt, weil SupportLibrary Interop zwischen Versionen nicht verspricht.

und hinzugefügt:

Sie nicht beheben und Spiel Support-Bibliothek Versionen können. Bitte passen Sie an, egal welche Version Sie am Ende benötigen.

Dann ist das Problem gelöst, Room + lib wird nur mit Version 26.1 + der Bibliothek unterstützt.

Meine letzte 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" 
} 
Verwandte Themen