2017-07-27 6 views
5

Ich verwende Android Room Persistence Library 1.0.0-Alpha5. Beim Kompilieren mit ProGuard erhalte ich den folgenden Fehler.Androide Room Persistence Bibliothek Proguard Konfiguration

Warning:android.arch.persistence.room.paging.LimitOffsetDataSource: can't find superclass or interface android.arch.util.paging.CountedDataSource 
Warning:android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.util.paging.CountedDataSource 
Warning:android.arch.persistence.room.paging.LimitOffsetDataSource$1: can't find referenced method 'void invalidate()' in program class android.arch.persistence.room.paging.LimitOffsetDataSource 
Warning:there were 5 unresolved references to classes or interfaces. 
Warning:there were 1 unresolved references to program class members. 
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first. 

Meine ProGuard Konfiguration für Zimmer ist wie folgt

-dontwarn okio.** 
-dontwarn javax.annotation.Nullable 
-dontwarn javax.annotation.ParametersAreNonnullByDefault 
# Platform calls Class.forName on types which do not exist on Android to  determine platform. 
-dontnote retrofit2.Platform 
# Platform used when running on Java 8 VMs. Will not be used at runtime. 
-dontwarn retrofit2.Platform$Java8 
# Retain generic type information for use by reflection by converters  and adapters. 
-keepattributes Signature 
# Retain declared checked exceptions for use by a Proxy instance. 
-keepattributes Exceptions 
-keep class android.content.** 
-dontwarn android.content.** 
-keep class android.animation.** 
-dontwarn android.animation.** 
-keep class me.panavtec.drawableview.** 
-dontwarn me.panavtec.drawableview.** 
-keep class javax.annotation.concurrent.** 
-dontwarn javax.annotation.concurrent.** 
-keep class android.arch.persistence.room.paging.LimitOffsetDataSource 
-keep interface android.arch.persistence.room.paging.LimitOffsetDataSource 
-keep class android.arch.util.paging.CountedDataSource 
-keep interface android.arch.util.paging.CountedDataSource 

ich Hilfe brauche diesen Fehler bei der Festsetzung. Ich glaube, ProGuard Konfiguration wurde nicht vor dem Alpha erforderlich 3 und habe ich nicht getestet alpha 4

Antwort

6

können Sie die folgenden Zeilen in der proguard hinzufügen statt keep

-dontwarn android.arch.util.paging.CountedDataSource 
-dontwarn android.arch.persistence.room.paging.LimitOffsetDataSource 
+1

Es funktionierte. Ich bin immer ein bisschen skeptisch in der Verwendung von Dontwarn in Proguard aus irgendeinem Grund: P Vielen Dank: D – user3425867

Verwandte Themen