Empezar un tema nuevo

Export for Android not working

 When exporting to android it sais java is not installed.

But i've java on my machine.

what do I need to do


Hi Patrick.

You actually need Java JDK to generate the keystore.

You can download it from here:

http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html


Just make sure after you install it that your operating system environment path is pointing to the JDK version and not the JRE version.

To verify (on Windows) open the command line prompt (Start menu > cmd) and type in "Keytool". If it gives you undefined, it means that something is not done right.

In Android Pie+ SQLite has changed to default to using the generally more efficient Write Ahead Logging (WAL) instead of Journal mode.


As such there will be two files with the same name as the database but suffixed with -shm (shared memory file) and -wal (write ahead log) and their presence is what I believe causes the issue(s). Temporary Files Used By SQLite (see 2.2 and 2.3)


One fix would be to disable Write Ahead Logging using use the SQliteDatabase disableWriteAheadLogging method and the previous method would work as before but with the less efficient journal mode.


(if using a subclass of SQliteOpenHelper then override the onConfigure method to invoke this method. ) disableWriteAheadLogging.

Another fix is to delete these two files when restoring. To avoid the potential for corruption you have to ensure that the database was adequately checkpointed before making the backup. see PRAGMA checkpoint;


The following is a snippet that deletes these two files when restoring (noting that the backup is assumed to have been taken with adequate checkpointing):-


                    // Added for Android 9+ to delete shm and wal file if they exist

                    File dbshm = new File(dbfile.getPath() + "-shm");

                    File dbwal = new File(dbfile.getPath()+ "-wal");

                    if (dbshm.exists()) {

                        dbshm.delete();

                    }

                    if (dbwal.exists()) {

                        dbwal.delete();

                    }

Another fix would be to additionally backup and subsequently restore the -shm and -wal files.


You may also wish considering the potential benefits of renaming the original files when importing/restoring, checking the new files after they have been copied (e.g. using PRAGMA integrity_check;) if the results indicat no issues then delete the renamed original files, otherwise delete the imported files and rename the original files to their original name, indicating that the import failed.

Iniciar sesión o Registrarse para publicar un comentario