Simran Thakkar
Simran Thakkar

Reputation: 61

Gradle 8.3.2 Upgrade gives Execution failed for task ':app:minifyReleaseWithR8'

After Upgrading my android studio and Updating my JDK from 11 to 17 Also Upgraded Gradle from 7.4.2 to 8.3.2 I am having issues to create release build apk ./gradlew assembleRelease fails with the R8 issue

The issue I am getting is something like this Execution failed for task ':stream:minifyPreprodReleaseWithR8'.

A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable Compilation failed to complete

I am also seeing something like this

Task :stream:minifyPreprodReleaseWithR8 FAILED ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/sthakkar/Desktop/GlobalTV/global-tv-android/stream/build/outputs/mapping/preprodRelease/missing_rules.txt. ERROR: R8: Missing class java.beans.ConstructorProperties (referenced from: void com.fasterxml.jackson.databind.ext.Java7SupportImpl.() and 2 other contexts) Missing class java.beans.Transient (referenced from: void com.fasterxml.jackson.databind.ext.Java7SupportImpl.() and 1 other context) Missing class javax.xml.stream.Location (referenced from: net.sf.saxon.s9api.Location net.sf.saxon.pull.StaxBridge.getSourceLocator() and 2 other contexts) Missing class javax.xml.stream.XMLEventWriter (referenced from: net.sf.saxon.event.Receiver net.sf.saxon.stax.StAXResultHandlerImpl.getReceiver(javax.xml.transform.Result, java.util.Properties)) Missing class javax.xml.stream.XMLStreamException (referenced from: void net.sf.saxon.pull.StaxBridge.close() and 10 other contexts) Missing class javax.xml.stream.XMLStreamReader (referenced from: javax.xml.stream.XMLStreamReader net.sf.saxon.pull.StaxBridge.reader and 9 other contexts) Missing class javax.xml.stream.XMLStreamWriter (referenced from: javax.xml.stream.XMLStreamWriter net.sf.saxon.stax.ReceiverToXMLStreamWriter.writer and 10 other contexts) Missing class javax.xml.stream.events.EntityDeclaration (referenced from: java.util.List net.sf.saxon.pull.StaxBridge.getUnparsedEntities()) Missing class javax.xml.transform.stax.StAXResult (referenced from: net.sf.saxon.event.Receiver net.sf.saxon.lib.SerializerFactory.getReceiverForNonSerializedResult(javax.xml.transform.Result, java.util.Properties, net.sf.saxon.event.PipelineConfiguration) and 1 other context) Missing class javax.xml.transform.stax.StAXSource (referenced from: javax.xml.transform.Source net.sf.saxon.Configuration.resolveSource(javax.xml.transform.Source, net.sf.saxon.Configuration) and 1 other context)

I tried adding enableR8 in gradle.properties but its depricated I tried Invalidate/Cache I also made sure I was using JDK 17 and also updated it in build.gradle

Upvotes: 1

Views: 288

Answers (1)

Binh Ho
Binh Ho

Reputation: 4936

Build successfully after add this to proguard-rules.pro

-dontwarn java.beans.ConstructorProperties
-dontwarn java.beans.Transient

Upvotes: 1

Related Questions