Search code examples
androidmobileandroid-gps

RtkGps compile issues


I am trying to compile RtkGPS from https://github.com/sergeyastakhov/RtkGps. I am very new in Andriod environment. I use Andriod studio 2.2.2. If I make the project, it finishes without any complain. However, as as soon as I try to run in mobile emulator I got following error. Any help is highly appreciable.

ERROR:
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: gpsplus.rtkgps, PID: 26755
                  java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/gpsplus.rtkgps-2/base.apk"],nativeLibraryDirectories=[/data/app/gpsplus.rtkgps-2/lib/x86, /data/app/gpsplus.rtkgps-2/base.apk!/lib/x86, /vendor/lib, /system/lib]]] couldn't find "librtkgps.so"
                      at java.lang.Runtime.loadLibrary(Runtime.java:367)
                      at java.lang.System.loadLibrary(System.java:1076)
                      at gpsplus.rtkgps.RtkGps.onCreate(RtkGps.java:42)
                      at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
                      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
                      at android.app.ActivityThread.-wrap1(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:148)
                      at android.app.ActivityThread.main(ActivityThread.java:5417)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Solution

  • I found that I had to compile the libs using ndk-build. Including following codes in build.gradle helps to resolve this issue:

    commandLine 'ndk-build.cmd', '-C', file('src').absolutePath