I have a problem when trying to generate a release version of my app. It gives a strange error
C:\Users\rshal\.gradle\caches\transforms-2\files-2.1\6c326691eb00442622017dd95f96e92a\jetified-firebase-config-19.1.3-runtime.jar: R8: NullPointerException during IR Conversion
> Task :app:minifyProdReleaseWithR8 FAILED
I have been using firebase analytics and firebase remote config without problems. And also I had no issue this R8 minimization.
Recently I have integrated google-speech-api
and after that, I am not able to use R8.
I did not have this problem until I integrated google-speech-api
in the app. I know that google-speech-api
is not officially supported on Android. Maybe that is the core issue. Before that, I had an issue with firebase-config
dependency. It is not compatible with the google-speech-api
library I think. I solved that issue with this Gradle configuration
implementation('com.google.firebase:firebase-config', {
exclude group: 'com.google.protobuf' // google-cloud-speech causes this. see https://github.com/firebase/firebase-android-sdk/issues/1143
})
I have followed this fix.
Now I am stuck with this error that I showed above.
I have tried different versions on R8 as suggested here
This is gradle build log
> Task :app:minifyProdReleaseWithR8
R8: Missing class: org.apache.logging.log4j.spi.ExtendedLoggerWrapper
R8: Missing class: org.eclipse.jetty.npn.NextProtoNego$ClientProvider
R8: Missing class: javax.servlet.ServletContextListener
R8: Missing class: org.jboss.marshalling.ByteOutput
R8: Missing class: java.lang.ClassValue
R8: Missing class: org.eclipse.jetty.alpn.ALPN$ClientProvider
R8: Missing class: org.jboss.marshalling.ByteInput
R8: Missing class: org.eclipse.jetty.alpn.ALPN$ServerProvider
R8: Missing class: org.eclipse.jetty.npn.NextProtoNego$ServerProvider
R8: Library class android.net.http.AndroidHttpClientConnection implements program class org.apache.http.HttpInetConnection
R8: Library class android.net.http.AndroidHttpClientConnection implements program class org.apache.http.HttpConnection
C:\Users\rshal\.gradle\caches\transforms-2\files-2.1\6c326691eb00442622017dd95f96e92a\jetified-firebase-config-19.1.3-runtime.jar: R8: NullPointerException during IR Conversion
> Task :app:minifyProdReleaseWithR8 FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:minifyProdReleaseWithR8'.
> com.android.tools.r8.CompilationFailedException: Compilation failed to complet
this is build.gradle
file
this is top-level Gradle file