我已经在这里和其他地方阅读了很多关于 geckoview 的文章和指南,但我没有找到解决我的问题的任何帮助。我将 geckoview 集成到我的 android 应用程序中(作为 webview 的替代品)。我按照 howtos 中的说明做了所有操作,但此时,活动想要显示,应用程序崩溃,并出现错误“java.lang.Exception:加载 sqlite 库时出错”。有人可以帮助我吗?
构建.gradle(模块)
ext {
geckoviewChannel = "nightly"
geckoviewVersion = "86.0.20210124091450"
}
repositories {
maven {
url "https://maven.mozilla.org/maven2/"
}
}
Run Code Online (Sandbox Code Playgroud)
活动XML
<org.mozilla.geckoview.GeckoView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/geckoview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
Run Code Online (Sandbox Code Playgroud)
活动顶部
import org.mozilla.geckoview.GeckoRuntime;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView;
Run Code Online (Sandbox Code Playgroud)
创建活动
boolean doGecko=true;
myGeckoView = findViewById(R.id.geckoview);
if (doGecko) {
Log.d(logTag, "starting GeckoView: "+myGeckoView);
try {
if (myGeckoSession==null) {
Log.d(logTag, "myGeckoSession = new GeckoSession()");
myGeckoSession = new GeckoSession();
}
Log.d(logTag, "GeckoSession: "+myGeckoSession);
if (myGeckoRuntime==null ) { …Run Code Online (Sandbox Code Playgroud)