Database.Logger.Level Enum Values Not Accessible i

2019-02-15 07:22发布

Update 30 June:

This problem is corrected in version 11.0.2.


Prior to Firebase version 11.0.0, the enum values of Database.Logger.Level were directly accessible. An example that compiles with 10.2.6 is:

FirebaseDatabase.getInstance().setLogLevel(Logger.Level.DEBUG);

That statement does not compile using version 11.0.0. A workaround is to use valueOf():

FirebaseDatabase.getInstance().setLogLevel(Logger.Level.valueOf("DEBUG"));

In 11.0.0, the decompiled .class file for Database.Logger is:

public interface Logger {
    public static enum Level {
        zzcbX,
        zzcbY,
        zzcbZ,
        zzcca,
        zzccb;

        private Level() {
        }
    }
}

In 10.2.6, it's:

public interface Logger {
    public static enum Level {
        DEBUG,
        INFO,
        WARN,
        ERROR,
        NONE;

        private Level() {
        }
    }
}

Is use of valueOf() the appropriate workaround until the enum values are accessible again?

1条回答
Explosion°爆炸
2楼-- · 2019-02-15 07:40

firebaser here

This is a known bug in version 11.0.0 and 11.0.1 of the Android SDK. It should be fixed in version 11.0.2, which is due by early July.

查看更多
登录 后发表回答