android


Qt on Android studio


Using Qt creator, I complied MyLib.so, MyLibQt.so (compiled for android). MyLib is wrapper for using MyLibQt. In MyLibQt I have such lines
if (!QApplication::instance())
{
g_bCleanUpInstance = true;
new QApplication(argc, argv);
}
At Android Studio I added these libs to project (jniLibs). The lib has been successfully added to apk, it has been compiled.
The problem is: when I try call method from MyLib, using previous lines of code, I get exception:
A/MyLibQt.dll: (null):0 ((null)): This application failed to start because it could not find or load the Qt platform plugin "android"
I added to jniLibs libqtforandroid.so, but it didn't helped. So, my question is: how to resolve it?
As it is obvious from the error message, a Qt application is not just some code you can run willi-nilly, it runs against its own "runtime" that is the platform plugin, which provides the link between the Qt code and the device.
The platform plugin will be bundled with the Qt application when you are using the Qt toolchain, and in the case of android Qt apps, the Qt code is compiled as a .so library anyway. But you are explicitly compiling it as a library, so the platform plugin is not included, because it is assumed you will be using that library in a Qt application which will include it.
It may be possible to do it manually, but I am not an expert on that subject, there might be other complications, such as not running on an activity tailored to support a Qt application, or some other auxiliary files needed by Qt which would typically be created and bundled by the Qt toolchain, but it is a safe bet to do the opposite thing - just build your Qt application with the Qt toolchain, and use the necessary Java code from it.

Related Links

No automatic update using the Beta test in the Play Store
Broadcast receiver not receiving
GoogleApiClient identifier expected Android Studio error
how to create login,registration,forgotpassword dynamically
OpenGL ES texture coordinates transformations in vertex shader didn't work
Link to .swf and Compile into .apk
Android achievements are reset after one day
TextInputLayout Render error with gradle 2.3.x
Unsure of where to find this error
Custom color drop shadow around View
Error:Execution failed for task ':app:processDebugResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt
How to launch a pre-installed application in android device using appium and python with ubuntu
when i send a push notification while my app is running,my app crashes
How to create shapes in Android
Text to Speech - Not working in background
How to create an Android AVD for Pixel device, from command line?

Categories

HOME
microsoftgraph
facebook-oauth
deep-learning
wakanda
angular-formly
swt
saml-2.0
appcelerator
access
scripting
permissions
zip
x264
flume
windows-ce
ycsb
wolframalpha
html5-appcache
soci
solrcloud
gulp-watch
jquery-callback
xunit
froala
windows-server-2003
tiki-wiki
slidetoggle
intersystems-cache
subclass
winpe
custom-controls
record
gojs
numpy-broadcasting
servicestack-text
video-capture
swagger-php
magento-1.9.2.4
apic
openproject
nohup
health-monitoring
skylink
xmldocument
signal-strength
httrack
magento-2.0.7
term
linter
insight
zenhub
boxing
compiler-design
payload
seq
cronexpression
pure-css
expectations
query-by-example
blitline
relativelayout
lazybones
opserver
evolus-pencil
lasso
typemock
alloy-ui
nodelist
mruby
human-computer-interface
create.js
notorm
mbunit
inappsettingskit
workitem
stacky
android-sdk-2.3
argouml
saleslogix
apache-whirr
isa-swizzling
wiimote
luabind
android-holo-everywhere
u2netdk
drawtobitmap
clrstoredprocedure
dataform
office-2007
zen
nstokenfield
cldc
soappy
commercial-application
idatareader

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App