flutter_file_picker icon indicating copy to clipboard operation
flutter_file_picker copied to clipboard

Bug: Proguard issue with Tika

Open dballance opened this issue 6 months ago • 7 comments

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"

dballance avatar Jun 18 '25 16:06 dballance

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

dballance avatar Jun 18 '25 16:06 dballance

Exactly same problem happening with my app and blocking my releases

provFelipeValadares avatar Jul 10 '25 16:07 provFelipeValadares

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] avatar Aug 11 '25 02:08 github-actions[bot]

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'

Hackmodford avatar Aug 21 '25 14:08 Hackmodford

I have the same issue, using Flutter 3.35.2 and file_picker 10.3.2

liran-omgene avatar Sep 01 '25 15:09 liran-omgene

Same issue with Flutter 3.35.3 / AGP 5.6.0 / file_picker 10.3.3

husbycodereis avatar Sep 15 '25 13:09 husbycodereis

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] avatar Oct 17 '25 02:10 github-actions[bot]