Re: A question about ministro !!!

658 views
Skip to first unread message

BogDan Vatra

unread,
Feb 21, 2011, 9:31:16 PM2/21/11
to andro...@googlegroups.com
Hi Eric,

Yes is possible ONLY from QtCreator, but you must have checked "Use
local qt libs", actually "Deploy local qt libs" and "Use local qt
libs" are specially made for Qt framework hackers, so if you have "Use
local qt libs" option checked, QtCreator will pass a special parameter
to you application and will force it to use local qt libs. Also if you
don't have Android Market on your device/emulator you can download and
install Ministro package using "Install Ministro system wide ..."
option or manually. If Ministro is installed on your system your
application will use it.

For more informations please check
http://sourceforge.net/p/necessitas/wiki/How%20to%20write%20Qt%20apps%20for%20Android/
.

Cheers.
BogDan.

2011/2/22 eric MONROSE <eric.m...@gmail.com>:
>
>
> I just installed the latest package qt-qt-creator and
> qt-ligthouse. I note that qt-creator grows as Qtlib
> usual. When I launch an application with qtcreator,
> that they asked me to download the pack ministro. Is it
> necessary to push the libs and at the same time be obliged to
> download minitro for launch? I do not understand
> Why? Is it possible to push the libraries as before without
> using thepackage ministro.
>

eric MONROSE

unread,
Feb 21, 2011, 9:00:43 PM2/21/11
to andro...@googlegroups.com

Toby Jackson

unread,
Feb 22, 2011, 9:03:51 PM2/22/11
to android-qt
Hello, and congratulations on the SDK.

I am having issues getting it to compile however. I think I may be
doing something very simple wrong.

I have completed the steps from the sourceforge wiki:
1. Setup Android SDK
2. How to install Necessitas SDK (5 minutes 3 click install)
3. Setup Qt Creator
4. How to write Qt apps for Android

Because they were in the manual install, I have not done the steps:
1. Compile Qt framework
2. Compile Qt creator

I started a new Mobile Application, followed the steps in "how to
write Qt apps for Android" and tried to compile but I got this output:

Running build steps for project TiernanAndroid1...
Starting: "/usr/bin/make" clean -w
make: Entering directory `/home/tiernankennedy/Downloads/Qt Android
Projects/TiernanAndroid1-build-android'
rm -f moc_mainwindow.cpp
rm -f ui_mainwindow.h
rm -f main.o mainwindow.o qtmain_android.o moc_mainwindow.o
rm -f *~ core *.core
make: Leaving directory `/home/tiernankennedy/Downloads/Qt Android
Projects/TiernanAndroid1-build-android'
The process "/usr/bin/make" exited normally.
Configuration unchanged, skipping qmake step.
Starting: "/usr/bin/make" -w
make: Entering directory `/home/tiernankennedy/Downloads/Qt Android
Projects/TiernanAndroid1-build-android'
/opt/necessitas/Android/4.7.60/bin/uic ../Tiernan-Android-1/
mainwindow.ui -o ui_mainwindow.h
/home/tiernankennedy/Downloads/android-ndk-r5b/toolchains/arm-linux-
androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -c -
Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fpic -mthumb -
ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -
DANDROID -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -
D__ARM_ARCH_5TE__ -Wa,--noexecstack -DQT_NO_QWS_TRANSFORMED -O0 -g -
fno-omit-frame-pointer -Wall -W -D_REENTRANT -DQT_GUI_LIB -
DQT_CORE_LIB -DQT_SHARED -I/opt/necessitas/Android/4.7.60/mkspecs/
android-g++ -I../Tiernan-Android-1 -I/opt/necessitas/Android/4.7.60/
include/QtCore -I/opt/necessitas/Android/4.7.60/include/QtGui -I/opt/
necessitas/Android/4.7.60/include -I. -I. -I../Tiernan-Android-1 -
I../../android-ndk-r5b/platforms/android-4/arch-arm/usr/include -
I../../android-ndk-r5b/sources/cxx-stl/gnu-libstdc++/include -I../../
android-ndk-r5b/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include -I.
-o main.o ../Tiernan-Android-1/main.cpp
/home/tiernankennedy/Downloads/android-ndk-r5b/toolchains/arm-linux-
androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -c -
Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fpic -mthumb -
ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -
DANDROID -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -
D__ARM_ARCH_5TE__ -Wa,--noexecstack -DQT_NO_QWS_TRANSFORMED -O0 -g -
fno-omit-frame-pointer -Wall -W -D_REENTRANT -DQT_GUI_LIB -
DQT_CORE_LIB -DQT_SHARED -I/opt/necessitas/Android/4.7.60/mkspecs/
android-g++ -I../Tiernan-Android-1 -I/opt/necessitas/Android/4.7.60/
include/QtCore -I/opt/necessitas/Android/4.7.60/include/QtGui -I/opt/
necessitas/Android/4.7.60/include -I. -I. -I../Tiernan-Android-1 -
I../../android-ndk-r5b/platforms/android-4/arch-arm/usr/include -
I../../android-ndk-r5b/sources/cxx-stl/gnu-libstdc++/include -I../../
android-ndk-r5b/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include -I.
-o mainwindow.o ../Tiernan-Android-1/mainwindow.cpp
../Tiernan-Android-1/mainwindow.cpp: In member function 'void
MainWindow::setOrientation(MainWindow::ScreenOrientation)':
../Tiernan-Android-1/mainwindow.cpp:55: error:
'WA_LockPortraitOrientation' is not a member of 'Qt'
../Tiernan-Android-1/mainwindow.cpp:58: error:
'WA_LockLandscapeOrientation' is not a member of 'Qt'
../Tiernan-Android-1/mainwindow.cpp:62: error: 'WA_AutoOrientation' is
not a member of 'Qt'
make: Leaving directory `/home/tiernankennedy/Downloads/Qt Android
Projects/TiernanAndroid1-build-android'
make: *** [mainwindow.o] Error 1
The process "/usr/bin/make" exited with code 2.
Error while building project TiernanAndroid1 (target: Android)
When executing build step 'Make'



What am I doing wrong here? Help very much appreciated!!

Thanks,
Tiernan



On Feb 22, 2:31 am, BogDan Vatra <taipanroma...@gmail.com> wrote:
> Hi Eric,
>
> Yes is possible ONLY from QtCreator, but you must have checked "Use
> local qt libs", actually "Deploy local qt libs" and "Use local qt
> libs" are specially made for Qt framework hackers, so if you have "Use
> local qt libs" option checked, QtCreator will pass a special parameter
> to you application and will force it to use local qt libs. Also if you
> don't have Android Market on your device/emulator you can download and
> install Ministro package using "Install Ministro system wide ..."
> option or manually. If Ministro is installed on your system your
> application will use it.
>
> For more informations please checkhttp://sourceforge.net/p/necessitas/wiki/How%20to%20write%20Qt%20apps...
> .
>
> Cheers.
> BogDan.
>
> 2011/2/22 eric MONROSE <eric.monr...@gmail.com>:

BogDan

unread,
Feb 22, 2011, 10:33:13 PM2/22/11
to android-qt
Hi Toby,

Form your error log I can see you are using some special flags
which are not in mainline Qt API (WA_LockPortraitOrientation,
WA_LockLandscapeOrientation, WA_AutoOrientation)
please remove those 3 lines and hit the run button again.


> ../Tiernan-Android-1/mainwindow.cpp:55: error:
> 'WA_LockPortraitOrientation' is not a member of 'Qt'
> ../Tiernan-Android-1/mainwindow.cpp:58: error:
> 'WA_LockLandscapeOrientation' is not a member of 'Qt'
> ../Tiernan-Android-1/mainwindow.cpp:62: error: 'WA_AutoOrientation' is

BTW, you don't need to choose "new Mobile Application" to create an
application for android, you can also choose "Qt GUI Application"

Cheers,
BogDan.

Toby Jackson

unread,
Feb 22, 2011, 11:10:05 PM2/22/11
to android-qt
Thanks for your quick response.

I just created a new blank Qt GUI project and targeted Android SDK 10.

It seemed to work right up to the last point of apk package creation.
I believe this is something to do with my "ant" configuration.

Here is the recent error code:

Running build steps for project QtAndroidTest-01...
Starting: "/opt/necessitas/Android/4.7.60/bin/qmake" '/home/
tiernankennedy/Downloads/Qt Android Projects/QtAndroidTest-01/
QtAndroidTest-01.pro' -r -spec android-g++ QMLJSDEBUGGER_PATH=/opt/
necessitas/QtCreator/share/qtcreator/qml/qmljsdebugger
The process "/opt/necessitas/Android/4.7.60/bin/qmake" exited
normally.
Starting: "/usr/bin/make" -w
make: Entering directory `/home/tiernankennedy/Downloads/Qt Android
Projects/QtAndroidTest-01-build-android'
make: Nothing to be done for `first'.
make: Leaving directory `/home/tiernankennedy/Downloads/Qt Android
Projects/QtAndroidTest-01-build-android'
The process "/usr/bin/make" exited normally.
Copy Qt app & libs to Android package ...
Stripping libraries, please wait
Creating package file ...
Package Creation: Running command '/usr/bin/apache-ant-1.8.2/bin/ant
debug'
Buildfile: /home/tiernankennedy/Downloads/Qt Android Projects/
QtAndroidTest-01/android/build.xml

[setup] Android SDK Tools Revision 9

[setup] Project Target: Android 2.3.3
[setup] API level: 10
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ------------------
[setup]
[setup] WARNING: No minSdkVersion value set. Application will
install on all Android versions.
[setup]
[setup] Importing rules file: tools/ant/main_rules.xml

-debug-obfuscation-check:


-set-debug-mode:

-compile-tested-if-test:

-dirs:
[echo] Creating output directories if needed...

-pre-build:

-resource-src:
[echo] Generating R.java / Manifest.java from the resources...

[null] /home/tiernankennedy/Downloads/Qt Android Projects/
QtAndroidTest-01/android/AndroidManifest.xml:2: Tag <manifest>
attribute package has invalid character '-'.


-aidl:

[echo] Compiling aidl files into Java classes...

-pre-compile:


compile:
[javac] /home/tiernankennedy/Downloads/android-sdk-linux_x86/tools/
ant/main_rules.xml:361: warning: 'includeantruntime' was not set,
defaulting to build.sysclasspath=last; set to false for repeatable
builds

[javac] Compiling 6 source files to /home/tiernankennedy/Downloads/
Qt Android Projects/QtAndroidTest-01/android/bin/classes

[javac] /home/tiernankennedy/Downloads/Qt Android Projects/
QtAndroidTest-01/android/gen/eu/licentia/necessitas/industrius/example/
QtAndroidTest-01/R.java:8: ';' expected
[javac] package
eu.licentia.necessitas.industrius.example.QtAndroidTest-01;

[javac]
^
[javac] 1 error


BUILD FAILED
/home/tiernankennedy/Downloads/android-sdk-linux_x86/tools/ant/
main_rules.xml:361: Compile failed; see the compiler error output for
details.

Total time: 58 seconds

Packaging Error: Command '/usr/bin/apache-ant-1.8.2/bin/ant debug'
failed.Exit code: 1
Error while building project QtAndroidTest-01 (target: Android)
When executing build step 'Packaging for Android'


Thanks for your help,

Tiernan

BogDan Vatra

unread,
Feb 23, 2011, 12:14:22 AM2/23/11
to andro...@googlegroups.com
Please send me your project (android folder).
BogDan.

2011/2/23 Toby Jackson <tiernan...@gmail.com>:

am...@amos-site.org.uk

unread,
Feb 23, 2011, 11:06:13 AM2/23/11
to android-qt
Hi

I've just setup and downloaded the necessitas packages (eventually).

I was having the same issue as Toby Jackson, so I tried running ant
install in the android folder of my project and got the following
output:

...
BUILD FAILED
/home/amos/downloads/android-sdk-linux_86/tools/ant/main_rules.xml:
483: The following error occurred while executing this line:
/home/amos/downloads/android-sdk-linux_86/tools/ant/main_rules.xml:
232: com.android.sdklib.build.ApkCreationException: Debug Certificate
expired on 14/02/11 12:16
...

A quick search on google pointed me to this StackOverflow question:
http://stackoverflow.com/q/2194808/210419

Basically you need to go to your ~/.android folder (ie the .android
folder in your home directory) and delete the debug.keystore file.
This will force another debug key to be generated, and your
application will deploy to the device (and then force close in my
case).

Cheers
Amos

am...@amos-site.org.uk

unread,
Feb 23, 2011, 6:07:40 PM2/23/11
to android-qt
I may have spoke too soon. I just started a new app and had the same
error message again.

On Feb 23, 4:06 pm, "a...@amos-site.org.uk" <a...@amos-site.org.uk>
wrote:

BogDan Vatra

unread,
Feb 23, 2011, 10:43:06 PM2/23/11
to andro...@googlegroups.com
Hi Amos,

Toby's, Tiernan's issues was caused by the fact they (he, if is the
same person) used illegal charters for package name:

[...]


[null] /home/tiernankennedy/Downloads/Qt Android Projects/
QtAndroidTest-01/android/AndroidManifest.xml:2: Tag <manifest>
attribute package has invalid character '-'.

[...]

Your problem seems to be related to your certificate which is expired.
Please be sure remove your debugging certificate, and you have latest
Android NDK (r5b) and SDK installed and working on your computer
(check https://sourceforge.net/p/necessitas/wiki/Setup%20Android%20SDK/,
and https://sourceforge.net/p/necessitas/wiki/Setup%20QtCreator/ for
more informations).

Cheers,
BogDan.

2011/2/23 am...@amos-site.org.uk <am...@amos-site.org.uk>:

Amos

unread,
Feb 24, 2011, 6:04:37 PM2/24/11
to android-qt
After checking the problem I'm now having is different to the one I
had before. I'll start a new thread to deal with it.

On Feb 24, 3:43 am, BogDan Vatra <taipanroma...@gmail.com> wrote:
> Hi Amos,
>
> Toby's, Tiernan's issues was caused by the fact they (he, if is the
> same person) used illegal charters for package name:
>
> [...]
>     [null] /home/tiernankennedy/Downloads/Qt Android Projects/
> QtAndroidTest-01/android/AndroidManifest.xml:2: Tag <manifest>
> attribute package has invalid character '-'.
> [...]
>
> Your problem seems to be related to your certificate which is expired.
> Please be sure remove your debugging certificate, and you have latest
> Android NDK (r5b) and SDK installed and working on your computer
> (checkhttps://sourceforge.net/p/necessitas/wiki/Setup%20Android%20SDK/,
> andhttps://sourceforge.net/p/necessitas/wiki/Setup%20QtCreator/for
> more informations).
>
> Cheers,
> BogDan.
>
> 2011/2/23 a...@amos-site.org.uk <a...@amos-site.org.uk>:

MP

unread,
Mar 27, 2011, 7:45:22 AM3/27/11
to android-qt
Hello,

Ministro couldn't run in Android 2.3.3 in real device (emulator
successful). Below is from logcat:

I/ActivityManager( 278): Starting: Intent
{ act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10200000
cmp=eu.licentia.necessitas.ministro/.MinistroActivity } from pid 929
W/System.err( 1805): org.xml.sax.SAXParseException: expected: /link
read: head (position:END_TAG </head>@8:8 in
java.io.InputStreamReader@40569ce8)
W/System.err( 1805): at
org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:
151)
W/System.err( 1805): at
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107)
W/System.err( 1805): at
eu.licentia.necessitas.ministro.MinistroActivity.downloadVersionXmlFile(MinistroActivity.java:
125)
W/System.err( 1805): at
eu.licentia.necessitas.ministro.MinistroService.refreshLibraries(MinistroService.java:
86)
W/System.err( 1805): at
eu.licentia.necessitas.ministro.MinistroService.onCreate(MinistroService.java:
178)
W/System.err( 1805): at
android.app.ActivityThread.handleCreateService(ActivityThread.java:
2066)
W/System.err( 1805): at android.app.ActivityThread.access
$2500(ActivityThread.java:123)
W/System.err( 1805): at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:993)
W/System.err( 1805): at
android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 1805): at android.os.Looper.loop(Looper.java:123)
W/System.err( 1805): at
android.app.ActivityThread.main(ActivityThread.java:3839)
W/System.err( 1805): at java.lang.reflect.Method.invokeNative(Native
Method)
W/System.err( 1805): at java.lang.reflect.Method.invoke(Method.java:
507)
W/System.err( 1805): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:841)
W/System.err( 1805): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
W/System.err( 1805): at dalvik.system.NativeStart.main(Native Method)
W/System.err( 1805): java.io.FileNotFoundException: /data/data/
eu.licentia.necessitas.ministro/files/version.xml (No such file or
directory)
W/System.err( 1805): at
org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
W/System.err( 1805): at dalvik.system.BlockGuard
$WrappedFileSystem.open(BlockGuard.java:232)
W/System.err( 1805): at
java.io.FileInputStream.<init>(FileInputStream.java:80)
W/System.err( 1805): at
java.io.FileInputStream.<init>(FileInputStream.java:132)
W/System.err( 1805): at
eu.licentia.necessitas.ministro.MinistroService.refreshLibraries(MinistroService.java:
89)
W/System.err( 1805): at
eu.licentia.necessitas.ministro.MinistroService.onCreate(MinistroService.java:
178)
W/System.err( 1805): at
android.app.ActivityThread.handleCreateService(ActivityThread.java:
2066)
W/System.err( 1805): at android.app.ActivityThread.access
$2500(ActivityThread.java:123)
W/System.err( 1805): at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:993)
W/System.err( 1805): at
android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 1805): at android.os.Looper.loop(Looper.java:123)
W/System.err( 1805): at
android.app.ActivityThread.main(ActivityThread.java:3839)
W/System.err( 1805): at java.lang.reflect.Method.invokeNative(Native
Method)
W/System.err( 1805): at java.lang.reflect.Method.invoke(Method.java:
507)
W/System.err( 1805): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:841)
W/System.err( 1805): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
W/System.err( 1805): at dalvik.system.NativeStart.main(Native Method)
I/ActivityManager( 278): Displayed
eu.licentia.necessitas.ministro/.MinistroActivity: +3s488ms
D/dalvikvm( 1805): GC_CONCURRENT freed 361K, 55% free 2614K/5767K,
external 0K/0K, paused 8ms+6ms
W/System.err( 1805): org.xml.sax.SAXParseException: expected: /link
read: head (position:END_TAG </head>@8:8 in
java.io.InputStreamReader@40539d78)
W/System.err( 1805): at
org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:
151)
W/System.err( 1805): at
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107)
W/System.err( 1805): at
eu.licentia.necessitas.ministro.MinistroActivity.downloadVersionXmlFile(MinistroActivity.java:
125)
W/System.err( 1805): at
eu.licentia.necessitas.ministro.MinistroActivity
$CheckLibraries.doInBackground(MinistroActivity.java:362)
W/System.err( 1805): at
eu.licentia.necessitas.ministro.MinistroActivity
$CheckLibraries.doInBackground(MinistroActivity.java:1)
W/System.err( 1805): at android.os.AsyncTask$2.call(AsyncTask.java:
185)
W/System.err( 1805): at java.util.concurrent.FutureTask
$Sync.innerRun(FutureTask.java:306)
W/System.err( 1805): at
java.util.concurrent.FutureTask.run(FutureTask.java:138)
W/System.err( 1805): at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1088)
W/System.err( 1805): at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:581)
W/System.err( 1805): at java.lang.Thread.run(Thread.java:1019)
W/System.err( 1805): java.io.FileNotFoundException: /data/data/
eu.licentia.necessitas.ministro/files/version.xml (No such file or
directory)
W/System.err( 1805): at
org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
W/System.err( 1805): at dalvik.system.BlockGuard
$WrappedFileSystem.open(BlockGuard.java:232)
W/System.err( 1805): at
java.io.FileInputStream.<init>(FileInputStream.java:80)
W/System.err( 1805): at
java.io.FileInputStream.<init>(FileInputStream.java:132)
W/System.err( 1805): at
eu.licentia.necessitas.ministro.MinistroActivity
$CheckLibraries.doInBackground(MinistroActivity.java:366)
W/System.err( 1805): at
eu.licentia.necessitas.ministro.MinistroActivity
$CheckLibraries.doInBackground(MinistroActivity.java:1)
W/System.err( 1805): at android.os.AsyncTask$2.call(AsyncTask.java:
185)
W/System.err( 1805): at java.util.concurrent.FutureTask
$Sync.innerRun(FutureTask.java:306)
W/System.err( 1805): at
java.util.concurrent.FutureTask.run(FutureTask.java:138)
W/System.err( 1805): at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1088)
W/System.err( 1805): at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:581)
W/System.err( 1805): at java.lang.Thread.run(Thread.java:1019)

BogDan Vatra

unread,
Mar 28, 2011, 2:04:18 PM3/28/11
to andro...@googlegroups.com
Hi.

It seems you don't have an internet connection.

Cheers,
BogDan.

2011/3/27 MP <phu...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages