当我使用
BuildConfig.DEBUG
在科特林我得到这个错误:
expecting member declaratuon
我的代码:
class API {
companion object {
private lateinit var instance: Retrofit
private const val baseUrl = baseURL
if (BuildConfig.DEBUG) {
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
builder.addInterceptor(interceptor);
}
}