I am facing an issue while I am trying to replace a database and then encrypting it.
That’s my code:
boolean isSuccessfullyReplaced = mManager .replaceDatabase(dbName, sourcePath);
Database database = mManager.getDatabase(dbName);
database.changeEncryptionKey(Constants.ENCRYPTION_KEY);
When it calls changeEncryptionKey method it is throwing an exception:
com.couchbase.lite.support.action.ActionException: java.lang.NullPointerException: Attempt to invoke virtual method ‘java.io.InputStream com.couchbase.lite.support.security.SymmetricKey.decryptStream(java.io.InputStream)’ on a null object reference
It is working fine for a database but not for the other one.
Can anyone help me how to solve this.
FYI @deep.kulshreshtha @pankaj.sharma