epub_viewer 包发布构建崩溃

epub_viewer Package Release Build Crash

我正在开发一个带有 epub_viewer 包的应用程序,我将应用程序设置为发布模式。 Android 如果我使用 epub_viewer 包,应用程序会在启动时崩溃。我确定我做的一切都是对的。顺便说一句,它在调试模式下工作。我打开了一个 github 问题,但我找不到任何东西,也许我可以在这里找到帮助。我尝试了 pub dev 中的所有包,但其中 none 工作正常。如果您有工作包或其他建议方法,我将不胜感激。

            EpubViewer.setConfig(
                themeColor: Theme.of(context).primaryColor,
                identifier: "iosBook",
                scrollDirection: EpubScrollDirection.ALLDIRECTIONS,
                allowSharing: true,
                enableTts: true,
                nightMode: false
                );

            EpubViewer.locatorStream.listen((locator) {
              debugPrint(
                  'LOCATOR: ${EpubLocator.fromJson(jsonDecode(locator))}');
            });

            EpubViewer.open(ePubUrl);

我已经处理这个问题很长时间了,最​​后我意识到我的包有冲突。

epub_vieweradapty_flutter 包在发布模式下不能同时工作。要解决此问题,只需在您的 应用级别 build.gradle

中添加以下代码

The issue of my problem is attached.

flutter {
    source '../..'
}

dependencies {
    implementation ..

    // Add this lines app level build.gradle
    implementation('androidx.appcompat:appcompat') {
    version {
        strictly '1.2.0'
        }
    }
    implementation 'androidx.core:core:1.5.0'
    // Your problem will be solved.
}