Found out the problem with building qt android platform plugins...

mingw android mingw.android at gmail.com
Sat Jul 16 19:45:12 CEST 2011


Hello,

I mentioned to BogDan a platform plugin problem with my latest
install-from-local-repo of necessitas, and it turned out that it was
the qt android build I'd made that had the problem; the platform
plugins weren't being installed to the right place when building it.

I checked it on Linux to determine if it was a building-on-Windows
issue but it turned out the same on both. So I dug deeper (thanks to
qmake -d) and tracked it down to:

qt.prf:

else:isEqual(QTLIB, android) {
        contains(TEMPLATE, ".*app") {
   ...
        }else {
   ...
        }
        CONFIG(armeabi-v7a) : target.path=/libs/armeabi-v7a/
                      else : target.path=/libs/armeabi/

...this bit overwrites the target.path (which had been
/data/data/eu.licentia.necessitas.ministro/files/qt/plugins/platforms/android)
when building android-N.so or androidGL-N.so

My proposed fix (if you can think of anything cleaner then let me
know) is to change those last 2 lines with:

        QTBUILDPLUGINS=$$find(target.path, "/files/qt/plugins/")
        isEmpty( QTBUILDPLUGINS ): {
                CONFIG(armeabi-v7a) : target.path=/libs/armeabi-v7a/
                               else : target.path=/libs/armeabi/
            } else {
                CONFIG(armeabi-v7a) :
target.path=$$join(target.path,"1","","/armeabi-v7a/")
                               else :
target.path=$$join(target.path,"1","","/armeabi/")
            }
        }

So I use join and drop the libs part. This means we'll get separate
.sos for the two archs, from new the Makefiles:
	-$(INSTALL_PROGRAM)
"../../../../../../plugins/platforms/android/$(TARGET)"
"$(INSTALL_ROOT)/data/data/eu.licentia.necessitas.ministro/files/qt/plugins/platforms/android/armeabi/$(TARGET)"
and:
	-$(INSTALL_PROGRAM)
"../../../../../../plugins/platforms/android/$(TARGET)"
"$(INSTALL_ROOT)/data/data/eu.licentia.necessitas.ministro/files/qt/plugins/platforms/android/armeabi-v7a/$(TARGET)"

I'll look into the changes needed to support loading the right
platform plugin depending on the arch (is it already done?), if you
agree that this is all sensible.

It should still work correctly for the normal (i.e. using Qt Android
rather than building it) behaviour as no one will have
"/files/qt/plugins/" in their target.path.

I can submit a patch of course, just let me know.

Cheers,

Ray.

p.s. You've probably already seen it but x86 is in the latest NDK,
shall we get arm working 100% before we bother with that though? ;-)


More information about the Necessitas-devel mailing list