Failed to transform file 'jetified-okhttp-3.13.1.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=15} using transform DexingTransform
Error while dexing.
This is not enough information to diagnose a problem, and likely indicates a problem in something other than OkHttp. Please provide more information about what's happening.
Please see instructions here:
https://medium.com/square-corner-blog/okhttp-3-13-requires-android-5-818bb78d07ce
I have the same problem with okhttp when using it with the androidx jetifier. My okhttp is at '3.14.1', what should it be?
For reference, somehow it requires minsdk 24, and mine is on 23:
> Task :app:compileDebugAndroidTestKotlin
> Transform okhttp.jar (com.squareup.okhttp3:okhttp:3.14.1) with DexingTransform
AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator.lambda$static$0(okhttp3.Route, okhttp3.Response)","sources":[{}],"tool":"D8"}
> Task :expensereport:mergeExtDexDebugAndroidTest FAILED
AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator.lambda$static$0(okhttp3.Route, okhttp3.Response)","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator.lambda$static$0(okhttp3.Route, okhttp3.Response)","sources":[{}],"tool":"D8"}
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':expensereport:debugAndroidTestRuntimeClasspath'.
> Failed to transform file 'jetified-okhttp-3.14.1.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=23} using transform DexingTransform
> Error while dexing.
> Failed to transform file 'jetified-okhttp-3.14.1.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=23} using transform DexingTransform
> Error while dexing.
Did you follow the build instructions from the link above?
You mean
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
yes, I already had that.
Are you using AGP 3.3 or newer?
On Mon, Apr 15, 2019 at 9:32 PM Gábor Berényi notifications@github.com
wrote:
You mean
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}yes, I already had that.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/4625#issuecomment-483477006, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEEETJAMc-m0RmjDSDzdkyYUczXui6Eks5vhShCgaJpZM4a-7Ok
.
3.3.2
Not sure then. You should file a bug on the Android tools issue tracker.
That behavior is out of our control and it sounds like you have it
configured correctly.
On Mon, Apr 15, 2019 at 9:27 PM Gábor Berényi notifications@github.com
wrote:
I have the same problem with okhttp when using it with the androidx
jetifier. My okhttp is at '3.14.1', what should it be?For reference, somehow it requires minsdk 24, and mine is on 23:
Transform okhttp.jar (com.squareup.okhttp3:okhttp:3.14.1) with DexingTransform
AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator.lambda$static$0(okhttp3.Route, okhttp3.Response)","sources":[{}],"tool":"D8"}Task :expensereport:mergeExtDexDebugAndroidTest FAILED
AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator.lambda$static$0(okhttp3.Route, okhttp3.Response)","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator.lambda$static$0(okhttp3.Route, okhttp3.Response)","sources":[{}],"tool":"D8"}FAILURE: Build failed with an exception.
- What went wrong:
Could not resolve all files for configuration ':expensereport:debugAndroidTestRuntimeClasspath'.
> Failed to transform file 'jetified-okhttp-3.14.1.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=23} using transform DexingTransform
> Error while dexing.
> Failed to transform file 'jetified-okhttp-3.14.1.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=23} using transform DexingTransform
> Error while dexing.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/4625#issuecomment-483475973, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEEEU9yERmnMlCXlcqmvi5w3Dj2Y2RVks5vhSb4gaJpZM4a-7Ok
.
Note that guava has the same issue when using the '-jre' artifact. There you must use the '-android' artifact. (sorry, removed wrong link)
It sounds like your build isn't configured correctly then because D8's
desugaring should handle both of those libraries. Granted, you still
probably don't want to use the -jre Guava since it uses new APIs that
aren't available, but it should be able to be packed into your app just
fine.
On Mon, Apr 15, 2019 at 9:39 PM Gábor Berényi notifications@github.com
wrote:
Note that guava has the same issue when using the '-jre' artifact. There
you must use the '-android' artifact. Ref:
https://stackoverflow.com/questions/54635950/android-x-truth-guava-test-compile-issue—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/4625#issuecomment-483478178, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEEEaduuVmESTzmngzoz3nqE0zXzOtYks5vhSnfgaJpZM4a-7Ok
.
There are some problems with R8/D8, Android Studio and Instant Run:
https://issuetracker.google.com/issues/129362492
https://issuetracker.google.com/issues/129738209
Although the issues are reported for AS 3.4, AS 3.3 exhibits some of those problems, too. Gradle builds on the command line are usually fine in my experience.
You should disable Instant Run. Apply Changes is the future and doesn't
change how APKs are built.
On Tue, Apr 16, 2019 at 5:14 AM Andreas Ahlenstorf notifications@github.com
wrote:
There are some problems with R8/D8, Android Studio and Instant Run:
https://issuetracker.google.com/issues/129362492
https://issuetracker.google.com/issues/129738209Although the issues are reported for AS 3.4, AS 3.3 exhibits some of those
problems, too. Gradle builds on the command line are usually fine in my
experience.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/4625#issuecomment-483578838, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEEEVeFIBtrInbRBa5n7E1hzInpu1Kpks5vhZRbgaJpZM4a-7Ok
.
+1, compileOptions setted, problems started after update to Gradle 5.1.1 and Studio 3.4
But I am getting this even in the command line so no instant run and without upgrading AGP or Gradle.
> Transform okhttp.jar (com.squareup.okhttp3:okhttp:3.14.1) with DexingTransform
AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator.lambda$static$0(okhttp3.Route, okhttp3.Response)","sources":[{}],"tool":"D8"}
> Task :expensereport:mergeExtDexDebugAndroidTest FAILED
AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator.lambda$static$0(okhttp3.Route, okhttp3.Response)","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"error","text":"Static interface methods are only supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator.lambda$static$0(okhttp3.Route, okhttp3.Response)","sources":[{}],"tool":"D8"}
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':expensereport:debugAndroidTestRuntimeClasspath'.
> Failed to transform file 'jetified-okhttp-3.14.1.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=23} using transform DexingTransform
> Error while dexing.
> Failed to transform file 'jetified-okhttp-3.14.1.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=23} using transform DexingTransform
> Error while dexing.
All this with the single change to my project
- okhttp: '3.12.2',
+ okhttp: '3.14.1',
Read the link above from Jesse
Thanks, one of my modules was indeed on Java 7, upgrading it solved it. Didn't realize that all modules need to be upgraded.
@swankjesse's comment worked and project's built, but am getting a warning on build
AGPBI: {"kind":"warning","text":"Type `org.conscrypt.Conscrypt` was not found, it is required for default or static interface methods desugaring of `java.security.Provider okhttp3.internal.platform.ConscryptPlatform.getProvider()`","sources":[{"file":"/home/theapache64/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.14.0/c3a9efd10f26a802da2c47dbe54a8d4c44a6019f/okhttp-3.14.0.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"synthesized for lambda desugaring: Type `okhttp3.Dns$-CC` was not found, it is required for default or static interface methods desugaring of `java.util.List okhttp3.-$$Lambda$Dns$mTkNcZf2K4euny3_jks6Cac6Az0.lookup(java.lang.String)`","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"synthesized for lambda desugaring: Type `okhttp3.Authenticator$-CC` was not found, it is required for default or static interface methods desugaring of `okhttp3.Request okhttp3.-$$Lambda$Authenticator$xBBU2iHkJpDKH0vhaB2vteUyEoc.authenticate(okhttp3.Route, okhttp3.Response)`","sources":[{}],"tool":"D8"}
Should I worry about it ?
Most helpful comment
Please see instructions here:
https://medium.com/square-corner-blog/okhttp-3-13-requires-android-5-818bb78d07ce