sqlcipher / android-database-sqlcipher

Android SQLite API based on SQLCipher
https://www.zetetic.net/sqlcipher/sqlcipher-for-android/
Other
2.73k stars 564 forks source link

Couldn't load stlport_shared #27

Closed Swarnamahesh closed 12 years ago

Swarnamahesh commented 12 years ago

Thank you for providing an open source project for protecting the database, as security is a very important feature in my app. I added the jars and so files as mentioned in the installation guide and made the code changes, but I am getting the following error in loadlibs. Can you please help me with this issue.

11-17 12:18:41.827: ERROR/AndroidRuntime(31107): java.lang.UnsatisfiedLinkError: Couldn't load stlport_shared: findLibrary returned null 11-17 12:18:41.827: ERROR/AndroidRuntime(31107): at java.lang.Runtime.loadLibrary(Runtime.java:429) 11-17 12:18:41.827: ERROR/AndroidRuntime(31107): at java.lang.System.loadLibrary(System.java:554) 11-17 12:18:41.827: ERROR/AndroidRuntime(31107): at info.guardianproject.database.sqlcipher.SQLiteDatabase.loadLibs(SQLiteDatabase.java:104)

Why is it not able to load stlport_shared, should i do any specific compilation for the so files?

developernotes commented 12 years ago

Hi Swarnamahesh,

You will need to copy the libstlport_shared.so file from the libs/armeabi folder into your application's libs/armeabi folder. Can you check for that and move the file if it's not present?

Nick Parker

n8fr8 commented 12 years ago

Also, please provide us information on your OS and device type.

Swarnamahesh commented 12 years ago

Yes I did add the libstlport_shared.so file in the lib/armeabi folder. I am developing in windows 7, eclipse helios and i tested on Motorola Fire XT311 (Android 2.3.4), LG P500 (Android 2.3.3), also tried it on Google API 8 emulator (Android 2.2), crashed on all 3.

n8fr8 commented 12 years ago

it is "libs/armeabi" not "lib". Plural, with an S. :)

Swarnamahesh commented 12 years ago

yes, my oversight. It works perfectly now. Thanks for the help.

Swarnamahesh commented 12 years ago

Just an afterthought, I am able to use this only if the db is in external memory, can I create/open db from internal memory and still keep it encrypted?

harshalkalavadiya-star commented 11 years ago

i copy libstlport_shared.so file into my application lib/armeabi folder but still give error message like Couldn't load stlport_shared.so file.

developernotes commented 11 years ago

Hi harshal111,

The libstlport_shared.so file needs to be located within the libs directory, not lib.

willli666 commented 11 years ago

If your app is to be installed as a system app, the .so files need to be copied into /system/lib/ folder. Otherwise, it will give you this error.

sulochanansk commented 10 years ago

Hi All

Even i am getting same error in android 4.1 version mobile, but libstlport_shared.so file is exists in libs/armeabi folder. it is working in samsung android 2.3.3 version mobile but not working in macromax android 4.1 version mobile. what can i do to make working in all the latest versions of android.

error log is here:

java.lang.UnsatisfiedLinkError: Couldn't load stlport_shared: findLibrary returned null 10-23 16:55:59.131: W/System.err(18072): at java.lang.Runtime.loadLibrary(Runtime.java:365) 10-23 16:55:59.131: W/System.err(18072): at java.lang.System.loadLibrary(System.java:535) 10-23 16:55:59.131: W/System.err(18072): at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:142) 10-23 16:55:59.131: W/System.err(18072): at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:137) 10-23 16:55:59.131: W/System.err(18072): at org.hp.smartshopper.dbplugin.smartShopperAdapter.open(smartShopperAdapter.java:123) 10-23 16:55:59.131: W/System.err(18072): at org.hp.smartshopper.dbplugin.smartShopperDbPlugin.execute(smartShopperDbPlugin.java:46) 10-23 16:55:59.132: W/System.err(18072): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65) 10-23 16:55:59.132: W/System.err(18072): at org.apache.cordova.PluginManager.execHelper(PluginManager.java:231) 10-23 16:55:59.132: W/System.err(18072): at org.apache.cordova.PluginManager.exec(PluginManager.java:216) 10-23 16:55:59.133: W/System.err(18072): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53) 10-23 16:55:59.133: W/System.err(18072): at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method) 10-23 16:55:59.134: W/System.err(18072): at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method) 10-23 16:55:59.134: W/System.err(18072): at android.webkit.JWebCoreJavaBridge.fireSharedTimer(JWebCoreJavaBridge.java:92) 10-23 16:55:59.134: W/System.err(18072): at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:108) 10-23 16:55:59.134: W/System.err(18072): at android.os.Handler.dispatchMessage(Handler.java:99) 10-23 16:55:59.136: W/System.err(18072): at android.os.Looper.loop(Looper.java:153) 10-23 16:55:59.136: W/System.err(18072): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:837) 10-23 16:55:59.137: W/System.err(18072): at java.lang.Thread.run(Thread.java:856)

developernotes commented 10 years ago

Hi sulochanansk,

Is your application being installed as a system application, versus being installed within the /data partition? Also, please verify with apktool that you are in fact bundling stlport_shared.so.

sulochanansk commented 10 years ago

it is installed as a system application. i have checked with apktool . here is the list of all so files of .apk file.

lib/armeabi/libdatabase_sqlcipher.so lib/armeabi/libsqlcipher_android.so lib/armeabi/libstlport_shared.so lib/armeabi/libblank.so lib/armeabi-v7a/libaurasma_cpufeatures.so lib/armeabi-v7a/libgnustl_shared.so lib/armeabi-v7a/libtracker.so lib/armeabi-v7a/libtracker_neon.so lib/x86/libblank.so

only stlport_shared.so lib is not loading while creating database. is there any other proceess ti load .so files in case of new Android versions.

developernotes commented 10 years ago

Hi sulochanansk,

Could you try the recommendation here?

sulochanansk commented 10 years ago

sorry i did not get recommendation ????? what you want me to try?

developernotes commented 10 years ago

Hi sulochanansk,

Could you try copying stlport_shared.so into the /system/lib directory before you attempt to call SQLiteDatabase.loadLibs(…).

rammansawala commented 8 years ago

Hi developernotes,

I could not got /system/lib where can i get it?

I have already posted my project details on https://discuss.zetetic.net/t/java-lang-unsatisfiedlinkerror-couldnt-find-liblibstlport-shared-so/721

Please see this. I need help.

developernotes commented 8 years ago

Hello @rammansawala,

I have replied to your discuss post, please review and provide any further feedback within the discuss post. Thanks!