Questions tagged [jdk-desugaring]

14 questions
15
votes
1 answer

java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/Math8 when upgrading Gradle and Android Gradle Plugin

I'm working on an Android app with a Gradle version of 7.1.1 and an Android Gradle Plugin version of 7.0.0. When I upgrade to Gradle version 7.2 and Android Gradle Plugin version 7.1.1, I get the following error. 2022-03-02 17:15:47.072…
Ryan Payne
  • 5,249
  • 4
  • 28
  • 69
13
votes
5 answers

Android Gradle Build Plugin 4.0.0 & R8 Desugaring not working on API 19

I'm switching an Android application from using Proguard's desugaring to the new R8 desugaring available in Android Gradle Build Plugin 4.0.0. I've followed the steps as detailed in the official documentation to enable Java 8 library…
7
votes
1 answer

Android coreLibraryDesugaringEnabled, connected test crash with NoSuchMethodError

I added coreLibraryDesugaringEnabled to our app, and it works fine for normal app runs. compileOptions { coreLibraryDesugaringEnabled true } and coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.9' However, when I run a…
Jeffrey Blattman
  • 22,176
  • 9
  • 79
  • 134
5
votes
0 answers

Call requires API level 26 while using Java 8+ API desugaring support

I'm testing Java 8+ API desugaring support on a project with minSdk 23. When I use the java.time library, for example val instant = Instant.now(), I get the following error: Call requires API level 26 (current min is 23): java.time.Instant#now The…
kike
  • 4,255
  • 5
  • 23
  • 41
3
votes
0 answers

Generate desugared library for B4A

I'm making an Android library for B4A framework. Here's the situation: My Android library uses Java8 features (such as Lambda) B4A (Basic4Android) uses legacy dex (instead of d8) to make the apps and thus, incompatible with java8 and will not…
Mahdi-Malv
  • 16,677
  • 10
  • 70
  • 117
2
votes
1 answer

How can I debug java.time classes in an Android app with desugaring enabled?

In the app that I develop we use ZonedDateTime and some other classes from java.time package very often. And from time to time there is a need for debugging. I am facing such problems as: methodNotFound exception when I try to invoke a getter for a…
Inliner
  • 1,061
  • 7
  • 10
2
votes
1 answer

android: Desugaring of ZonedDateTime results in TimeOffset being null

I'm trying to migrate from ThreeTen Android Backport to java.time with desugaring. On debug builds this works perfectly, but on release builds (minifyEnabled = true) I get a weird error on runtime. After a ZonedDateTime is serialized (passing a…
goemic
  • 1,092
  • 12
  • 24
2
votes
1 answer

Desugaring - Java 8 Stream API with Proguard crash in release version

The app crashes only in its release version with desugaring Java 8 for Android. compileOptions { // Flag to enable support for the new language APIs coreLibraryDesugaringEnabled true // Sets Java compatibility to Java 8 …
Bitwise DEVS
  • 2,858
  • 4
  • 24
  • 67
2
votes
2 answers

Cannot resolve external dependency com.android.tools:desugar_jdk_libs:1.0.9 because no repositories are defined

I am using Android Studio version 4.1.2. My project was working fine. I updated it to Android Studio 4.1.3. I still get the errors on reinstalling AS 4.1.2. I started getting the following error: Could not resolve all files for configuration…
2
votes
0 answers

Why does Android Studio Lint report "Calling new methods on older versions" on Date functions even after adding desugaring for Java 8 support?

I have the latest AS 4.01 installed, and the latest dependency set up for Java 8 support with coreLibraryDesugaring (1.0.10), and proper compileOptions in my build.gradle file. The following code compiles and runs with no error on a device using API…
tfrysinger
  • 1,306
  • 11
  • 26
0
votes
0 answers

Android Desugaring with nio Failed to transform FakeDependency.jar to match attributes

Added the desugaring dependency as instructed in these links: https://developer.android.com/studio/write/java11-nio-support-table https://developer.android.com/studio/write/java8-support#library-desugaring I have added these in my app's…
Dhagz
  • 711
  • 5
  • 24
0
votes
1 answer

Usage of Non-SDK interfaces. Desugaring

I am checking my app in Firebase, before sending it to Play Store, and I receive this warnings: Usage of non-SDK…
jlsogorb
  • 45
  • 1
  • 5
0
votes
1 answer

d8 dex compilation fails with desugaring

I can't get d8 dex compiler to compile my jar package: $ wget https://repo1.maven.org/maven2/org/mockito/mockito-core/3.6.0/mockito-core-3.6.0.jar $ java -jar d8_2.1.86.jar --output /tmp mockito-core-3.6.0.jar 2>&1 >/dev/null | grep…
OrenIshShalom
  • 5,974
  • 9
  • 37
  • 87
0
votes
1 answer

How to get a class/interface used by third party dependency when it is desugared?

so I have this specific warning, I use desugaring and this warning comes up. one of my third party dependencies use this Bifunction but since it can't be found, app crashes. What I've found is that maybe desugaring doesn't have Bifunction class so…