5-stones / react-native-readium

📚 📖 React Native ebook reader for iOS, Android, & Web via Readium
MIT License
83 stars 25 forks source link

App Crash #15

Closed M-HARIS-97 closed 1 year ago

M-HARIS-97 commented 1 year ago

It works fine in debug mode. But, in the release build app crashes when navigating to ReadiumView page.

jspizziri commented 1 year ago

@M-HARIS-97 android? ios? or both?

If iOS make sure you're using the correct pod versions found in the README:

  pod 'GCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/GCDWebServer/3ec154d358f26858071feaa6429e0f1c16bb11bd/GCDWebServer.podspec', modular_headers: true
  pod 'R2Shared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.4.0/Support/CocoaPods/ReadiumShared.podspec'
  pod 'R2Streamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.4.0/Support/CocoaPods/ReadiumStreamer.podspec'
  pod 'R2Navigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.4.0/Support/CocoaPods/ReadiumNavigator.podspec'
  pod 'Minizip', modular_headers: true

As you need to use the fix that I implemented here https://github.com/readium/swift-toolkit/pull/76

M-HARIS-97 commented 1 year ago

@jspizziri I am facing problems with android. I haven't checked with ios yet. I have already added podfile changes.

M-HARIS-97 commented 1 year ago

@jspizziri I tried to create a sample application from scratch for Readium library testing. It works well on iOS and android simulator. But I took a release apk file and tried with my physical device. Then I got some error messages. Check the following images for details;

ios simulator:- Simulator Screen Shot - iPhone 13 - 2022-11-23 at 20 39 17

android simulator:- Screenshot_1669216212

physical device:- WhatsApp Image 2022-11-23 at 8 44 43 PM

jspizziri commented 1 year ago

@M-HARIS-97 I was just able to reproduce this in the example app. I'm going to take a deeper look today.

jspizziri commented 1 year ago

@M-HARIS-97 I have a solution for you. You need to add the following to your AndroidManifest.xml

<application
    ....
    android:usesCleartextTraffic="true"
    ....>

You can see more detail here. I'll add this to the README.md documentation for future users.

jspizziri commented 1 year ago

Fixed via https://github.com/5-stones/react-native-readium/commit/abc02ce9efda76e468ed151aec778612bf0b41a8

jspizziri commented 1 year ago

@M-HARIS-97 actually, I've found a much better way to do this that doesn't involve you updating anything on your end (I can actually add the config in the library itself). All you'll need to do is install the newest patch release 1.0.2.

Please update to that version and let me know if you're still having a problem.

M-HARIS-97 commented 1 year ago

@jspizziri OK, Thanks for your response.