Cipher problem with Android 8


#1

Hello,
In an Android app compiled by SDK 19, Cipher works perfect, but as Google asked to set Target SDK to 26, I got Error Code 14 as Couldn’t open database after changed compile and target SDk to 26.
Application has been set up in Android Studio 3.0.1 and Cipher version is 3.5.9.
Any idea, whats going wrong?
Thank you.
Bahman


#2

Hello @bahmanbj

I just recently bumped the target SDK version of SQLCipher for Android to 26, then ran the library against the SQLCipher for Android test suite without issue. Is it possible that you provided an invalid password to the database? Can you pull the database off device and test access with the SQLCipher command line shell?


#3

You imported aar file directly in the project, mine uses :
compile ‘net.zetetic:android-database-sqlcipher:3.5.9@aar’
in dependocies in build.gradle.
It is same project, same database so I didn’t touch password.
It is working perfect on SDK19, When I change SDK to 26, problem appears.
I tried your way to import module for aar file, but it says “Error Failed to resolve aar file”
Thank you


#4

Hi @bahmanbj

It sounds as if your project configuration may be of issue since it isn’t able to locate the local AAR file. Did you build the AAR yourself? You might want to refer to how we include the local AAR here.


#5

Hi,
Yes you are right.
It seems the problem comes from the new permission way which Android 8 forced to follow and how I got file path from external storage which has been changed in Android 8.
I setup a checkSelfPermission and could connect and do a query from database under Cipher.
Thank you.
Bahman


#6

Hi @bahmanbj

We are happy to hear you were able to resolve the issue. Take care!