Bug: Proguard issue with Tika
I believe, based on a reading of the existing proguard setup, that we should probably just -dontwarn on this - but it may be useful to include this in the package's proguard files.
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /path/app/build/app/outputs/mapping/release/missing_rules.txt.
ERROR: R8: Missing class javax.xml.stream.XMLStreamException (referenced from: java.lang.Object org.apache.tika.utils.XMLReaderUtils.lambda$static$1(java.lang.String, java.lang.String, java.lang.String, java.lang.String))
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
> Compilation failed to complete
The only ref we have is from file_picker:
./gradlew :app:dependencies --configuration releaseRuntimeClasspath | grep tika -B10 -A10
+--- project :file_picker
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.25 (*)
| +--- androidx.core:core:1.15.0 (*)
| +--- androidx.annotation:annotation:1.9.1 (*)
| +--- androidx.lifecycle:lifecycle-runtime:2.8.7 (*)
| +--- org.apache.tika:tika-core:3.2.0
| | +--- org.slf4j:slf4j-api:2.0.17
| | \--- commons-io:commons-io:2.19.0
| +--- androidx.core:core-ktx:1.15.0 (*)
| +--- project :flutter_plugin_android_lifecycle
| | +--- androidx.annotation:annotation:1.7.0 -> 1.9.1 (*)
| | \--- io.flutter:flutter_embedding_release:1.0.0-8cd19e509d6bece8ccd74aef027c4ca947363095 (*)
| \--- io.flutter:flutter_embedding_release:1.0.0-8cd19e509d6bece8ccd74aef027c4ca947363095 (*)
Flutter 3.32.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 6fba2447e9 (6 days ago) • 2025-06-12 19:03:56 -0700
Engine • revision 8cd19e509d (6 days ago) • 2025-06-12 16:30:12 -0700
Tools • Dart 3.8.1 • DevTools 2.45.1
file_picker version: "10.2.0"
I mean, could also be worth wrapping the tika.detect calls in some error handling. Tika does rely on the XMLReaderUtils which contains the ref to javax.xml.stream.XMLStreamException
Exactly same problem happening with my app and blocking my releases
This issue is stale because it has been open for 7 days with no activity.
I have the same issue.
If I add this to the gradle dependencies it works, but that seems like not the right solution?
implementation 'javax.xml.stream:stax-api:1.0-2'
I have the same issue, using Flutter 3.35.2 and file_picker 10.3.2
Same issue with Flutter 3.35.3 / AGP 5.6.0 / file_picker 10.3.3
This issue is stale because it has been open for 7 days with no activity.