MichaelRocks / paranoid

String obfuscator for Android applications.
Apache License 2.0
670 stars 79 forks source link

Compilation error: Could not initialize class io.michaelrocks.paranoid.grip.ClassesQueryBuilder #54

Closed mirkamalg closed 3 years ago

mirkamalg commented 3 years ago

I tried to use this in a header interceptor as follows:

@Obfuscate
class HeaderInterceptor : Interceptor {

    private val preferenceUtils = PreferenceUtils()
    var API_KEY = "apikey"

    override fun intercept(chain: Interceptor.Chain): Response {
        var request = chain.request()
        request = request.newBuilder().apply {
            header("Content-Type", "application/json; charset=utf-8")
            header(REQUEST_SOURCE, "Android")
            header(HEADER_API_KEY, API_KEY)
            header(LANG, preferenceUtils.language)
            header(AUTHORIZATION, "$BEARER ${preferenceUtils.token}")
        }
            .build()
        return chain.proceed(request)
    }
}

I'm getting a compilation error (Could not initialize class io.michaelrocks.paranoid.grip.ClassesQueryBuilder). I'm using kotlin version 1.5 . Is this problem caused by kotlin version?

MichaelRocks commented 3 years ago

You should update Gradle to 6.8 or higher or downgrade to Paranoid 0.3.2. More details in #49.