TomRoush / PdfBox-Android

The Apache PdfBox project ported to work on Android
Apache License 2.0
995 stars 260 forks source link

PdfBox broke my tests #549

Open johngray1965 opened 9 months ago

johngray1965 commented 9 months ago

Describe the bug After adding pdfbox to my project my instrumented tests started to fail with:

Could not initialize class org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder

To reproduce


./gradlew connectedDebugAndroidTest```

**PDF example**
No pdf involved, the tests don't even use pdfbox.   It's the mere presence of pbfbox that breaks the tests.

**Expected behavior**
The tests run

**Actual behavior**
Fails to build the tests

**Environment details:**
 - PdfBox-Android version: 2.0.27.0
 - Android API version: doesn't appear to matter

**Additional context**
I'm not sure this is really a bug per se, but it's a big problem for me nonetheless.   I'm hoping there's a simple workaround.   BTW, I did git bisect to figure where the tests broke, it's definitely the commit where pfbox was added.   I was able to get the commit after pdfbox was added to run the tests by removing pdfbox and commenting out the code that used it.   It can build releases of the app, I can run unit tests, but I cannot run tests on the device since I added the dependency to pdfbox.
johngray1965 commented 9 months ago

This appears to be due to conflicting versions for of bouncy-castle. Dependbot is telling you to update. Please, please, please apply the update.