2017-07-27 4 views
5

J'utilise Android Room Persistence Library 1.0.0-alpha5. Lors de la compilation avec ProGuard, j'obtiens l'erreur suivante.Configuration de Proguard de la bibliothèque Persistence de salle Android

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. 

Mon ProGuard Configuration pour la salle est comme suit

-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 

je besoin d'aide pour fixer cette erreur. Je crois ProGuard configuration n'a pas été nécessaire avant l'Alpha 3 et je n'ai pas testé alpha 4

Répondre

6

Vous pouvez ajouter les lignes suivantes dans le proguard au lieu de keep

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

Il a travaillé. Je suis toujours un peu sceptique dans l'utilisation de newwarn dans proguard pour une raison quelconque: P Merci beaucoup: D – user3425867