Skip to content

[Bug]: (share_plus) unable to share files on Android in release-mode only #3602

Open
@ViscousPot

Description

@ViscousPot

Platform

Android 15

Plugin

share_plus

Version

11.0.0

Flutter SDK

3.7.0

Steps to reproduce

Simply trying to share a file on Android in release mode. Works totally fine in dev, but shows the error in the provided logs in release mode. I could not get any logs in flutter specifically, but only in logcat, filtered to my app

Code Sample

final txtFiles = <XFile>[];
for (final f in files) {
  txtFiles.add(XFile(f.path, mimeType: 'text/plain'));
}

final result = await SharePlus.instance.share(ShareParams(files: txtFiles));
print(result);

Logs

2025-06-13 23:29:21.104 16153-16153 flutter                 com.viscouspot.gitsync               I  PlatformException(Share failed, Class 'android.content.res.XmlBlock$Parser' does not implement interface 'N4.a' in call to 'int N4.a.next()' (declaration of 'v.k' appears in /data/app/~~82eJbKYgSbi4zd01v0v6aA==/com.viscouspot.gitsync-FEod7_LkQBv7I_5qS4poow==/base.apk), java.lang.IncompatibleClassChangeError: Class 'android.content.res.XmlBlock$Parser' does not implement interface 'N4.a' in call to 'int N4.a.next()' (declaration of 'v.k' appears in /data/app/~~82eJbKYgSbi4zd01v0v6aA==/com.viscouspot.gitsync-FEod7_LkQBv7I_5qS4poow==/base.apk)
                                                                                                    	at v.k.e(SourceFile:47)
                                                                                                    	at v.k.c(SourceFile:12)
                                                                                                    	at v.k.d(SourceFile:2)
                                                                                                    	at Z0.i.f(SourceFile:11)
                                                                                                    	at v3.a.onMethodCall(SourceFile:787)
                                                                                                    	at F3.c.d(SourceFile:17)
                                                                                                    	at z3.d.run(SourceFile:136)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:995)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:105)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:288)
                                                                                                    	at android.os.Looper.loop(Looper.java:393)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:9535)
                                                                                                    	at java.lang.re

Flutter Doctor

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,791ms]
    • Android SDK at /home/kdavidson/Android/Sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /home/kdavidson/.jdks/jbr-17.0.12/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment JBR-17.0.12+1-1087.25-nomod (build 17.0.12+1-b1087.25)
    • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) [23ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✗] Linux toolchain - develop for Linux desktop [193ms]
    ✗ clang++ is required for Linux development.
      It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from
      https://releases.llvm.org/
    • cmake version 4.0.1
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[✓] Android Studio (version 2024.2) [21ms]
    • Android Studio at /opt/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)

[✓] VS Code (version 1.99.3) [19ms]
    • VS Code at /usr/share/code
    • Flutter extension version 3.112.0

[✓] Connected device (2 available) [189ms]
    • CPH2581 (mobile) • 25de8a50 • android-arm64 • Android 15 (API 35)
    • Linux (desktop)  • linux    • linux-x64     • Linux Mint 22 6.8.0-59-generic

[✓] Network resources [598ms]
    • All expected network resources are available.

! Doctor found issues in 3 categories.

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions