App crashing at start in iOS 13.3.1 when using SQLite and TC 5.1.4
Dear, good morning!
We had a problem when deploying app with SQLite to iOS 13.3.1, but I dont know if it occurs with previous iOS versions too.
Application works fine in any other platforms! (java, android, win32)
There is a video to show my problem:
WhatsApp_Video_2020-03-12_at_10.00.36
And there is the code that u can use to reproduce this issue:
package br.com.lyncissistemas.principal;
import java.sql.SQLException;
import totalcross.sql.Connection;
import totalcross.sql.Driver;
import totalcross.sql.DriverManager;
import totalcross.sql.Statement;
import totalcross.sys.Settings;
import totalcross.ui.Button;
import totalcross.ui.Edit;
import totalcross.ui.MainWindow;
import totalcross.ui.Toast;
import totalcross.ui.event.ControlEvent;
import totalcross.ui.event.PressListener;
import totalcross.util.UnitsConverter;
public class LyncisTestCase extends MainWindow {
public static Connection driver;
static {
Settings.applicationId = "TEST";
Settings.appVersion = "1.0.0";
Settings.iosCFBundleIdentifier = "br.com.lyncissistemas.lyncistestcase";
Settings.is24Hour = true;
Settings.uiAdjustmentsBasedOnFontHeight = true;
Settings.virtualKeyboard = true;
try {
DriverManager.registerDriver((Driver) new totalcross.db.sqlite.JDBC());
driver = DriverManager.getConnection("jdbc:sqlite:banco.db");
StringBuilder sql = new StringBuilder();
sql.append("vacuum;");
sql.append("PRAGMA auto_vacuum = FULL;");
sql.append("PRAGMA locking_mode = NORMAL;");
try (Statement st = driver.createStatement();) {
st.execute(sql.toString());
st.close();
}
} catch (SQLException e) {
Toast.show("Erro ao obter conexão com o banco : " + e.getMessage(), 5000);
if (Settings.platform.equals(Settings.JAVA))
e.printStackTrace();
throw new RuntimeException(e);
}
}
public LyncisTestCase() {
super("LyncisTest", NO_BORDER);
setUIStyle(Settings.ANDROID_UI);
Edit.useNativeNumericPad = true;
}
@Override
public void initUI() {
Edit edtTest = new Edit();
add(edtTest, CENTER, CENTER, SCREENSIZE + 60, PREFERRED);
Button btnSair = new Button("Sair");
add(btnSair, SAME, AFTER + UnitsConverter.toPixels(16 + DP), SAME, PREFERRED);
btnSair.addPressListener(new PressListener() {
@Override
public void controlPressed(ControlEvent arg0) {
exit(0);
}
});
}
}
I couldn't to get the iOS logs now cause the device is uncharged...
But u can easily to reproduce the issue with this code and bring ur own logs!
Best Regards,
Gustavo Pontes