Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16092] Android: Couldn't load sqlcipher_android: findLibrary returned null

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-01-07T03:59:24.000+0000
Affected Version/sn/a
Fix Version/s2014 Sprint 01, 2014 Sprint 01 Core, Release 3.2.1, Release 3.3.0
ComponentsAndroid
Labelsandroid, module_android, regression, triage
ReporterRobin Michael
AssigneeChris Barber
Created2013-12-24T05:50:43.000+0000
Updated2014-01-22T18:21:01.000+0000

Description

I am facing serious issue from last 2 days. I have updated my titanium sdk from 3.1.1 to 3.2.0 and updated titanium studio also to 3.2.0, I have created a titanium android module for one of my project, that has included with third party .jar and .so files, both module and application was working fine for sdk 3.1.1 . SInce I updated my sdk yesterday, It stopped working and throwing an error "Couldn't load sqlcipher_android: findLibrary returned null" I have rebuilt the module and apps with different sdk versions, still having same problem. Please find below error details, [WARN] : W/System.err: java.lang.UnsatisfiedLinkError: Couldn't load sqlcipher_android: findLibrary returned null [WARN] : W/System.err: at java.lang.Runtime.loadLibrary(Runtime.java:365) [WARN] : W/System.err: at java.lang.System.loadLibrary(System.java:535) [WARN] : W/System.err: at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:143) [WARN] : W/System.err: at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:137) [WARN] : W/System.err: at com.mdcinternational.selfscan.internal.n.(SourceFile:38) [WARN] : W/System.err: at com.mdcinternational.selfscan.MDCSelfscan.startShoppingTrip(SourceFile:1328) [WARN] : W/System.err: at com.ncc.selfscan.NccselfscanandroidModule.startShoppingTrip(NccselfscanandroidModule.java:271) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:137) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) Anyone please help me.

Attachments

FileDateSize
Screen Shot 2013-12-24 at 9.46.09 AM.png2013-12-24T05:50:43.000+0000276079

Comments

  1. Ingo Muschenetz 2013-12-24

    It's not _exactly_ your issue, but have you searched on Google for related items? This seems close: https://github.com/sqlcipher/android-database-sqlcipher/issues/27 and suggests you need to copy some files around. Other search results for "java.lang.UnsatisfiedLinkError: Couldn't load sqlcipher android: findLibrary returned null" show a similar suggestion.
  2. Robin Michael 2013-12-26

    Thanks for reply. Yes, that seems to be closer to the issue mentioned to that link. But we cannot copy manually every time.and also we cannot publish the module with the manual action. In my case, I copied also not working. It seems problem with builder and it not copying anything to libs from lib folder. and also i think, folder naming conversion of latest androids lib to libs also one of the problem. because module creation in titanium is very old, no recent improvements and changes. Every new sdks copying old documents and put it into the new documentation. I suggest, please concentrate little bit on module creation also, because that will help a lot for native developers to move into titanium to make cross platform apps.
  3. Allen Yeung 2013-12-27

    [~rmichael], it almost seems like the .so/.jar files that you included in your module didn't make it over into the apk during the build process. If you could provide the following information, it will help us diagnose the issue: - What is the directory structure of your module project? Where did you place the .so/.jar files? If could provide a simple module test case that reproduces the issue, and attach it to the ticket, that would be best. If you can provide a sample, this is what I will be looking for: - Create an apk that uses the module, and check to see if the .so/.jar files inside the apk exist when unzipped. - Compare the apk from a 3.1.1 build vs a 3.2.0 build and see what's missing.
  4. Robin Michael 2013-12-31

    Hi @Allen Yeung, Thanks for reply. I understand the modules .so files could not find under apk. Please find the information below that you requested, module directory structure is, ->src ->assets ->build ->hooks ->lib  ->mysdk.jar  ->armeabi   ->liblib1.so   ->liblib1.so  ->x86   ->liblib1.so   ->liblib1.so ->libs  ->armeabi   ->liblib1.so   ->liblib1.so  ->armeabi-v7a   ->liblib1.so   ->liblib1.so  ->x86   ->liblib1.so   ->liblib1.so ->platform ->build.xml ->timodule.xml not mentioned some directory and files like documentation, example ..etc . In the above structure, library files(armeabi,x86) under lib folder is not copied to the module.zip under lib OR libs . But, when i copy that files to libs folder of the above structure will copy to module.zip under libs folder. I have unzipped the .apk file, I can find the .so files under lib armeabi and x86 and not an armeabi-v7a . Both 3.1.1 sdk and 3.2.0 sdk have the same, but why 3.2.0 sdk is not finding. I understand the processor thing also, The mobile i tried the application uses the processor armeabi-v7a , then why the same worked for 3.1.1 and not for 3.2.0 one more thing, i have fixed the issue by copying .so files from armeabi folder to armeabi-v7a of the libs folder in above structure. see, we are titanium developers are much happy because of performance of titanium applications, but we can give some more importance to module development also. one more thing i found titanium ios module development is not handling completion block . When I tried to make the same module for ios, i found this. Please help us and our titanium developers. Thanks, Robin M.
  5. Allen Yeung 2014-01-02

    [~rmichael], thanks for the info. I'm still having problems reproducing the issue with the information that you have provided. In general the lib directory is for jar files, so it makes sense that the .so files don't get copied over. I also believe that the libs directory contains generated .so files during the module build process, so placing files in that directory will not persist. For the jar file inside the lib directory, I did confirm that it gets compiled and run through the dexer just like in 3.1.X. I ran the old command, and noticed that the jar file inside my module was included in both the javac and dx command. At this point, it would be best if you could provide a sample module project (with the source) that shows the bug you are running into. It's unclear at the moment which library you are trying to load, and how you are loading it. If can we can reproduce the issue on our end, we can move forward with finding a resolution. Thanks!
  6. Chris Barber 2014-01-07

    Was able to reproduce this issue. Couple of notes: 1. This error could apply to many modules and is not specific to the sqlcipher module. 2. I was unable to successfully use the sqlcipher app with either 3.1.3 or 3.2.0, however I fixed this issue so that now the libs are included and both 3.1.3 and 3.2.0 have the same error message Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5191 3.2.x pull request: https://github.com/appcelerator/titanium_mobile/pull/5192
  7. Samuel Dowse 2014-01-09

    Tested On: Mac OSX 10.9.1 Titanium Studio, build: 3.2.1.201401081514 Titanium SDK, build: 3.2.0.GA Titanium SDK, build: 3.2.1.v20140108194846 Titanium SDK, build: 3.3.0.v20140108194850 CLI: 3.2.1-beta Alloy: 1.3.1-beta2 Ran through the testing process with [~cbarber] Using his steps I have discovered the following. The .so files from the module are correctly placed in the right folder location within the packaged .apk file. No errors are thrown while installing and running the .apk to a Nexus 4 running 4.2.
  8. Lokesh Choudhary 2014-01-22

    Closing based on Samuel's comments above.

JSON Source