Amir Amir - 23 days ago 8
Android Question

samsung multiscreen Proguard conflict with exoplayer

I want to release my app but in proguard step I face a problem. it Generate some warning when I add lobmok ( or be more specific when I add samsung-multiscreen jar file) as follows :


Warning:com.google.android.exoplayer.MediaCodecAudioTrackRenderer:
can't find referenced class android.media.PlaybackParams
Warning:com.google.android.exoplayer.audio.AudioTrack: can't find
referenced class android.media.PlaybackParams
Warning:com.google.android.exoplayer.audio.AudioTrack$AudioTrackUtil:
can't find referenced class android.media.PlaybackParams
Warning:com.google.android.exoplayer.audio.AudioTrack$AudioTrackUtilV23:
can't find referenced class android.media.PlaybackParams
Warning:com.google.android.exoplayer.audio.AudioTrack$AudioTrackUtilV23:
can't find referenced method 'void
setPlaybackParams(android.media.PlaybackParams)' in library class
android.media.AudioTrack
Warning:com.google.android.exoplayer.audio.AudioTrack$AudioTrackUtilV23:
can't find referenced class android.media.PlaybackParams
Warning:com.google.android.exoplayer.chunk.VideoFormatSelectorUtil:
can't find referenced method 'android.view.Display$Mode getMode()' in
library class android.view.Display
Warning:com.google.android.exoplayer.chunk.VideoFormatSelectorUtil:
can't find referenced class android.view.Display$Mode


When I add following line to proguard-rules.pro some of the them disappeared but When I launch to the application it crash.

-dontwarn lombok.**


Also try this :

-keep class com.google.android.exoplayer.** { *; }


I think it raise due to conflict between annotation used in exoplayer and multiscreen (lombok)

does anyone knows how to fix this issue ?

Answer

Finally I fixed this issue with following proguard-rule:

-ignorewarnings
-dontoptimize
-dontobfuscate
-dontskipnonpubliclibraryclasses

-ignorewarnings

-keep class com.samsung.** { *; }
-dontwarn com.samsung.**
-dontwarn com.samsung.multiscreen.BuildConfig
-dontwarn lombok.**