Description
Can we access your project?
- I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.
Current Behavior
I am using share_plus
package and I used to be able to share pdf with ease. But since 3.27.3 flutter sdk update the Share file calls are getting crashed on all Android version except Android 15 (Which hardly any of my app users currently use).
02-16 17:12:35.949 15301 15902 E flutter : [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(Share failed, Class 'android.content.res.XmlBlock$Parser' does not implement interface 'dl.a' in call to 'int dl.a.next()' (declaration of 'd0.b' appears in /data/app/~~tveD1Z7J9DHjm2iSZXyPxA==/com.exampleapp-8Vk9iCBWOiIk60RIrHWkew==/base.apk), java.lang.IncompatibleClassChangeError: Class 'android.content.res.XmlBlock$Parser' does not implement interface 'dl.a' in call to 'int dl.a.next()' (declaration of 'd0.b' appears in /data/app/~~tveD1Z7J9DHjm2iSZXyPxA==/com.exampleapp-8Vk9iCBWOiIk60RIrHWkew==/base.apk)
02-16 17:12:35.949 15301 15902 E flutter : at d0.b.g(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at d0.b.e(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at d0.b.getUriForFile(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at bh.b.j(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at bh.b.n(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at bh.a.onMethodCall(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at oh.j$a.a(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at fh.c.l(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at fh.c.m(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at fh.c.h(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at fh.b.run(SourceFile:1)
02-16 17:12:35.949 15301 15902 E flutter : at android.os.Handler.handleCallback(Handler.java:958)
02-16 17:12:35.949 15301 15902 E flutter : at android.os.Handler.dispatchMessage(Handler.java:99)
02-16 17:12:35.949 15301 15902 E flutter : at android.os.Looper.loopOnce(Looper.java:257)
02-16 17:12:35.949 15301 15902 E flutter : at android.os.Looper.loop(Looper.java:368)
02-16 17:12:35.949 15301 15902 E flutter : at android.app.ActivityThread.main(ActivityThread.java:8839)
02-16 17:12:35.949 15301 15902 E flutter : at java.lang.reflect.Method.invoke(Native Method)
02-16 17:12:35.949 15301 15902 E flutter : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572)
02-16 17:12:35.949 15301 15902 E flutter : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
02-16 17:12:35.949 15301 15902 E flutter : , null)
02-16 17:12:35.949 15301 15902 E flutter : #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:646)
02-16 17:12:35.949 15301 15902 E flutter : #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334)
02-16 17:12:35.949 15301 15902 E flutter :
02-16 17:12:35.949 15301 15902 E flutter : #2 MethodChannelShare.shareXFiles (package:share_plus_platform_interface/method_channel/method_channel_share.dart:112)
02-16 17:12:35.949 15301 15902 E flutter :
02-16 17:12:35.949 15301 15902 E flutter : #3 cartPdfShare (package:sourceCode/custom_code/actions/cart_pdf_share.dart:38)
02-16 17:12:35.949 15301 15902 E flutter :
02-16 17:12:35.949 15301 15902 E flutter : #4 _BillPdfViewShareWidgetState.build. (package:g_s_t_calculator/pages/billbox/bill_pdf_view_share/bill_pdf_view_share_widget.dart:212)
02-16 17:12:35.949 15301 15902 E flutter :
02-16 17:12:35.949 15301 15902 E flutter : #5 _FlutterFlowIconButtonState.build. (package:app_package/flutter_flow/flutter_flow_icon_button.dart:156)
02-16 17:12:35.949 15301 15902 E flutter :
02-16 17:12:35.949 15301 15902 E flutter :
Expected Behavior
The shareBillPdf function used to work fine earlier, Once the 3.27.3 update of flutter was on flutterflow the sharing files functionality gets crashed.
Steps to Reproduce
You would have to add items in the App run mode and Make bill.
After making bill click on Final PDF and Click on Whatsapp button to face this error
Reproducible from Blank
- The steps to reproduce above start from a blank project.
Bug Report Code (Required)
IT40i/nY7cx+sO4D7qn6XfVagiMhGlwYUOdEse5RaCwqGJToPLUMPsneVFRuZr2qTGxtfU6WoDoK/PfqkvDDGOwoHE6sbbpz/pNiTzuWfHGnbqqlBc+NfW1RI5tPfxW94YmjmxNQCOhiZV4cwzv3BOuXHzHdJ7WxIlQsAMqbJdeK2SrDX1iXc2URm05KZDPz
Visual documentation
cartPdfShare custom action ->
// Automatic FlutterFlow imports
import '/backend/backend.dart';
import "package:invoicer_nfjrun/backend/schema/structs/index.dart"
as invoicer_nfjrun_data_schema;
import '/backend/schema/structs/index.dart';
import '/backend/schema/enums/enums.dart';
import '/actions/actions.dart' as action_blocks;
import "package:invoicer_nfjrun/backend/schema/structs/index.dart"
as invoicer_nfjrun_data_schema;
import "package:invoicer_nfjrun/backend/schema/enums/enums.dart"
as invoicer_nfjrun_enums;
import 'package:ff_theme/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'dart:io';
import 'package:path_provider/path_provider.dart';
import 'package:share_plus/share_plus.dart';
Future cartPdfShare(FFUploadedFile pdfDoc) async {
// Add your function code here!
// Get temporary directory
final directory = await getTemporaryDirectory();
String fileName = pdfDoc.name!;
// Create a temporary file
final tempFile = File('${directory.path}/$fileName');
// Write PDF data to the file
await tempFile.writeAsBytes(pdfDoc.bytes!);
// Share the file
await Share.shareXFiles([XFile(tempFile.path)], text: 'Invoice: $fileName');
}
Environment
- FlutterFlow version: 5.2.1
- Platform: -
- Browser name and version: Chrome
- Operating system and version affected: Android 14
Additional Information
No response