MySql and Android
-
Hello.. Any updates on the MySql plugin on Android?
I managed to compile the MySql plugin... but when the lib is added to the Android project, there is an APP execution error. He follows:
ANDROID_EXTRA_LIBS += C:\mysqlarm64\lib\libmysqlclient.so
The application opens and closes with error. It does not report the error.
Am I using the wrong MySql library?
I downloaded the files from: https://dev.mysql.com/downloads/mysql/5.5.html?os=31&version=5.1Is there already any solution to access MySQL from Android?
-
@RenanHm said in MySql and Android:
Is there already any solution to access MySQL from Android?
I'm wondering what the use case is? Why do you want to access MySql server directly from an Android app?
-
Hello.. so, I use QT 5.14.2 and Windows 10.
I have successfully compiled the MySql plugin:
The file "libplugins_sqldrivers_qsqlmysql_arm64-v8a.so" is generated successfully.
When fetching the drivers through the function " QStringList drivers = QSqlDatabase::drivers();
" the driver "QMYSQL" is successfully found.But when adding the library "libmysqlclient.so" an error occurs when opening the APP on Android.
No error appears. Simply open and immediately close the APP.Now I ask: Is it possible to generate the plugin this way?
Is the MySql library correct? Or should other files be included as well?
Or just using MariaDB for MySQL access? (But I didn't find the arm64 libraries for MariaDB). -
I managed to debug.. it returns me the following error:
I Qt : qt started
E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
E AndroidRuntime: Process: com.digitalsof.totallocapp, PID: 29087
E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libpthread.so.0" not found: needed by /data/app/~~JWWP6Bwj6ZX5zMzQ0Fn3_g==/com.digitalsof.totallocapp-OqCdR438GzfaRWbmqFz5wg==/lib/arm64/libmysqlclient.so in namespace classloader-namespace
E AndroidRuntime: at java.lang.Runtime.load0(Runtime.java:929)
E AndroidRuntime: at java.lang.System.load(System.java:1625)
E AndroidRuntime: at org.qtproject.qt5.android.QtNative$3.run(QtNative.java:239)
E AndroidRuntime: at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87)
E AndroidRuntime: at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012)
19:30:21: Debugging has finished"com.digitalsof.totallocapp" died.
Help??
-
@RenanHm said in MySql and Android:
E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libpthread.so.0" not found: needed by /data/app/~~JWWP6Bwj6ZX5zMzQ0Fn3_g==
This is your issue. I'm not an Android expert, so do not know whether Android provides pthread library. Try to deploy it with your application.