Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
206 views
in Technique[技术] by (71.8m points)

Geckoview in android app crashing with error "java.lang.Exception: Error loading sqlite libraries"

I already read lots of articles and howtos here and elsewhere concerning geckoview, but i didn't find any help for my problem. I integrated geckoview in my android app (as an replacement for webview). I did everything as explained in howtos, but in the moment, the activity wants to show up, the app crashes, with the error "java.lang.Exception: Error loading sqlite libraries". Could anybody help me?

build.gradle (module)

ext {
    geckoviewChannel = "nightly"
    geckoviewVersion = "86.0.20210124091450"
}

repositories {
    maven {
        url "https://maven.mozilla.org/maven2/"
    }
}

activity 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" />

activity top

import org.mozilla.geckoview.GeckoRuntime;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView;

activity onCreate

        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 ) {
                    myGeckoRuntime = GeckoRuntime.create(this);
                    Log.d(logTag, "created GeckoRuntime: "+myGeckoRuntime );
                } else {
                    myGeckoRuntime = GeckoRuntime.getDefault(this);
                    Log.d(logTag, "getting default GeckoRuntime: "+myGeckoRuntime );
                }

                Log.d(logTag, "myGeckoSession.open(myGeckoRuntime)");
                myGeckoSession.open(myGeckoRuntime);

                Log.d(logTag, "myGeckoview.setSession(myGeckoSession)");
                myGeckoView.setSession(myGeckoSession);
                Log.d(logTag, "loading url");
                myGeckoSession.loadUri("http://www.google.de");
            } catch (Exception e) {
                Log.d(logTag, "error "+e.toString() );
            }
        } else {
            myGeckoView.setVisibility(View.INVISIBLE);
        }

stack trace

2021-01-25 11:14:18.011 4815-4883/com.test.de.browseme E/GeckoLibLoad: Load sqlite start
2021-01-25 11:14:18.011 4815-4883/com.test.de.browseme E/GeckoLibLoad: Couldn't get a handle to libnss3!
2021-01-25 11:14:18.011 4815-4883/com.test.de.browseme E/GeckoLibLoad: Throw
2021-01-25 11:14:18.011 4815-4883/com.test.de.browseme E/GeckoLibLoad: Load sqlite done
2021-01-25 11:14:18.013 4815-4883/com.test.de.browseme E/AndroidRuntime: FATAL EXCEPTION: Gecko
    Process: com.test.de.browseme, PID: 4815
    java.lang.Exception: Error loading sqlite libraries
        at org.mozilla.gecko.mozglue.GeckoLoader.loadSQLiteLibsNative(Native Method)
        at org.mozilla.gecko.mozglue.GeckoLoader.loadSQLiteLibs(GeckoLoader.java:204)
        at org.mozilla.gecko.GeckoThread.loadGeckoLibs(GeckoThread.java:247)
        at org.mozilla.gecko.GeckoThread.initGeckoEnvironment(GeckoThread.java:267)
        at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:430)
question from:https://stackoverflow.com/questions/65882016/geckoview-in-android-app-crashing-with-error-java-lang-exception-error-loading

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...