Android Question [SOLVED] Error compiling with B4A 14.2 R8 Enabled (PDFium?)

josejad

Expert
Licensed User
Longtime User
Hi:

I get these errors probably related witn PDFium:

B4X:
Error: Missing class android.support.annotation.Nullable (referenced from: com.github.barteksc.pdfviewer.model.PagePart com.github.barteksc.pdfviewer.CacheManager.find(java.util.PriorityQueue, com.github.barteksc.pdfviewer.model.PagePart))
Missing class android.support.v4.util.ArrayMap (referenced from: void com.shockwave.pdfium.PdfDocument.<init>())
Compilation failed
Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
    at com.android.tools.r8.internal.Nu.a


Libraries:
1790847094548.png
 

josejad

Expert
Licensed User
Longtime User
Hi Erel:

Thanks for the update. Still getting the error (I think it's the same). If you need to test it, it happens too with the demo app from B4XDaisyUIKit. You can download it from Google Drive or github from the link:


 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Added to the manifest. Same error. Maybe the problem is not PDFium itself.
The B4XDaisyUIKit sample still gets the error.

Not sure if this can be a clue: "Caused by: [CIRCULAR REFERENCE: com.android.tools.r8.internal.g: Missing class android.support.v4.util.ArrayMap (referenced from: void com.shockwave.pdfium.PdfDocument.<init>())]"
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Here it is:

B4A Version: 14.20 BETA #1 Parsing code. (3.72s) Java Version: 19 Building folders structure. (0.63s) Compiling code. (1.91s) Compiling layouts code. (0.03s) Organizing libraries. (0.05s) (AndroidX SDK) Compiling resources (0.80s) Linking resources (1.01s) build tools: 36.0.0, android jar: android-36 Compiling generated Java code. (17.86s) Selecting dexer based on #R8Optimizer flag. (0.01s) Dexing and optimizing with R8 Error Error: Missing class android.support.v4.util.ArrayMap (referenced from: void com.shockwave.pdfium.PdfDocument.<init>()) Compilation failed Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete at com.android.tools.r8.internal.Nu.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:131) at com.android.tools.r8.R8.main(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:5) Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete at Version.fakeStackEntry(Version_8.9.27.java:0) at com.android.tools.r8.S.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:5) at com.android.tools.r8.internal.Nu.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:82) at com.android.tools.r8.internal.Nu.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:32) at com.android.tools.r8.internal.Nu.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:31) at com.android.tools.r8.R8.b(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:48) at com.android.tools.r8.R8.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:1589) at com.android.tools.r8.internal.Nu.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:118) ... 1 more Caused by: com.android.tools.r8.internal.g: Missing class android.support.v4.util.ArrayMap (referenced from: void com.shockwave.pdfium.PdfDocument.<init>()) at com.android.tools.r8.internal.Le0.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:21) at com.android.tools.r8.internal.Le0.error(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:1) at com.android.tools.r8.shaking.M.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:1975) at com.android.tools.r8.shaking.M.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:1622) at com.android.tools.r8.R8.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:1510) at com.android.tools.r8.R8.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:206) at com.android.tools.r8.R8.c(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:8) at com.android.tools.r8.R8.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:1588) at com.android.tools.r8.internal.Nu.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:28) ... 4 more Suppressed: java.lang.RuntimeException: com.android.tools.r8.internal.g: Missing class android.support.v4.util.ArrayMap (referenced from: void com.shockwave.pdfium.PdfDocument.<init>()) at com.android.tools.r8.internal.Le0.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:27) at com.android.tools.r8.shaking.M.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:1977) ... 10 more Caused by: [CIRCULAR REFERENCE: com.android.tools.r8.internal.g: Missing class android.support.v4.util.ArrayMap (referenced from: void com.shockwave.pdfium.PdfDocument.<init>())] Tip: press Ctrl + R to export IDE state for AI assistants.
 
Last edited:
Upvote 0

josejad

Expert
Licensed User
Longtime User
The attachment is missing.
Hum... If I edit the post, I see the "SPOILER", but no when it's published. Fixed.
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Hello Jose,
Give this a go, even thought I don't think it will make any difference.

AddProguardText(
-dontwarn android.support.v4.util.**
)
That made the trick¡¡ Thanks Peter¡¡
 
Upvote 0
Top