Fixed
Status Update
Comments
ag...@google.com <ag...@google.com> #2
Thanks for the report. I agree that for some of these warnings there is nothing you can do and therefore it would make sense either for us to not report them or for you to be able to turn them off.
Ian, putting this in your queue as this could potentially need changes in our error reporting. I do think there are certain warnings that we generate here that we will be generating for many people and they cannot do anything about them.
Ivan, putting you in the CC list to make sure that we figure out how to best deal with this in AGP integration.
Ian, putting this in your queue as this could potentially need changes in our error reporting. I do think there are certain warnings that we generate here that we will be generating for many people and they cannot do anything about them.
Ivan, putting you in the CC list to make sure that we figure out how to best deal with this in AGP integration.
[Deleted User] <[Deleted User]> #3
delete
[Deleted User] <[Deleted User]> #4
delete
ze...@google.com <ze...@google.com> #5
Compilation still produces warnings for these cases. I'm not sure how to get the output in the IDE build and the default CLI does not show the warnings either. Running with --info (ie, ./gradlew --info clean app:assemble) does issue the warnings for the suggested okhttp lib. In general we do want to surface these warnings as they are indicative of a broken setup with respect to desugaring. Of course, in the case of libraries using JVM-only APIs we could assume they know what is going on and lower to info reports. Ivan: Would it be possible to make the change in the gradle plugin, so that the diagnostics handler will lower the desugar warnings to info when compiling library jars? Do we know when we are compiling libraries vs user program code?
ga...@google.com <ga...@google.com> #6
Currently, we are not able to disambiguate between external (Maven) jars and Android/Java library subprojects that e.g. app depends on, so we cannot differentiate user program code and libraries. Supporting this would require changes in Gradle.
However, I am not sure if we should disambiguate the two? E.g. while desugaring user type U, we find Maven library type L1, that depends on library type L2 that we are unable to find. Should we suppress the warning in that case, or emit it because the "origin" of desugaring is user code?
However, I am not sure if we should disambiguate the two? E.g. while desugaring user type U, we find Maven library type L1, that depends on library type L2 that we are unable to find. Should we suppress the warning in that case, or emit it because the "origin" of desugaring is user code?
ze...@google.com <ze...@google.com> #7
Thanks for the info Ivan. I agree with the issues on distinguishing user and library usages. There are at least two ways we could work towards resolving this without disabling the warnings entirely:
1. Add a whitelisting to the error reporting such that users can selectively silence unwanted warnings.
2. Add a fake-bootclasspath that links to alternative runtime jars and warnings that resolve in those be silenced.
I am most tempted to pursue 2. as that is indicative of the actual issue, namely libraries and program code that is written to allow targeting multiple platforms. Such an addition should also allow us to resolve a few issues with changes within the Android platform itself. WDYT?
1. Add a whitelisting to the error reporting such that users can selectively silence unwanted warnings.
2. Add a fake-bootclasspath that links to alternative runtime jars and warnings that resolve in those be silenced.
I am most tempted to pursue 2. as that is indicative of the actual issue, namely libraries and program code that is written to allow targeting multiple platforms. Such an addition should also allow us to resolve a few issues with changes within the Android platform itself. WDYT?
ze...@google.com <ze...@google.com> #8
After more discussion locally, we have the following work plan:
1. Extend the diagnostics with explicit types for when resolving fails in desugaring (and for when resolving fails in R8 which are similar).
2. Reimplement the support for R8 -dontwarn to take place in the diagnostics handler (this acts only on the resolve errors from R8).
3. Implement a public diagnostics handler that will filter resolve errors from desugaring.
4. Use 3. to add a desugar whitelist to the D8 command-line and use it to add desugar whitelist support to clients (eg, Android Studio).
1. Extend the diagnostics with explicit types for when resolving fails in desugaring (and for when resolving fails in R8 which are similar).
2. Reimplement the support for R8 -dontwarn to take place in the diagnostics handler (this acts only on the resolve errors from R8).
3. Implement a public diagnostics handler that will filter resolve errors from desugaring.
4. Use 3. to add a desugar whitelist to the D8 command-line and use it to add desugar whitelist support to clients (eg, Android Studio).
ga...@google.com <ga...@google.com> #9
Update from discussion Ian and I had.
From Android Studio’s perspective it makes sense to lower these warnings to info. Main reasons for this are:
- AGP will invoke desugaring correctly, and runtime classpath will be available while desugaring (in contrast to invoking D8 from CLI where parameters can be omitted easily).
- any missing type com.example.T while desugaring will result in a clear error message at runtime e.g. “Not able to load com.example.T” if that code path is hit. In cases when desugaring is not enabled, the error message will be the same. This makes debugging these issues straightforward, and in a way, they are independent of desugaring per se.
That being said, the plan from #8 works for AGP, as it allows us to handle desugaring warnings differently.
From Android Studio’s perspective it makes sense to lower these warnings to info. Main reasons for this are:
- AGP will invoke desugaring correctly, and runtime classpath will be available while desugaring (in contrast to invoking D8 from CLI where parameters can be omitted easily).
- any missing type com.example.T while desugaring will result in a clear error message at runtime e.g. “Not able to load com.example.T” if that code path is hit. In cases when desugaring is not enabled, the error message will be the same. This makes debugging these issues straightforward, and in a way, they are independent of desugaring per se.
That being said, the plan from #8 works for AGP, as it allows us to handle desugaring warnings differently.
mo...@fabasoft.com <mo...@fabasoft.com> #10
When can we see some progress on this issue?
We are also experiencing this warnings, even with latest
Android Studio 3.5 Beta 1
Build #AI-191.6707.61.35.5529924, built on May 3, 2019
We are also experiencing this warnings, even with latest
Android Studio 3.5 Beta 1
Build #AI-191.6707.61.35.5529924, built on May 3, 2019
se...@gmail.com <se...@gmail.com> #11
It got worse with 3.5 Beta 1. I see several times more warnings during build than with 3.4.0.
ze...@google.com <ze...@google.com> #12
Sergey: are you experiencing this as worse due to increased warnings, or has your build / dependencies changed too? Could you attach the log? These warnings are actual warnings, since if any of the targeted classes could needed for desugaring of your application the application will likely not work correctly.
yo...@gmail.com <yo...@gmail.com> #13
In 3.5b1, our build is spammed with these logs for external dependencies... there is nothing we can do here...
The app works fine...
Alot of the warnings are about Google provided or recommended libs...
> Task :app:mergeExtDexDebug
AGPBI: {"kind":"warning","text":"Type `io.fabric.sdk.android.Fabric` was not found, it is required for default or static interface methods desugaring of `com.crashlytics.android.beta.Beta com.crashlytics.android.beta.Beta.getInstance()`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/aa3b8a5e61270b61f78b05d5b85c4.../beta-1.2.10/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Interface `io.fabric.sdk.android.services.common.DeviceIdentifierProvider` not found. It's needed to make sure desugaring of `com.crashlytics.android.beta.Beta` is correct. Desugaring will assume that this interface has no default method.","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/aa3b8a5e61270b61f78b05d5b85c4.../beta-1.2.10/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Interface `io.fabric.sdk.android.services.cache.ValueLoader` not found. It's needed to make sure desugaring of `com.crashlytics.android.beta.DeviceTokenLoader` is correct. Desugaring will assume that this interface has no default method.","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/aa3b8a5e61270b61f78b05d5b85c4.../beta-1.2.10/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Interface `com.google.common.util.concurrent.ListenableFuture` not found. It's needed to make sure desugaring of `androidx.work.impl.utils.futures.AbstractFuture` is correct. Desugaring will assume that this interface has no default method.","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/c6a7dfa89d685c4d153720dfc9752300/work-runtime-1.0.0-beta05/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.arch.paging.PositionalDataSource` was not found, it is required for default or static interface methods desugaring of `boolean android.arch.persistence.room.paging.LimitOffsetDataSource.isInvalid()`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/6462541cb466259563bd2007a4f75ce4/runtime-1.1.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v7.content.res.AppCompatResources` was not found, it is required for default or static interface methods desugaring of `android.graphics.drawable.Drawable com.bumptech.glide.load.resource.drawable.DrawableDecoderCompat.loadDrawableV7(android.content.Context, int)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v4.content.res.ResourcesCompat` was not found, it is required for default or static interface methods desugaring of `android.graphics.drawable.Drawable com.bumptech.glide.load.resource.drawable.DrawableDecoderCompat.loadDrawableV4(android.content.Context, int, android.content.res.Resources$Theme)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v4.os.TraceCompat` was not found, it is required for default or static interface methods desugaring of `void com.bumptech.glide.load.engine.DecodeJob$DeferredEncodeManager.encode(com.bumptech.glide.load.engine.DecodeJob$DiskCacheProvider, com.bumptech.glide.load.Options)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v4.content.ContextCompat` was not found, it is required for default or static interface methods desugaring of `com.bumptech.glide.manager.ConnectivityMonitor com.bumptech.glide.manager.DefaultConnectivityMonitorFactory.build(android.content.Context, com.bumptech.glide.manager.ConnectivityMonitor$ConnectivityListener)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v4.app.Fragment` was not found, it is required for default or static interface methods desugaring of `void com.bumptech.glide.manager.SupportRequestManagerFragment.onAttach(android.content.Context)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Interface `android.support.v4.util.Pools$Pool` not found. It's needed to make sure desugaring of `com.bumptech.glide.util.pool.FactoryPools$FactoryPool` is correct. Desugaring will assume that this interface has no default method.","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v4.view.ViewCompat` was not found, it is required for default or static interface methods desugaring of `android.support.v4.view.accessibility.AccessibilityNodeInfoCompat com.facebook.stetho.inspector.elements.android.AccessibilityNodeInfoWrapper.createNodeInfoFromView(android.view.View)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/268b6295b5fa54c9744b5932628c0b03/stetho-1.5.0/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `libcore.io.Memory` was not found, it is required for default or static interface methods desugaring of `void com.google.android.gms.internal.places.zzjw$zzb.zzb(long, byte)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/d0155de52f2358602a41230b8ad952b3/play-services-places-16.0.0/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `kotlin.jvm.internal.Intrinsics` was not found, it is required for default or static interface methods desugaring of `com.uber.autodispose.LifecycleScopeProvider com.uber.autodispose.android.lifecycle.AutodisposeAndroidLifecycleKt.scope(android.arch.lifecycle.LifecycleOwner)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/4e189041eb794a4c95a8f60aafa0c87c/autodispose-android-archcomponents-kotlin-0.8.0/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `org.conscrypt.Conscrypt` was not found, it is required for default or static interface methods desugaring of `okhttp3.internal.platform.Platform okhttp3.internal.platform.ConscryptPlatform.buildIfSupported()`","sources":[{"file":"/Users/foo/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.11.0/75966e05a49046ca2ae734e5626f28837a8d1e82/okhttp-3.11.0.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `sun.misc.Unsafe` was not found, it is required for default or static interface methods desugaring of `void com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper.<clinit>()`","sources":[{"file":"/Users/foo/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/24.1.1-android/e806df025169cdef2b724428836fc2c8c8c65951/guava-24.1.1-android.jar"}],"tool":"D8"}
The app works fine...
Alot of the warnings are about Google provided or recommended libs...
> Task :app:mergeExtDexDebug
AGPBI: {"kind":"warning","text":"Type `io.fabric.sdk.android.Fabric` was not found, it is required for default or static interface methods desugaring of `com.crashlytics.android.beta.Beta com.crashlytics.android.beta.Beta.getInstance()`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/aa3b8a5e61270b61f78b05d5b85c4.../beta-1.2.10/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Interface `io.fabric.sdk.android.services.common.DeviceIdentifierProvider` not found. It's needed to make sure desugaring of `com.crashlytics.android.beta.Beta` is correct. Desugaring will assume that this interface has no default method.","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/aa3b8a5e61270b61f78b05d5b85c4.../beta-1.2.10/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Interface `io.fabric.sdk.android.services.cache.ValueLoader` not found. It's needed to make sure desugaring of `com.crashlytics.android.beta.DeviceTokenLoader` is correct. Desugaring will assume that this interface has no default method.","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/aa3b8a5e61270b61f78b05d5b85c4.../beta-1.2.10/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Interface `com.google.common.util.concurrent.ListenableFuture` not found. It's needed to make sure desugaring of `androidx.work.impl.utils.futures.AbstractFuture` is correct. Desugaring will assume that this interface has no default method.","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/c6a7dfa89d685c4d153720dfc9752300/work-runtime-1.0.0-beta05/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.arch.paging.PositionalDataSource` was not found, it is required for default or static interface methods desugaring of `boolean android.arch.persistence.room.paging.LimitOffsetDataSource.isInvalid()`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/6462541cb466259563bd2007a4f75ce4/runtime-1.1.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v7.content.res.AppCompatResources` was not found, it is required for default or static interface methods desugaring of `android.graphics.drawable.Drawable com.bumptech.glide.load.resource.drawable.DrawableDecoderCompat.loadDrawableV7(android.content.Context, int)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v4.content.res.ResourcesCompat` was not found, it is required for default or static interface methods desugaring of `android.graphics.drawable.Drawable com.bumptech.glide.load.resource.drawable.DrawableDecoderCompat.loadDrawableV4(android.content.Context, int, android.content.res.Resources$Theme)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v4.os.TraceCompat` was not found, it is required for default or static interface methods desugaring of `void com.bumptech.glide.load.engine.DecodeJob$DeferredEncodeManager.encode(com.bumptech.glide.load.engine.DecodeJob$DiskCacheProvider, com.bumptech.glide.load.Options)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v4.content.ContextCompat` was not found, it is required for default or static interface methods desugaring of `com.bumptech.glide.manager.ConnectivityMonitor com.bumptech.glide.manager.DefaultConnectivityMonitorFactory.build(android.content.Context, com.bumptech.glide.manager.ConnectivityMonitor$ConnectivityListener)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v4.app.Fragment` was not found, it is required for default or static interface methods desugaring of `void com.bumptech.glide.manager.SupportRequestManagerFragment.onAttach(android.content.Context)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Interface `android.support.v4.util.Pools$Pool` not found. It's needed to make sure desugaring of `com.bumptech.glide.util.pool.FactoryPools$FactoryPool` is correct. Desugaring will assume that this interface has no default method.","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/26d4f41cf2a7969009c6e01da8fa11ae/glide-4.3.1/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `android.support.v4.view.ViewCompat` was not found, it is required for default or static interface methods desugaring of `android.support.v4.view.accessibility.AccessibilityNodeInfoCompat com.facebook.stetho.inspector.elements.android.AccessibilityNodeInfoWrapper.createNodeInfoFromView(android.view.View)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/268b6295b5fa54c9744b5932628c0b03/stetho-1.5.0/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `libcore.io.Memory` was not found, it is required for default or static interface methods desugaring of `void com.google.android.gms.internal.places.zzjw$zzb.zzb(long, byte)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/d0155de52f2358602a41230b8ad952b3/play-services-places-16.0.0/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `kotlin.jvm.internal.Intrinsics` was not found, it is required for default or static interface methods desugaring of `com.uber.autodispose.LifecycleScopeProvider com.uber.autodispose.android.lifecycle.AutodisposeAndroidLifecycleKt.scope(android.arch.lifecycle.LifecycleOwner)`","sources":[{"file":"/Users/foo/.gradle/caches/transforms-2/files-2.1/4e189041eb794a4c95a8f60aafa0c87c/autodispose-android-archcomponents-kotlin-0.8.0/jars/classes.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `org.conscrypt.Conscrypt` was not found, it is required for default or static interface methods desugaring of `okhttp3.internal.platform.Platform okhttp3.internal.platform.ConscryptPlatform.buildIfSupported()`","sources":[{"file":"/Users/foo/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.11.0/75966e05a49046ca2ae734e5626f28837a8d1e82/okhttp-3.11.0.jar"}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Type `sun.misc.Unsafe` was not found, it is required for default or static interface methods desugaring of `void com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper.<clinit>()`","sources":[{"file":"/Users/foo/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/24.1.1-android/e806df025169cdef2b724428836fc2c8c8c65951/guava-24.1.1-android.jar"}],"tool":"D8"}
ga...@google.com <ga...@google.com> #14
Increasing priority as we should really fix this. I will check if everything is set up correctly on the AGP end, and we can even provide a flag to suppress desugaring warnings.
ze...@google.com <ze...@google.com>
ze...@google.com <ze...@google.com> #15
The diagnostic types for desugar have landed in R8 and are merged to studio master with 1.6.2-dev
Ivan@ Should I cherry-pick these changes to our 1.5 branch for inclusion in the next point release?
Ivan@ Should I cherry-pick these changes to our 1.5 branch for inclusion in the next point release?
ga...@google.com <ga...@google.com> #16
If it is a clean cherry-pick, I'd push those changes to 1.5. If not, I'd rather not risk it as it is quite late in 3.5 release cycle.
ga...@google.com <ga...@google.com> #18
Cherry-picked to 3.5, it should be out in 3.5.0-beta04.
ga...@google.com <ga...@google.com> #19
Slight correction, this will be fixed in 3.5.0-beta05, it did not make it to beta04.
lu...@ozrunways.com <lu...@ozrunways.com> #20
The linked commit,
https://www.google.com/url?q=https://android.googlesource.com/platform/tools/base/%2B/061883b4bd9cba1d0725639069761f00bd4ed02a
talks about skipping desugaring in API 24+. Does this mean that the warnings will still be output when building for API <= 23? (eg our release build has minSDK < 23).
talks about skipping desugaring in API 24+. Does this mean that the warnings will still be output when building for API <= 23? (eg our release build has minSDK < 23).
yp...@gmail.com <yp...@gmail.com> #22
hi guys, in my project I set the java source compatibility to 1.8 but I'm using an old library compiled with java 7, however I don't know why is the java 7 library being desugared, isn't java 8 fully compatible with java 7? ie if that library was using java 8 functions then it should be desugared before packaging, so why when I use it I have to desugar it again? I saw those warnings with gradle plugin 3.4.2, now I don't see them any more when I upgraded to plugin 3.5.0 but the fact is that the problem is still there, just that now I'm not notified, I have to set in the gradle.properties the option android.enableD8.desugaring=false, otherwise the app crashes when launching. Any thoughts are appreciated, thanks.
ze...@google.com <ze...@google.com> #23
Thanks for the feedback. Could you file a new issue using https://issuetracker.google.com/issues/new?component=317603 with the full crash logs along with the studio version, gradle version and your build configuration setup for source and target language levels and minimum api level for android devices. You can assign the issue to zerny@google.com
Desugaring is needed depending on which source level you are using for your project and which Android devices you are targeting. Having it enabled should not cause issues for a correctly configured build, so either something in the build is amiss, or desugaring is doing something wrong.
Desugaring is needed depending on which source level you are using for your project and which Android devices you are targeting. Having it enabled should not cause issues for a correctly configured build, so either something in the build is amiss, or desugaring is doing something wrong.
Description
Repro:
- Create new project using wizard in Android Studio 3.4 Canary 2
- Enable desugaring by adding this to the android block of the app/build.gradle file
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
- Add a dependency on an artifact that has classes implementing an interface not available in Android, for example add this to app/build.gradle dependencies block:
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
- Run "Make project" from IDE or ./gradlew clean app:assemble from command-line.
Note that in the IDE build output a warning is emitted:
AGPBI: {"kind":"warning","text":"Type `org.conscrypt.Conscrypt` was not found, it is required for default or static interface methods desugaring of `okhttp3.internal.platform.Platform okhttp3.internal.platform.ConscryptPlatform.buildIfSupported()`","sources":[{"file":"/home/user/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.11.0/75966e05a49046ca2ae734e5626f28837a8d1e82/okhttp-3.11.0.jar"}],"tool":"D8"}
Also note that on the command-line build output a warning is emitted:
/home/user/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.11.0/75966e05a49046ca2ae734e5626f28837a8d1e82/okhttp-3.11.0.jar: D8: Type `org.conscrypt.Conscrypt` was not found, it is required for default or static interface methods desugaring of `okhttp3.internal.platform.Platform okhttp3.internal.platform.ConscryptPlatform.buildIfSupported()`
These are the types of warning I'd like to be able to suppress somehow.
NB. Tested using:
compileSdkVersion 28
com.android.tools.build:gradle:3.4.0-alpha02