-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
image intent doesn't work for iOS when app is closed #310
Comments
I'd also want to add that Android works fine. It's just iOS when the app is closed, that it crashes. I feed the crash report to AI, and this is what I got: The crash log you provided indicates that the app "Runner" encountered a segmentation fault (EXC_BAD_ACCESS) due to an invalid memory address (KERN_INVALID_ADDRESS at 0x0000000000000000). This typically happens when the app attempts to access memory that has not been allocated or is no longer valid. Here are some key points from the crash log and potential areas to investigate: Exception Codes: The exception codes are 0x0000000000000001, 0x0000000000000000, indicating a segmentation fault at address 0x0000000000000000. The crash occurred in the main thread (thread 0). swift_getObjectType: This symbol appears to be where the crash originated, which is related to Swift object type retrieval. The call stack shows the sequence of method calls leading to the crash. Key methods include SwiftReceiveSharingIntentPlugin.register(with:) and GeneratedPluginRegistrant.registerWithRegistry. The receive_sharing_intent plugin is heavily referenced in the call stack, suggesting that it might be the source of the issue. Ensure that the receive_sharing_intent plugin is properly registered in the app. Verify that the plugin setup is correct in both the Dart and native code. Review the implementation of the SwiftReceiveSharingIntentPlugin and ReceiveSharingIntentPlugin classes. Look for any potential issues with memory management or improper access to objects. Ensure that all dependencies and plugins are up-to-date and compatible with your current Flutter and Dart versions. Use breakpoints and logging to trace the execution flow in the SwiftReceiveSharingIntentPlugin.register(with:) method to pinpoint where the invalid memory access occurs. Try to reproduce the crash consistently by following the same steps or actions that led to the crash. This can help narrow down the exact cause. Ensure that you are testing on a device or simulator with the latest iOS version, as there might be fixes or improvements in newer releases. |
So are there any solutions ? I have the same problem. When the app is cold started, it crashes. Looking at the crash report in iOS, I found that the information indicates that the crash occurred during the app startup process, specifically when registering the SwiftReceiveSharingIntentPlugin plugin. Here is a selection of the report:
|
+1 |
How to reproduce:
I literally started a new project, just to test this out.
Now, if I swipe up, and close the app. And share the file again, the app just crashes, with the attached crash report.
Runner-2024-06-30-142648.txt
What have I done wrong or is this an actual issue with the package?
Below is my dart code:
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@OverRide
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
late StreamSubscription _intentSub;
final _sharedFiles = [];
@OverRide
void initState() {
super.initState();
}
@OverRide
void dispose() {
_intentSub.cancel();
super.dispose();
}
@OverRide
Widget build(BuildContext context) {
const textStyleBold = const TextStyle(fontWeight: FontWeight.bold);
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
children: [
Text("Shared files:", style: textStyleBold),
Text(_sharedFiles
.map((f) => f.toMap())
.join(",\n****************\n")),
],
),
),
),
);
}
}
Let me know if you need any additional information.
The text was updated successfully, but these errors were encountered: