can't find referenced field java.lang.Boolean default
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
interface Foo {
Boolean getDefault();
}
class FooImpl implements Foo {
private Boolean defaultValue;
@Override
public Boolean getDefault() {
return defaultValue;
}
}
Warning: FooImpl: can't find referenced field 'java.lang.Boolean default' in program class FooImpl
There is no field called "default", it is defaultValue. Default is a keyword in java, so use defaultValue.
I can't reproduce the problem with your example -- it works just fine. If ProGuard mentions a field called "default", it's not making that name up, so it must be somewhere in your code. Maybe starting from a clean build helps? Otherwise, do you have a small zip file of this project with all the necessary files to reproduce the issue?
Does proguard assume that there is a member variable "default" for getDefault() method?
No, Java bytecode doesn't have such conventions, so ProGuard doesn't need to perform such transformations or make assumptions.