2017-08-03 136 views
0

簽署了產生APK:發佈版本:transformClassesAndResourcesWithProguardForRelease失敗

Note: there were 8 unresolved dynamic references to classes or interfaces. 
Note: there were 4 accesses to class members by means of introspection. 
Warning: there were 5 unresolved references to classes or interfaces. 
Warning: there were 1 unresolved references to program class members. 

transformClassesAndResourcesWithProguardForRelease FAILED 

Full Gradle log is here

My app build.gradle is here

UPDStacktrace is here

如果我使用-ignorewarnings選項,那麼該應用會在某些版本的Android上崩潰。

大概在進入房間後,我停止生成簽名的APK。 另外,我不得不將com.google.firebase,com.google.android.gms:play-services從11.0.4降級到11.0.2。

兩個簡單的問題(對於那些知道的人)。

日誌說:

Try: Run with --stacktrace option to get the stack trace. 
Run with --info or --debug option to get more log output. 

Q1。在Android Studio中,我可以指定「--stacktrace」,「--info或--debug」選項?第二季度銷售價格下降,第二季度銷售價格下降,第三季度銷售價格下降。如何(我閱讀日誌)我必須找出哪些課程缺失?我應該在哪裏看?要找什麼?

+1

使用proguard配置從https://stackoverflow.com/questions/45344040/android-room-persistence-library-proguard-configuration – DeKaNszn

回答

1

Q1:在從項目的根命令行:./gradlew build --stacktrace

Q2:你應該修改警告:

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: can't find referenced class 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: 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 

而且你可以嘗試添加到您的ProGuard文件:

-dontwarn android.arch.util.paging.CountedDataSource 
-dontwarn android.arch.persistence.room.paging.LimitOffsetDataSource 
0

你可以在這裏看到什麼類缺失

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: can't find referenced class 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: 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 

看看如何實現proguard的來處理這個類,你可以嘗試添加到您的proguard-rules.pro文件:

-dontwarn android.arch.** 

,或者您可以從您的構建禁用的ProGuard( here