I've just upgraded from Android Studio 3.1
to Android Studio 3.1.1
(but still using Gradle build tool 3.0.0
). When I run my app it causes this error:
:app:transformClassesWithAndroidGradleClassShrinkerForDebug
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okhttp3/Interceptor
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: com/squareup/okhttp/Interceptor
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okhttp3/Request
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: okio/Okio
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okhttp3/ResponseBody
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okio/Okio
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: com/squareup/okhttp/Request
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okhttp3/Response
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: com/squareup/okhttp/Headers
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: com/squareup/okhttp/ResponseBody
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: com/squareup/okhttp/Interceptor$Chain
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: com/squareup/okhttp/Response$Builder
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: com/squareup/okhttp/Response
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okhttp3/Headers
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: com/squareup/okhttp/RequestBody
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okhttp3/OkHttpClient$Builder
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okhttp3/HttpUrl
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: com/squareup/okhttp/OkHttpClient
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: okio/BufferedSource
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okhttp3/Interceptor$Chain
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okhttp3/Response$Builder
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okhttp3/RequestBody
com/android/tools/profiler/agent/okhttp/OkHttp2Interceptor references unknown class: okio/BufferedSink
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okio/BufferedSource
com/android/tools/profiler/agent/okhttp/OkHttp3Interceptor references unknown class: okio/BufferedSink
:app:transformClassesWithAndroidGradleClassShrinkerForDebug FAILED
:app:buildInfoGeneratorDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithAndroidGradleClassShrinkerForDebug'.
> Warnings found during shrinking, please use -dontwarn or -ignorewarnings to suppress them.
But I'm NOT using okhttp
or any Http library (like Retrofit,..) in my project.
This error also happens when I'm upgrading Gradle build tool to the newest version 3.1.1
. I don't know why, everything is fine when I downgrade back to Android Studio 3.1.0
.
app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.z.a.zcamera"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(path: ':libzcamera')
implementation 'com.android.support:support-v4:26.1.0'
}
Update:
I think it is caused by Android Profiler tool's new feature: the network profiler because of the com/android/tools/profiler/agent
path and I'm turning ON the advanced profiling to track network payload.
I also don't want to disable Proguard too.
Any ideas? Please help me.