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.