question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I can't open a PDF created with the iOS 15.0 simulator in Flutter, and the app crashes.

See original GitHub issue

The Flutter app crashes with open_file. PDF can be created, displayed and downloaded normally on the actual Android device.

I changed the iOS 15.0 simulator from iPhone 13 Pro Max to iPhone SE (2nd), restarted Android Studio, and tried flutter clean, but it didn’t improve.

Execution environment

macOS BigSur / Android Studio / Simulator iOS 15.0

code

【pubspec.yaml】

dependencies:
	open_file: ^3.2.1
	pdf: ^3.6.1

【main.dart】

createPdf{
	final Document pdf = Document();
	pdf.addPage(
	  Page(
			~~~~
		),
	);
	final String dir = (await getApplicationDocumentsDirectory()).path;
	final String path = '$dir/report.pdf';
	final File file = File(path);
	await file.writeAsBytes((await pdf.save()));
	OpenFile.open(path); // ← Flutter app crashes here
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:9

github_iconTop GitHub Comments

2reactions
jprobertcommented, Jan 4, 2022

Same issue

2reactions
shofizonecommented, Nov 16, 2021

I am facing the same issue, But with the video file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flutter app crashes for iOS build on startup - Stack Overflow
Run flutter clean · Navigate to the ios folder then delete the pods folder. · From your terminal command cd ios , then...
Read more >
Fatal Exception: NSInternalInconsistencyException ... - GitHub
App crash on IOS 15.0.0 Steps to Reproduce I don't have a way to reproduce this issue. I only got this crash from...
Read more >
Simulator crashes immediately upon launch - Apple Developer
Today, instantly crashes upon launch. I have run the XCode 9 simulator and reset simulator. I have "installed" XCode 10 from app store....
Read more >
Flutter app crashes on hot restart only on iOS Simulator-Flutter
I had the same issue. After two days of debugging I have just found out it was caused by one of my dependencies....
Read more >
Changelog - Proxyman
Fixed: Rare crash when opening iOS Simulator Setup Guide due to race-condition issue; Fixed: Proxyman Helper Tool displays incorrect information on macOS ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found