OGR Layer crashing

150 views
Skip to first unread message

babar...@gmail.com

unread,
Apr 29, 2014, 8:01:40 AM4/29/14
to nutit...@googlegroups.com
Followed this
https://github.com/nutiteq/hellomap3d/wiki/Ogr-layer

with Shape File downloaded from http://download.geofabrik.de/asia/pakistan.html

04-29 17:00:09.588: W/System.err(30737): Native library load failed.
04-29 17:00:09.588: W/System.err(30737): java.lang.UnsatisfiedLinkError: Couldn't load ogrjni: findLibrary returned null
04-29 17:00:09.589: D/AndroidRuntime(30737): Shutting down VM
04-29 17:00:09.630: E/AndroidRuntime(30737): FATAL EXCEPTION: main
04-29 17:00:09.630: E/AndroidRuntime(30737): java.lang.ExceptionInInitializerError
04-29 17:00:09.630: E/AndroidRuntime(30737): at com.example.nutiteqmapdemo.MainActivity.loadEsriShapeFile(MainActivity.java:704)
04-29 17:00:09.630: E/AndroidRuntime(30737): at com.example.nutiteqmapdemo.MainActivity.onCreate(MainActivity.java:132)
04-29 17:00:09.630: E/AndroidRuntime(30737): at android.app.Activity.performCreate(Activity.java:5020)
04-29 17:00:09.630: E/AndroidRuntime(30737): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
04-29 17:00:09.630: E/AndroidRuntime(30737): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2155)
04-29 17:00:09.630: E/AndroidRuntime(30737): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2218)
04-29 17:00:09.630: E/AndroidRuntime(30737): at android.app.ActivityThread.access$600(ActivityThread.java:149)
04-29 17:00:09.630: E/AndroidRuntime(30737): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1304)
04-29 17:00:09.630: E/AndroidRuntime(30737): at android.os.Handler.dispatchMessage(Handler.java:99)
04-29 17:00:09.630: E/AndroidRuntime(30737): at android.os.Looper.loop(Looper.java:153)
04-29 17:00:09.630: E/AndroidRuntime(30737): at android.app.ActivityThread.main(ActivityThread.java:5026)
04-29 17:00:09.630: E/AndroidRuntime(30737): at java.lang.reflect.Method.invokeNative(Native Method)
04-29 17:00:09.630: E/AndroidRuntime(30737): at java.lang.reflect.Method.invoke(Method.java:511)
04-29 17:00:09.630: E/AndroidRuntime(30737): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
04-29 17:00:09.630: E/AndroidRuntime(30737): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
04-29 17:00:09.630: E/AndroidRuntime(30737): at dalvik.system.NativeStart.main(Native Method)
04-29 17:00:09.630: E/AndroidRuntime(30737): Caused by: java.lang.UnsatisfiedLinkError: Native method not found: org.gdal.ogr.ogrJNI.RegisterAll:()V
04-29 17:00:09.630: E/AndroidRuntime(30737): at org.gdal.ogr.ogrJNI.RegisterAll(Native Method)
04-29 17:00:09.630: E/AndroidRuntime(30737): at org.gdal.ogr.ogr.RegisterAll(ogr.java:115)
04-29 17:00:09.630: E/AndroidRuntime(30737): at com.nutiteq.datasources.vector.OGRVectorDataSource.<clinit>(OGRVectorDataSource.java:39)
04-29 17:00:09.630: E/AndroidRuntime(30737): ... 16 more

Regards
Muhammad Babar

Jaak Laineste (Nutiteq)

unread,
Apr 29, 2014, 8:12:45 AM4/29/14
to nutit...@googlegroups.com

You need native libraries also in your project.

See https://github.com/nutiteq/hellomap3d/wiki/Get-advancedmap3d-to-start - copy all files and directories from extlibs to libs.

Jaak


--
You received this message because you are subscribed to the Google Groups "Nutiteq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nutiteq-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

babar...@gmail.com

unread,
Apr 29, 2014, 8:27:24 AM4/29/14
to nutit...@googlegroups.com
I have already did this. Does i need to add all of them to build path? or copy paste in lib folder is enough?

Jaak Laineste (Nutiteq)

unread,
Apr 29, 2014, 8:45:38 AM4/29/14
to nutit...@googlegroups.com
You need native libraries also in your project.

See https://github.com/nutiteq/hellomap3d/wiki/Get-advancedmap3d-to-start - copy all files and directories from extlibs to libs.


I have already did this. Does i need to add all of them to build path? or copy paste in lib folder is enough?

With the recent Eclipse Android tools libs folder (not lib!) of the project is automatically in the build path, with native libs under subfolder armeabi (and other archtectures).

Jaak

babar...@gmail.com

unread,
Apr 29, 2014, 9:11:49 AM4/29/14
to nutit...@googlegroups.com
I have all the libraries copied inside libs folder got from extlibs folder and now also putted the armeabi .so files but same error and crash

Jaak Laineste (Nutiteq)

unread,
Apr 29, 2014, 9:15:42 AM4/29/14
to nutit...@googlegroups.com

babar...@gmail.com

unread,
Apr 29, 2014, 9:22:48 AM4/29/14
to nutit...@googlegroups.com
Oh my bad i was just putting .so files without armeabi folder. Sorry

Ale Perez

unread,
Nov 21, 2014, 10:58:22 AM11/21/14
to nutit...@googlegroups.com
Hello Jaak,

I have not found this post and I created another same, in my case, my Folder structure is as your picture represents



Why can't I call the native methods?

gis.g...@gmail.com

unread,
Jun 17, 2015, 2:30:16 AM6/17/15
to nutit...@googlegroups.com, babar...@gmail.com

Jaak Laineste (Nutiteq)

unread,
Jun 17, 2015, 2:43:13 AM6/17/15
to nutit...@googlegroups.com
Hello,

I would check following:

1. project folder/file structure. You can see some samples for Eclipse from the same thread, default folder is libs/armeabi. For Android Studio recent versions default folder for the native libraries (.so files) is src/main/jniLibs/armeabi , but you can define different one in your gradle config. 

2. make sure device supports provided architecture. E.g. geanymotion does not support armeabi and requires x86.

Jaak

Derry Indrawan

unread,
Sep 7, 2015, 12:21:05 AM9/7/15
to Nutiteq-dev
Hi, i have same issued, i already add necessary file to libs folder, but i still get exception. i using android studio.
what i must to do next ?

Jaak Laineste

unread,
Sep 7, 2015, 1:48:33 AM9/7/15
to nutit...@googlegroups.com
Hello,

Please share your folder structure to check it. Original post was about OGR layer and old SDK2.x, do you really deal with this?

Jaak
Message has been deleted

Derry Indrawan

unread,
Sep 8, 2015, 12:00:51 AM9/8/15
to Nutiteq-dev, babar...@gmail.com
Dear all,
i have already resolve the problem.
i add :

tasks.create(name: 'libs', type: Copy) {
dependsOn configurations.compile
from configurations.compile
include '*.jar'
into "build/exportedLibs"
}

tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
pkgTask.jniFolders = new HashSet<File>()
pkgTask.jniFolders.add(new File(projectDir, 'libs'))


}

on my build.gradle and its work.
thanks.

Jaak Laineste

unread,
Sep 8, 2015, 2:22:07 AM9/8/15
to nutit...@googlegroups.com, babar...@gmail.com
Hello,

I thought that if you use old Nutiteq SDK then you use also old IDE Eclipse :)

You could also copy native libs (armeabi-v7a etc) to java/main/jniLibs folder. This is default folder for AS (not libs/ as in Eclipse), and additional gradle conf is not even needed.

Jaak

Reply all
Reply to author
Forward
0 new messages