kaushikgodhani / vocsy_epub_viewer

Apache License 2.0
29 stars 68 forks source link

ReaderConfig Initialisation error #31

Closed hozefamakhariya closed 1 year ago

hozefamakhariya commented 1 year ago

I used this line of code:-

VocsyEpub.setConfig( themeColor: Theme.of(context).primaryColor, scrollDirection: EpubScrollDirection.VERTICAL, allowSharing: false, enableTts: true, nightMode: true, // identifier: bookname );

  // Get.back();
  // get current locator
  VocsyEpub.locatorStream.listen((locator) {
    print('LOCATOR: $locator');
  });

  VocsyEpub.open(
    file.path,
    lastLocation: EpubLocator(
      bookId: "",
      href: "",
      created: 0,
      locations: Locations(cfi: "")), // first page will open up if the value is null
  );

Error:-

FATAL EXCEPTION: main E/AndroidRuntime(18090): Process: com.raaymedia.saga.ebooks, PID: 18090 E/AndroidRuntime(18090): java.lang.ExceptionInInitializerError E/AndroidRuntime(18090): at com.vocsy.epub_viewer.ReaderConfig.(ReaderConfig.java:25) E/AndroidRuntime(18090): at com.vocsy.epub_viewer.EpubViewerPlugin.onMethodCall(EpubViewerPlugin.java:131) E/AndroidRuntime(18090): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262) E/AndroidRuntime(18090): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/AndroidRuntime(18090): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319) E/AndroidRuntime(18090): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/AndroidRuntime(18090): at android.os.Handler.handleCallback(Handler.java:942) E/AndroidRuntime(18090): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(18090): at android.os.Looper.loopOnce(Looper.java:201) E/AndroidRuntime(18090): at android.os.Looper.loop(Looper.java:288) E/AndroidRuntime(18090): at android.app.ActivityThread.main(ActivityThread.java:7898) E/AndroidRuntime(18090): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(18090): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) E/AndroidRuntime(18090): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) E/AndroidRuntime(18090): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.getColor(int)' on a null object reference E/AndroidRuntime(18090): at androidx.core.content.ContextCompat$Api23Impl.getColor(ContextCompat.java:886) E/AndroidRuntime(18090): at androidx.core.content.ContextCompat.getColor(ContextCompat.java:539) E/AndroidRuntime(18090): at com.folioreader.Config.(Config.java:37) E/AndroidRuntime(18090): ... 14 more I/Process (18090): Sending signal. PID: 18090 SIG: 9

hozefamakhariya commented 1 year ago

Done it was emulator issue