Missing classes error when trying to build an android APK

Issue

When trying to generate an APK file fro an android app, I get these errors:

Missing class com.android.org.conscrypt.SSLParametersImpl (referenced from: void org.conscrypt.KitKatPlatformOpenSSLSocketImplAdapter.<init>(org.conscrypt.AbstractConscryptSocket))
Missing class com.gemalto.jp2.JP2Decoder (referenced from: android.graphics.Bitmap com.tom_roush.pdfbox.filter.JPXFilter.readJPX(java.io.InputStream, com.tom_roush.pdfbox.filter.DecodeOptions, com.tom_roush.pdfbox.filter.DecodeResult))
Missing class org.apache.harmony.xnet.provider.jsse.SSLParametersImpl (referenced from: void org.conscrypt.PreKitKatPlatformOpenSSLSocketImplAdapter.<init>(org.conscrypt.AbstractConscryptSocket))
Missing class org.bouncycastle.jsse.BCSSLParameters (referenced from: void okhttp3.internal.platform.BouncyCastlePlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List) and 1 other context)
Missing class org.bouncycastle.jsse.BCSSLSocket (referenced from: void okhttp3.internal.platform.BouncyCastlePlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List) and 5 other contexts)
Missing class org.bouncycastle.jsse.provider.BouncyCastleJsseProvider (referenced from: void okhttp3.internal.platform.BouncyCastlePlatform.<init>())

I added these lines to the proguard-rules.pro file:

-keep class org.conscript.** { *; }
-keep interface org.conscript.**
-dontwarn org.conscrypt.**

-keep class org.bouncycastle.** { *; }
-keep interface org.bouncycastle.**
-dontwarn org.bouncycastle.**

This doesn’t help. Do I need to add additional runtimeOnly commands to the build.gradle file (I tried runtimeOnly("org.conscrypt:conscrypt-android:2.5.2") to no avail.

Solution

I was using a library from com.rizzi.bouquet to display a pdf file contents. Removing this library stopped the errors and I was able to generate the APK release. I will look for an alternative library.

Answered By – Bruciew

Answer Checked By – Willingham (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *