Solved Simple apps not running on android emulator - misconfigured system?
-
Hi all,
Having sorted out my libraries (on another thread) I am now going to develop the app that uses them. But I am having problems. My best guess is that my system is misconfigured somehow, or that I have totally misunderstood which android stuff I should be running....... Since I am new to this tooling either is quite likely.
Edit: I can run the example apps fine eg SystemDialogs.
My system:
Qt 5.12.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by Clang 10.0.0 (clang-1000.11.45.2) (Apple)) on "cocoa"
OS: macOS 10.14 [darwin version 18.2.0]
Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2 RTM HLEWhat I did:
- create new project (either widget or quick app), use defaults for everything
- select all kits
- run on Android simulator (Nexus 5 using Android for x86)
This builds fine but fails in android with lots of logcat in red. It starts with warnings about unsupported flags:
W linker : Warning: "/data/app/org.qtproject.example.QuickApp-b8a-8UuY6CJ30fwgznu8pQ==/lib/x86/libQt5Network.so" has unsupported flags DT_FLAGS_1=0x80 (ignoring unsupported flags)And rapidli escalates to NPE:
W System.err: java.lang.NoSuchFieldException: No field mPivotX in class Landroid/graphics/drawable/RotateDrawable$RotateState; (declaration of 'android.graphics.drawable.RotateDrawable$RotateState' appears in /system/framework/framework.jar)
W System.err: at java.lang.Class.getDeclaredField(Native Method)
W System.err: at org.qtproject.qt5.android.ExtractStyle.getAccessibleField(ExtractStyle.java:404)
W System.err: at org.qtproject.qt5.android.ExtractStyle.getRotateDrawable(ExtractStyle.java:721) -
@aethelnorn said in Simple apps not running on android emulator - misconfigured system?:
This builds fine but fails in android with lots of logcat in red. It starts with warnings about unsupported flags:
W linker : Warning: "/data/app/org.qtproject.example.QuickApp-b8a-8UuY6CJ30fwgznu8pQ==/lib/x86/libQt5Network.so" has unsupported flags DT_FLAGS_1=0x80 (ignoring unsupported flags)This is normal - you can safely ignore these warnings.
And rapidli escalates to NPE:
W System.err: java.lang.NoSuchFieldException: No field mPivotX in class Landroid/graphics/drawable/RotateDrawable$RotateState;Is your simulator running Android 9? If yes then I think this is a known bug. Try targeting lower API and running on Android 8.
-
@sierdzio OK, thanks.
I tried again this morning and it all worked - without me doing anything. Obviously the magic of 'turn it off and on' is alive and well.
I will keep an eye out for Android 9 problems.
At the moment I have not found where in Qt to configure the android settings - I am doing a quick first 'feasibility study' -
- can I compile my c libraries (tick, yes),
- can I create a simple cross-platform app (tick, yes)
- can I call my library code from a simple cross-platform app - that is the next task. And likely the difficult step.
Once I have all these I will delve into the details of configuring and optimising but for now these would be a distraction unless, of course, they are vital to getting stuff working. So far I have been impressed with what Qt tooling does for me, and with the help I have had on these forums.
-
Yes you can link C/C++ libraries to Qt apps. That works on all platforms, although on some it's easier and on some harder (not Qt's fault).
-
@sierdzio Thanks. I programmed in C and C++ a couple of decades ago - I am hoping it will come back to me when I start.