Mantano / iridium_reader_widget

Plug and play reader widget
Other
40 stars 10 forks source link

epubs not loaded due to xhtml error in epub or webview #1

Open jaded0 opened 2 years ago

jaded0 commented 2 years ago

my code: String otherpath = '${(await _filePath)}/otherepub.epub'; ByteData data = await rootBundle.load("assets/frank.epub"); List<int> bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); await File(otherpath).writeAsBytes(bytes); Navigator.push(context, MaterialPageRoute(builder: (context) => EpubScreen.fromPath(filePath: otherpath)));

Webpage not available net:ERR_CLEARTEXT_NOT_PERMITTED

is shown on the app.

I/chromium(10556): [INFO:CONSOLE(1)] "Uncaught ReferenceError: xpub is not defined", source: chrome-error://chromewebdata/ (1)

is the error code showing on the android studio console.

jaded0 commented 2 years ago

The current workaround is that the widget user must put android:usesCleartextTraffic="true" in their AndroidManifest.xml.