swift-toolkit icon indicating copy to clipboard operation
swift-toolkit copied to clipboard

TestApp fails using TTS

Open morismoris opened this issue 2 years ago • 9 comments

Bug Report

Opening a book that has a graphic cover and starting the vocal reproduction the TestApp (branch main) crashes.

What happened?

The Locator crash with fatal error "Highlight is nil"

public subscript<R>(range: R) -> Text where R : RangeExpression, R.Bound == String.Index {
            guard let highlight = highlight else {
                preconditionFailure("highlight is nil")    <----- !!!
            }

Expected behavior

Jump to the first page of text

How to reproduce?

  1. Download the book "Moby-Dick" from OPDS 2.0 Test Catalog
  2. Open it
  3. Start the voice playback.

Environment

  • Readium version: 2.4.0

Development environment

macOS: 13.2.1 platform: x86_64 carthage: 0.38.0 Xcode 14.2 Build version 14C18

Testing device

  • iOS version: 15.x
  • Model (e.g. iPhone 11 Pro Max): iPhone 7
  • Is it an emulator? No

Additional context

morismoris avatar Mar 10 '23 08:03 morismoris

I could reproduce the issue from main, but this seems to be fixed in develop already. Would you mind confirming?

mickael-menu avatar Mar 10 '23 16:03 mickael-menu

I downloaded a totally new environment from develop but on this branch I can't build. I make the TestApp project with make spm and I got ‘No such module ‘ReadiumAdapterGCDWebServer’ on CBZViewController.swift at line 17.

morismoris avatar Mar 13 '23 14:03 morismoris

make spm uses the last released version. Building from develop, you should use make dev instead.

However, I think this should work too: make spm commit=develop.

Screenshot 2023-03-13 at 15 41 09

mickael-menu avatar Mar 13 '23 14:03 mickael-menu

Thank you!! Ok I can confirm that on develop the problem does not occur.

Will you release a fix for Readium 2.4.0 or we should wait and then move to Readium 2.5.0 ?

morismoris avatar Mar 14 '23 08:03 morismoris

You will need to wait for 2.5.0, which should be released in about 2 weeks.

mickael-menu avatar Mar 14 '23 08:03 mickael-menu

I downloaded a totally new environment from develop but on this branch I can't build. I make the TestApp project with make spm and I got ‘No such module ‘ReadiumAdapterGCDWebServer’ on CBZViewController.swift at line 17.

When I try to build project with CocaPods I have a similar problem ‘No such module ‘ReadiumAdapterGCDWebServer’ after migrating to version 2.7.0 from version 2.4.0 even with this pods is Podfile:

pod 'ReadiumAdapterGCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.7.0/Support/CocoaPods/ReadiumAdapterGCDWebServer.podspec'
pod 'ReadiumGCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/GCDWebServer/master/GCDWebServer.podspec'

Is there a workaround?

vlkpa avatar Apr 15 '24 14:04 vlkpa

Do you have any error when doing pod install? Do you see the ReadiumAdapterGCDWebServer library in the Pods of the project? Are you able to build the ReadiumAdapterGCDWebServer scheme?

mickael-menu avatar Apr 15 '24 16:04 mickael-menu

Do you have any error when doing pod install? Do you see the ReadiumAdapterGCDWebServer library in the Pods of the project? Are you able to build the ReadiumAdapterGCDWebServer scheme?

No pod install runs without error. Yes I can see ReadiumAdapterGCDWebServer in Pods of the project but I can't navigate to ReadiumAdapterGCDWebServer sources in Xcode (cmd + click on import ReadiumAdapterGCDWebServer). I tried clean and reinstall Pods but without success. I'm able to build project when I comment import ReadiumAdapterGCDWebServer. Do you have any suggestions? Thank you for your help/time/efforts.

vlkpa avatar Apr 15 '24 17:04 vlkpa

Could you share your whole Podfile?

You can try this to see if you can build the ReadiumAdapterGCDWebServer from your Pods.

https://github.com/readium/swift-toolkit/assets/58686775/20751f4e-16e0-4508-88bc-94906d766bb4

I just checked using the Test App and it builds fine with CocoaPods. There must be an issue in your configuration or cache.

mickael-menu avatar Apr 16 '24 15:04 mickael-menu