react-native-readium
react-native-readium copied to clipboard
Support for React Native 0.73 - Android
I'm trying to use this library with the latest React Native version 0.73.4
But I'm having problems on Android. I'm running the app from an emulator.
How to reproduce
npx react-native@latest init Readium073
yarn add react-native-readium
yarn android
or use my repo
https://github.com/casperolesen/Readium073
Java version error
`Execution failed for task ':react-native-readium:compileDebugKotlin'.
'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version. Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain`
I've tried to remove this from the build.gradle
kotlinOptions {
jvmTarget = "1.8"
}
This fixes the issues with the Java version.
Build failed with an exception
I'm now getting multiple errors when trying to build like
/react-native-readium/android/src/main/java/com/reactnativereadium/ReadiumView.kt:62:7 'when' expression must be exhaustive, add necessary 'is Failure', 'OpenDrmManagementRequested', 'OpenOutlineRequested', 'StartNewSearch' branches or 'else' branch instead
/react-native-readium/android/src/main/java/com/reactnativereadium/epub/UserSettings.kt:226:73 Unresolved reference: webView
/react-native-readium/android/src/main/java/com/reactnativereadium/reader/EpubReaderFragment.kt:112:55 Unresolved reference: epub_navigator_tag
I can get the build to complete by fixing or removing the lines with errors.
Metro error
Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release
This is were I'm stuck now.
When I remove react-native-readium
the app is running fine again.
I'm not an experienced kotlin developer, but I would like to help fixing this! π¦ΈββοΈ I just don't know if it's a small bug or something that needs a bigger rewrite of this library.
If someone else can confirm that it's not working with the latest release of React Native - how should we fix it?