Skip to content

issues since update to version 3.5.x #249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
moodstubos opened this issue Jul 19, 2016 · 21 comments
Closed

issues since update to version 3.5.x #249

moodstubos opened this issue Jul 19, 2016 · 21 comments

Comments

@moodstubos
Copy link

Hi @ALL,

I updated from an old version to version 3.5.0 (later to 3.5.2) and I found this error at developer console:

java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1479]: 33 unknown reloc type 160 @ ( 6332)

Only old android devices seem to be affected.
I could reproduce this with the emulator. Nexus S device with android API 9.
the last line before this crash is

D/dalvikvm: Trying to load lib /data/data/com.my.app/lib/libsqlcipher.so 0x40514868

If I take version 3.5.2 the emulator crashs and rebooting virtual device.

Any ideas?

many thanks,
Graham

@developernotes
Copy link
Member

Hi @moodstubos

How are you integrating the library, are you using the AAR package? Can you provide a full stack trace? Can you confirm the version number of the library you are using that generated the error? Can you try running the SQLCipher for Android test suite on that device?

@moodstubos
Copy link
Author

Hi,
yes - aar package!
Version is 3.5.2.

do you mean this (stack trace)?:

D/dalvikvm: Trying to load lib /data/data/com.x.x/lib/libsqlcipher.so 0x40515a18
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x40015560)
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1479]: 33 unknown reloc type 160 @ ( 6332)
at java.lang.Runtime.loadLibrary(Runtime.java:434)
at java.lang.System.loadLibrary(System.java:554)
at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:177)
at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:170)
at com.x.Utils.Database.(Database.java:28)

line 28 in Database.java is:

    SQLiteDatabase.loadLibs(context);

reproduced on virtual device API 9 (Android 2.3):

image

Can test the Android test suite this night.

@developernotes
Copy link
Member

Hi @moodstubos

I was able to create a simple demo application utilizing the 3.5.2 version of SQLCipher for Android running on a Nexus S emulator which ran successfully.

screen shot 2016-07-19 at 9 27 30 am

@moodstubos
Copy link
Author

moodstubos commented Jul 19, 2016

That is very strange - I am still unable to use SQLcipher on the emulator (API 9 - armeabi):

image

my environment:

  • Android Studio 2.1.2
  • JRE 1.8.0_92-b14

fresh new android studio project. JUST add this two lines:

compile 'net.zetetic:android-database-sqlcipher:3.5.2@aar' --> build.gradle
SQLiteDatabase.loadLibs(this); --> MainActivity.java

nothing more (I promise!).

image

EDIT:
Have done the test suite - all OK!
image

Am I crackbrained ??
Where is my mistake?

@developernotes
Copy link
Member

Hi @moodstubos

I am not certain what is causing the issue you are seeing within Android Studio. I replicated your build environment and was not able to experience the same issue. To rule out an oddity, would you try either adjusting your JDK down to 1.7 and/or the Android Build Tools down to version 23 to see if either of those make a difference on your machine? Also, we recently released version 3.5.3 of SQLCipher for Android, it is worth trying that build as well. We look forward to hearing your results. Thanks!

@surajnavkudkarpersonal
Copy link

surajnavkudkarpersonal commented Aug 4, 2016

I am also facing the same issue on one device. Please find below stack trace.

Library used: net.zetetic:android-database-sqlcipher:3.5.2@aar

Date: 2016-08-03T17:17:14Z
OS Version: 4.4.4
Device: D2212
RAM Free: 16%
Disk Free: 19.5%

  1. Crashed: AsyncTask 1: 0 0 0x0000000000000000
    at android.os.AsyncTask$3.done(AsyncTask.java:300)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:841)

Fatal Exception: java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by java.lang.UnsatisfiedLinkError: Couldn't load sqlcipher from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.bluestarindia.bslservice-2.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:177)
at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:170)

@developernotes
Copy link
Member

Hello @suraj9781

It appears your application does not contain the native .so files required by SQLCipher for Android. Can you decompile your binary with apktool to verify what is being included? Are you stripping components during your build process?

@surajnavkudkarpersonal
Copy link

No .I am not stripping any components during build process and the crash occurred only one device mentioned in log ie Sony Xperia E3 Dual

@TheNephilim88
Copy link

This something thats not new in this version and also imho not really a bug within this library but strange behaviour of Android.
From time to time I receive (very rarely) those crashes too and the apk is 100% correctly built and includes all files.

I assume the problem here is related to PR #234

@developernotes
Copy link
Member

Hello @suraj9781

Would you please share the full directory structure of the decompiled apk?

@surajnavkudkarpersonal
Copy link

surajnavkudkarpersonal commented Aug 8, 2016

screenshot from 2016-08-08 10 28 25

screenshot from 2016-08-08 10 28 17

screenshot from 2016-08-08 10 28 33

screenshot from 2016-08-08 10 28 39

screenshot from 2016-08-08 10 28 45

@developernotes
Copy link
Member

Hi @suraj9781

Would you run the SQLCipher for Android test suite on the Sony Xperia and let us know your results? Thanks!

@Behrouz-m
Copy link

I had the same issue, then I've downgraded to version 3.3. Sorry I cannot provide more information because I do not have access to them.

@Behrouz-m
Copy link

Has been this issue resolved ?

@developernotes
Copy link
Member

Hi @ray-pixar

We have been unable to reproduce this issue. There has been no further communication from @moodstubos since July of this year following our additional questions regarding the issue. We believe at this point the issue may be environmental.

@Behrouz-m
Copy link

Behrouz-m commented Nov 23, 2016

Hi @developernotes
Thanks for the answer but I don't think it is an environmental problem, since I had about 3-4 users that complained about the issue. I had to downgrade the lib to the previous version as a workaround.

@developernotes
Copy link
Member

developernotes commented Nov 23, 2016

Hi @ray-pixar

We consider this an environmental issue by definition; it is not reliably reproducible, occurs only on specific devices (e.g. Sony Experia), and functions normally on standard reference platforms. Its good to know that multiple people are seeing the problem, but that doesn't mean it's not an environmental problem if they have similar environments. Unfortunately without being able to reproduce this, we can't troubleshoot it. If anyone experiencing this problem is able to provide a reproducible scenario/test for this we'd issue be happy to look into it further.

@engdinesh
Copy link

Hi i am facing this problem @developernotes , please could u help me.
E/dalvikvm: dlopen("/data/app-lib/com.microsoft.office.sfb.sfbdemo-1/libacomo.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1636): could not load library "libsqlcipher.so" needed by "libacomo.so"; caused by load_library(linker.cpp:746): library "libsqlcipher.so" not found

@developernotes
Copy link
Member

Hi @techlectdinesh

How is your application including SQLCipher for Android? It appears the native library is not present. Are you utilizing ProGuard by chance? If so, would you try disabling that?

@audippa
Copy link

audippa commented Aug 22, 2018

Hi Sir,

I was using sqlcypher very old library in my gradle and i also have .so files under src/main/jniLibs like shown in the below screen shot. and I am using greedao along with sqlcypher
image

Now my app targetapi changed to 26 and i changed sqlcypher library to api 'net.zetetic:android-database-sqlcipher:3.5.9@aar' in gradle file. I also removed jniLibs folder as well under src/main

If i install freshly my latest app then it is working perfectly.
When i am trying to upgrade my old version app to new version app then it is crashing.
below is the stacktrace.
net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master;
at net.sqlcipher.database.SQLiteCompiledSql.native_compile(Native Method)
at net.sqlcipher.database.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
at net.sqlcipher.database.SQLiteCompiledSql.(SQLiteCompiledSql.java:64)
at net.sqlcipher.database.SQLiteProgram.(SQLiteProgram.java:89)
at net.sqlcipher.database.SQLiteQuery.(SQLiteQuery.java:48)
at net.sqlcipher.database.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:60)
at net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1867)
at net.sqlcipher.database.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1785)
at net.sqlcipher.database.SQLiteDatabase.keyDatabase(SQLiteDatabase.java:2486)
at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(SQLiteDatabase.java:2415)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1149)
at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1212)
at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:162)
at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:129)

It is exactly breaking while executing the below line of code.
db = helper.getWritableDatabase(Util.generatePassPhrase());

Please suggest your suggestions

@developernotes
Copy link
Member

Hi @audippa

We use Github Issues for tracking issues with the SQLCipher for Android software itself. It appears you have an integration issue. If you have a commercial license, please reach out for private support at [email protected]. If you are a community edition user, we have a public discuss site for you to post your questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants