readium / swift-toolkit

A toolkit for ebooks, audiobooks and comics written in Swift
https://readium.org/mobile/
BSD 3-Clause "New" or "Revised" License
256 stars 101 forks source link

Building Latest TestApp works only on Simulator #340

Closed julianpinedayyz closed 12 months ago

julianpinedayyz commented 1 year ago

Bug Report

What happened?

When Building the TestApp from here (https://github.com/readium/swift-toolkit/tree/main/TestApp) works in the simulator. I am able to add ePubs from my iCloud account to the bookshelf and open them. When building the project for a physical iPad, can't upload any epub at all. The Document Picker opens, I select an epub and I get these messages:

Same files can be opened in the simulator (iPad 10th generation)

Expected behavior

Files can be opened in both simulator and physical iPad

How to reproduce?

  1. Build TestApp for simulator iPad 10th generation
  2. touch "+" sign and add an ePub from any folder of the iPad. (In this case, I use files inside iCloud Drive with my apple account connected to the simulator)
  3. File gets added to the bookshelf and I'm able to open it.
  4. Build TestApp for physical iPad connected to the Mac (iOS 17.0.2 iPad Pro (11-inch) 3rd generation)
  5. Builds and Install R2 Reader Version 2.2.2
  6. touch "+" sign and add an ePub from any folder of the iPad. (I use my iCloud Drive and Downloads folder)
  7. Select any epub and I get the error messages listed above:
    • Error while opening this publication: The file is corrupted and cannot be opened
    • Error opening this publication: File not found

Environment

Development environment

macOS: 14.0 platform: arm64 carthage: 0.39.1 Xcode 15.0 Build version 15A240d

Testing device

Additional context

More than happy to contribute and help but my knowledge of Swift and swiftUI is pretty basic. Open to learning and help to fix issues if guided, though.

mickael-menu commented 12 months ago

Thank you for reporting this error, this was an issue regarding file access permissions in the test app. I fixed it in https://github.com/readium/swift-toolkit/pull/343. This won't require a new patch release of the toolkit as it is not impacted.