Question

I'm getting the following two warnings when building and Android project with proguard that has the S Pen SDK Multi-Window jar (2.2.5):

[proguard] Warning: android.sec.multiwindow.Constants$WindowManagerPolicy: can't find referenced class android.view.WindowManagerPolicy
[proguard] Warning: android.sec.multiwindow.MultiWindowManager: can't find referenced method 'java.util.List getRunningTasks(int,int,android.app.IThumbnailReceiver)' in class android.app.ActivityManager

I was able to get proguard to run successfully by adding the following line to my proguard config file:

-dontwarn android.sec.multiwindow.**

However I'm a little uncomfortable with just ignoring the warnings. In this case, the warnings are referencing a class and method in android.jar, so they will be there at runtime.

I'm wondering if it would be good to also include the proguard rule:

-keep class android.sec.multiwindow.** { *; }

It doesn't appear to affect the build in this case, but it seems like a good idea.

Any thoughts?

Was it helpful?

Solution

The class and the method may be present in the Android runtime, but they are not present in android.jar, due to the @hide marking (so they are not endorsed as public API). If it works with -dontwarn, that's acceptable. A cleaner solution would be to create a version of android.jar that does include such classes, fields, and methods.

The -keep option doesn't really affect the problem. You can leave it out.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top