[SOLVED] deploy to android



  • I’ve been creating an app for android but i have broblem while deploying to device under
    ubuntu 14.04
    deploying to : Android for x86 ( GCC 4.8, Qt 5.3.1 )

    this is the output error
    @
    19:33:19: Running steps for project android...
    19:33:19: Configuration unchanged, skipping qmake step.
    19:33:19: Starting: "/usr/bin/make"
    make: Nothing to be done for `first'.
    19:33:19: The process "/usr/bin/make" exited normally.
    19:33:19: Removing directory /media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-build
    19:33:19: Starting: "/usr/bin/make" 'INSTALL_ROOT=/media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-build' install
    /bin/sh: 1: test: /media/extra/Qt-dev/Qt: unexpected operator
    install -m 755 -p "libandroid.so" "/media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-build/libs/x86/libandroid.so"
    install: cannot create regular file '/media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-build/libs/x86/libandroid.so': No such file or directory
    make: [install_target] Error 1 (ignored)
    19:33:19: The process "/usr/bin/make" exited normally.
    19:33:40: Starting: "/home/leoussama/Workspace/programms/Qt/5.3/android_x86/bin/androiddeployqt" --input '/media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-libandroid.so-deployment-settings.json' --output '/media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-build' --deployment bundled --install --ant /usr/bin/ant --android-platform android-20 --jdk /usr/lib/jvm/java-8-oracle --device emulator-5554
    19:33:40: Pulling files necessary for debugging.
    19:33:40: Package deploy: Running command '/home/leoussama/Workspace/programms/adt-bundle-linux-x86_64/sdk/platform-tools/adb -s emulator-5554 pull /system/bin/app_process /media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/app_process'.
    19:33:40: Package deploy: Running command '/home/leoussama/Workspace/programms/adt-bundle-linux-x86_64/sdk/platform-tools/adb -s emulator-5554 pull /system/lib/libc.so /media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/libc.so'.
    Generating Android Package
    Input file: /media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-libandroid.so-deployment-settings.json
    Output directory: /media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-build
    Application binary: /media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/libandroid.so
    Android build platform: android-20
    Install to device: emulator-5554
    Application binary is not in output directory: /media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-build/libs/x86/libandroid.so. Please run 'make install INSTALL_ROOT=/media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-build' first.
    19:33:44: The process "/home/leoussama/Workspace/programms/Qt/5.3/android_x86/bin/androiddeployqt" exited with code 7.
    Error while building/deploying project android (kit: Android for x86 (GCC 4.8, Qt 5.3.1))
    When executing step 'Deploy to Android device'
    19:33:44: Elapsed time: 00:25.
    @

    Can anyone help me ?
    thanks :)


  • Moderators

    Hi,

    I'm not sure about this, but i think the deploy is getting troubled with the install path viz. /media/extra/Qt-dev/Qt Cpp apps . Since logs shows,
    @
    install
    /bin/sh: 1: test: /media/extra/Qt-dev/Qt: unexpected operator
    install -m 755 -p "libandroid.so" "/media/extra/Qt-dev/Qt Cpp apps/build-android-Android_for_x86_GCC_4_8_Qt_5_3_1-Debug/android-build/libs/x86/libandroid.so
    @
    Could you try renaming the folder "Qt Cpp apps" with something without spaces for e.g QtCppapps and see if the problems persists?



  • I had to rename all my projects with spaces in the pathnames before any of them would compile to Android correctly with recent Qt versions.

    This was compiling and deploying from Opensuse 13.1

    rgds


  • Moderators

    So Did it worked with spaces removed ?



  • thank you it worked but know there is another error
    Device Emulator API : 20
    @
    Starting remote process.D/dalvikvm( 1642): Not late-enabling CheckJNI (already on)
    D/dalvikvm( 1642): DexOpt: --- BEGIN 'QtAndroid.jar' (bootstrap=0) ---
    D/dalvikvm( 1642): DexOpt: --- END 'QtAndroid.jar' (success) ---
    D/dalvikvm( 1642): DEX prep '/data/local/tmp/qt/jar/QtAndroid.jar': unzip in 0ms, rewrite 41ms
    D/dalvikvm( 1642): DexOpt: --- BEGIN 'QtAndroidAccessibility.jar' (bootstrap=0) ---
    D/dalvikvm( 1642): DexOpt: --- END 'QtAndroidAccessibility.jar' (success) ---
    D/dalvikvm( 1642): DEX prep '/data/local/tmp/qt/jar/QtAndroidAccessibility.jar': unzip in 0ms, rewrite 14ms
    I/dalvikvm( 1642): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
    I/dalvikvm( 1642): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
    D/dalvikvm( 1642): Trying to load lib /data/local/tmp/qt/lib/libgnustl_shared.so 0xacfe6218
    E/dalvikvm( 1642): dlopen("/data/local/tmp/qt/lib/libgnustl_shared.so") failed: dlopen failed: couldn't map "/data/local/tmp/qt/lib/libgnustl_shared.so" segment 1: Permission denied
    W/System.err( 1642): java.lang.reflect.InvocationTargetException
    W/System.err( 1642): at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1642): at java.lang.reflect.Method.invoke(Method.java:515)
    W/System.err( 1642): at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:243)
    W/System.err( 1642): at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:644)
    W/System.err( 1642): at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:875)
    W/System.err( 1642): at android.app.Activity.performCreate(Activity.java:5242)
    W/System.err( 1642): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
    W/System.err( 1642): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
    W/System.err( 1642): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
    W/System.err( 1642): at android.app.ActivityThread.access$800(ActivityThread.java:138)
    W/System.err( 1642): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
    W/System.err( 1642): at android.os.Handler.dispatchMessage(Handler.java:102)
    W/System.err( 1642): at android.os.Looper.loop(Looper.java:136)
    W/System.err( 1642): at android.app.ActivityThread.main(ActivityThread.java:5026)
    W/System.err( 1642): at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1642): at java.lang.reflect.Method.invoke(Method.java:515)
    W/System.err( 1642): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
    W/System.err( 1642): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
    W/System.err( 1642): at dalvik.system.NativeStart.main(Native Method)
    W/System.err( 1642): Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/data/local/tmp/qt/lib/libgnustl_shared.so" segment 1: Permission denied
    W/System.err( 1642): at java.lang.Runtime.load(Runtime.java:333)
    W/System.err( 1642): at java.lang.System.load(System.java:574)
    W/System.err( 1642): at org.qtproject.qt5.android.QtNative.loadQtLibraries(QtNative.java:132)
    W/System.err( 1642): at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:422)
    W/System.err( 1642): ... 19 more
    D/dalvikvm( 1642): GC_FOR_ALLOC freed 177K, 12% free 2306K/2612K, paused 2ms, total 2ms
    I/dalvikvm-heap( 1642): Grow heap (frag case) to 3.448MB for 1127532-byte allocation
    D/dalvikvm( 1642): GC_FOR_ALLOC freed <1K, 9% free 3406K/3716K, paused 12ms, total 12ms
    D/dalvikvm( 1642): GC_CONCURRENT freed 0K, 9% free 3406K/3716K, paused 8ms+0ms, total 11ms
    D/ ( 1642): HostConnection::get() New Host Connection established 0xb79046c0, tid 1642
    W/EGL_emulation( 1642): eglSurfaceAttrib not implemented
    D/OpenGLRenderer( 1642): Enabling debug mode 0
    W/EGL_emulation( 1642): eglSurfaceAttrib not implemented
    @

    it looks like permission issue

    @
    E/dalvikvm( 1646): dlopen("/data/local/tmp/qt/lib/libgnustl_shared.so") failed: dlopen failed: couldn't map "/data/local/tmp/qt/lib/libgnustl_shared.so" segment 1: Permission denied
    @



  • i tried with another API version : 19 and i get this error

    @
    Starting remote process.D/dalvikvm( 1872): Not late-enabling CheckJNI (already on)
    D/dalvikvm( 1872): DexOpt: --- BEGIN 'QtAndroid.jar' (bootstrap=0) ---
    D/dalvikvm( 1872): DexOpt: --- END 'QtAndroid.jar' (success) ---
    D/dalvikvm( 1872): DEX prep '/data/local/tmp/qt/jar/QtAndroid.jar': unzip in 0ms, rewrite 23ms
    D/dalvikvm( 1872): DexOpt: --- BEGIN 'QtAndroidAccessibility.jar' (bootstrap=0) ---
    D/dalvikvm( 1872): DexOpt: --- END 'QtAndroidAccessibility.jar' (success) ---
    D/dalvikvm( 1872): DEX prep '/data/local/tmp/qt/jar/QtAndroidAccessibility.jar': unzip in 0ms, rewrite 10ms
    I/dalvikvm( 1872): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
    I/dalvikvm( 1872): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
    D/dalvikvm( 1872): Trying to load lib /data/local/tmp/qt/lib/libgnustl_shared.so 0xb2fbbb88
    D/dalvikvm( 1872): Added shared lib /data/local/tmp/qt/lib/libgnustl_shared.so 0xb2fbbb88
    D/dalvikvm( 1872): No JNI_OnLoad found in /data/local/tmp/qt/lib/libgnustl_shared.so 0xb2fbbb88, skipping init
    D/dalvikvm( 1872): Trying to load lib /data/local/tmp/qt/lib/libQt5Core.so 0xb2fbbb88
    D/dalvikvm( 1872): Added shared lib /data/local/tmp/qt/lib/libQt5Core.so 0xb2fbbb88
    D/dalvikvm( 1872): Trying to load lib /data/local/tmp/qt/lib/libQt5Gui.so 0xb2fbbb88
    D/dalvikvm( 1872): Added shared lib /data/local/tmp/qt/lib/libQt5Gui.so 0xb2fbbb88
    D/dalvikvm( 1872): No JNI_OnLoad found in /data/local/tmp/qt/lib/libQt5Gui.so 0xb2fbbb88, skipping init
    D/dalvikvm( 1872): Trying to load lib /data/local/tmp/qt/lib/libQt5Widgets.so 0xb2fbbb88
    D/dalvikvm( 1872): Added shared lib /data/local/tmp/qt/lib/libQt5Widgets.so 0xb2fbbb88
    D/dalvikvm( 1872): No JNI_OnLoad found in /data/local/tmp/qt/lib/libQt5Widgets.so 0xb2fbbb88, skipping init
    D/dalvikvm( 1872): Trying to load lib /data/local/tmp/qt/plugins/platforms/android/libqtforandroid.so 0xb2fbbb88
    D/dalvikvm( 1872): Added shared lib /data/local/tmp/qt/plugins/platforms/android/libqtforandroid.so 0xb2fbbb88
    I/Qt ( 1872): qt start
    D/dalvikvm( 1872): Trying to load lib /data/app-lib/org.qtproject.example.android-1/libandroid.so 0xb2f9af00
    D/dalvikvm( 1872): Added shared lib /data/app-lib/org.qtproject.example.android-1/libandroid.so 0xb2f9af00
    D/dalvikvm( 1872): No JNI_OnLoad found in /data/app-lib/org.qtproject.example.android-1/libandroid.so 0xb2f9af00, skipping init
    D/dalvikvm( 1872): GC_CONCURRENT freed 228K, 9% free 2889K/3172K, paused 1ms+1ms, total 4ms
    E/Qt ( 1872): androidjnimain.cpp:503 (jboolean startQtApplication(JNIEnv*, jobject, jstring, jstring)): dlsym failed: undefined symbol: main
    E/Qt ( 1872): androidjnimain.cpp:504 (jboolean startQtApplication(JNIEnv*, jobject, jstring, jstring)): Could not find main method
    D/ ( 1872): HostConnection::get() New Host Connection established 0xb7d66590, tid 1872
    W/EGL_emulation( 1872): eglSurfaceAttrib not implemented
    D/OpenGLRenderer( 1872): Enabling debug mode 0
    @

    @
    E/Qt ( 1872): androidjnimain.cpp:503 (jboolean startQtApplication(JNIEnv*, jobject, jstring, jstring)): dlsym failed: undefined symbol: main
    E/Qt ( 1872): androidjnimain.cpp:504 (jboolean startQtApplication(JNIEnv*, jobject, jstring, jstring)): Could not find main method
    @



  • problem solved just reinstalled Qt :)
    thank you :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.