Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Сборка Apk пакета. Ant не может собрать.



  • 11:30:58: Выполняются этапы для проекта testAndroid...
    11:30:58: Запускается: «C:\Qt\QtAndroid\Tools\mingw492_32\bin\mingw32-make.exe» clean
    del moc_mainwindow.cpp
    del ui_mainwindow.h
    del main.obj mainwindow.obj moc_mainwindow.obj
    del *~ core *.core
    ЌҐ г¤ Ґвбп ­ ©вЁ E:\projects\build\*~
    11:30:59: Процесс «C:\Qt\QtAndroid\Tools\mingw492_32\bin\mingw32-make.exe» завершился успешно.
    11:30:59: Настройки не изменились, этап qmake пропускается.
    11:30:59: Запускается: «C:\Qt\QtAndroid\Tools\mingw492_32\bin\mingw32-make.exe» 
    C:\Qt\QtAndroid\5.5\android_armv7\bin\uic.exe ..\testAndroid\mainwindow.ui -o ui_mainwindow.h
    C:\Android\android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove -std=c++11 -g -g -marm -O0 -fno-omit-frame-pointer -Wall -Wno-psabi -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\testAndroid -I. -IC:\Qt\QtAndroid\5.5\android_armv7\include -IC:\Qt\QtAndroid\5.5\android_armv7\include\QtWidgets -IC:\Qt\QtAndroid\5.5\android_armv7\include\QtGui -IC:\Qt\QtAndroid\5.5\android_armv7\include\QtCore -I. -I. -isystem C:\Android\android-ndk-r10e\sources\cxx-stl\gnu-libstdc++\4.9\include -isystem C:\Android\android-ndk-r10e\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\include -isystem C:\Android\android-ndk-r10e\platforms\android-9\arch-arm\usr\include -IC:\Qt\QtAndroid\5.5\android_armv7\mkspecs\android-g++ -o main.obj ..\testAndroid\main.cpp
    C:\Android\android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove -std=c++11 -g -g -marm -O0 -fno-omit-frame-pointer -Wall -Wno-psabi -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\testAndroid -I. -IC:\Qt\QtAndroid\5.5\android_armv7\include -IC:\Qt\QtAndroid\5.5\android_armv7\include\QtWidgets -IC:\Qt\QtAndroid\5.5\android_armv7\include\QtGui -IC:\Qt\QtAndroid\5.5\android_armv7\include\QtCore -I. -I. -isystem C:\Android\android-ndk-r10e\sources\cxx-stl\gnu-libstdc++\4.9\include -isystem C:\Android\android-ndk-r10e\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\include -isystem C:\Android\android-ndk-r10e\platforms\android-9\arch-arm\usr\include -IC:\Qt\QtAndroid\5.5\android_armv7\mkspecs\android-g++ -o mainwindow.obj ..\testAndroid\mainwindow.cpp
    C:\Qt\QtAndroid\5.5\android_armv7\bin\moc.exe -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -IC:/Qt/QtAndroid/5.5/android_armv7/mkspecs/android-g++ -IE:/projects/testAndroid -IC:/Qt/QtAndroid/5.5/android_armv7/include -IC:/Qt/QtAndroid/5.5/android_armv7/include/QtWidgets -IC:/Qt/QtAndroid/5.5/android_armv7/include/QtGui -IC:/Qt/QtAndroid/5.5/android_armv7/include/QtCore -I. -IC:\Android\android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include -IC:\Android\android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -IC:\Android\android-ndk-r10e/platforms/android-9/arch-arm//usr/include ..\testAndroid\mainwindow.h -o moc_mainwindow.cpp
    C:\Android\android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove -std=c++11 -g -g -marm -O0 -fno-omit-frame-pointer -Wall -Wno-psabi -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\testAndroid -I. -IC:\Qt\QtAndroid\5.5\android_armv7\include -IC:\Qt\QtAndroid\5.5\android_armv7\include\QtWidgets -IC:\Qt\QtAndroid\5.5\android_armv7\include\QtGui -IC:\Qt\QtAndroid\5.5\android_armv7\include\QtCore -I. -I. -isystem C:\Android\android-ndk-r10e\sources\cxx-stl\gnu-libstdc++\4.9\include -isystem C:\Android\android-ndk-r10e\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\include -isystem C:\Android\android-ndk-r10e\platforms\android-9\arch-arm\usr\include -IC:\Qt\QtAndroid\5.5\android_armv7\mkspecs\android-g++ -o moc_mainwindow.obj moc_mainwindow.cpp
    C:\Android\android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin/arm-linux-androideabi-g++ --sysroot=C:\Android\android-ndk-r10e/platforms/android-9/arch-arm/ -Wl,-soname,libtestAndroid.so -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libtestAndroid.so main.obj mainwindow.obj moc_mainwindow.obj   -LC:\Android\android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -LC:\Android\android-ndk-r10e/platforms/android-9/arch-arm//usr/lib -LC:/Qt/QtAndroid/5.5/android_armv7/lib -lQt5Widgets -Lc:\utils\android\ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a -Lc:\utils\android\ndk/platforms/android-9/arch-arm//usr/lib -lQt5Gui -lQt5Core -lGLESv2 -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc
    11:31:07: Процесс «C:\Qt\QtAndroid\Tools\mingw492_32\bin\mingw32-make.exe» завершился успешно.
    11:31:07: Удаление каталога E:\projects\build\android-build
    11:31:07: Запускается: «C:\Qt\QtAndroid\Tools\mingw492_32\bin\mingw32-make.exe» "INSTALL_ROOT=E:\projects\build\android-build" install
    copy /y libtestAndroid.so E:\projects\build\android-build\libs\armeabi-v7a\libtestAndroid.so
    ‘Є®ЇЁа®ў ­® д ©«®ў:         1.
    11:31:09: Процесс «C:\Qt\QtAndroid\Tools\mingw492_32\bin\mingw32-make.exe» завершился успешно.
    11:31:09: Запускается: «C:\Qt\QtAndroid\5.5\android_armv7\bin\androiddeployqt.exe» --input E:/projects/build/android-libtestAndroid.so-deployment-settings.json --output E:/projects/build/android-build --deployment bundled --android-platform android-23 --jdk "C:/Program Files/Java/jdk1.7.0_79" --ant C:/Android/apache-ant-1.9.6/bin/ant.bat
    Generating Android Package
      Input file: E:/projects/build/android-libtestAndroid.so-deployment-settings.json
      Output directory: E:/projects/build/android-build/
      Application binary: E:/projects/build/libtestAndroid.so
      Android build platform: android-23
      Install to device: No
    Buildfile: E:\projects\build\android-build\build.xml
    
    -set-mode-check:
    
    -set-debug-files:
    
    -check-env:
     [checkenv] Android SDK Tools Revision 25.1.7
     [checkenv] Installed at C:\Android\android-sdk-windows
    
    -setup:
         [echo] Project Name: QtApp
      [gettype] Project Type: Application
    
    -set-debug-mode:
    
    -debug-obfuscation-check:
    
    -pre-build:
    
    -build-setup:
    [getbuildtools] Using latest Build Tools: 24.0.2
         [echo] Resolving Build Target for QtApp...
    [gettarget] Project Target:   Android 6.0
    [gettarget] API level:        23
         [echo] ----------
         [echo] Creating output directories if needed...
        [mkdir] Created dir: E:\projects\build\android-build\bin
        [mkdir] Created dir: E:\projects\build\android-build\bin\res
        [mkdir] Created dir: E:\projects\build\android-build\bin\rsObj
        [mkdir] Created dir: E:\projects\build\android-build\bin\rsLibs
        [mkdir] Created dir: E:\projects\build\android-build\gen
        [mkdir] Created dir: E:\projects\build\android-build\bin\classes
        [mkdir] Created dir: E:\projects\build\android-build\bin\dexedLibs
         [echo] ----------
         [echo] Resolving Dependencies for QtApp...
    [dependency] Library dependencies:
    [dependency] No Libraries
    [dependency] 
    [dependency] ------------------
         [echo] ----------
         [echo] Building Libraries with 'debug'...
       [subant] No sub-builds to iterate on
    
    -code-gen:
    [mergemanifest] Merging AndroidManifest files into one.
    [mergemanifest] Manifest merger disabled. Using project manifest only.
         [echo] Handling aidl files...
         [aidl] Found 2 AIDL files.
         [aidl] Compiling 2 AIDL files.
         [echo] ----------
         [echo] Handling RenderScript files...
         [echo] ----------
         [echo] Handling Resources...
         [aapt] Generating resource IDs...
         [echo] ----------
         [echo] Handling BuildConfig class...
    [buildconfig] Generating BuildConfig class.
    
    -pre-compile:
    
    -compile:
        [javac] Compiling 6 source files to E:\projects\build\android-build\bin\classes
        [javac] Note: E:\projects\build\android-build\src\org\qtproject\qt5\android\bindings\QtActivity.java uses or overrides a deprecated API.
        [javac] Note: Recompile with -Xlint:deprecation for details.
    
    -post-compile:
    
    -obfuscate:
    
    -dex:
          [dex] input: E:\projects\build\android-build\bin\classes
          [dex] input: E:\projects\build\android-build\libs\QtAndroid-bundled.jar
          [dex] input: E:\projects\build\android-build\libs\QtAndroidAccessibility-bundled.jar
          [dex] Pre-Dexing E:\projects\build\android-build\libs\QtAndroid-bundled.jar -> QtAndroid-bundled-0711a8db2b6ce77162a39db588eebc4b.jar
           [dx] java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
           [dx] 	at java.lang.ClassLoader.defineClass1(Native Method)
           [dx] 	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
           [dx] 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
           [dx] 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
           [dx] 	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
           [dx] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    
    BUILD FAILED
    C:\Android\android-sdk-windows\tools\ant\build.xml:888: The following error occurred while executing this line:
    C:\Android\android-sdk-windows\tools\ant\build.xml:890: The following error occurred while executing this line:
    C:\Android\android-sdk-windows\tools\ant\build.xml:902: The following error occurred while executing this line:
    C:\Android\android-sdk-windows\tools\ant\build.xml:283: null returned: 1
    
           [dx] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
           [dx] 	at java.security.AccessController.doPrivileged(Native Method)
           [dx] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
           [dx] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
           [dx] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
           [dx] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
           [dx] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
           [dx] 	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
           [dx] Exception in thread "main" 
    Total time: 2 seconds
    Building the android package failed!
      -- For more information, run this command with --verbose.
    11:31:14: Процесс «C:\Qt\QtAndroid\5.5\android_armv7\bin\androiddeployqt.exe» завершился с кодом 14.
    Ошибка при сборке/установке проекта testAndroid (комплект: Android для armeabi-v7a (GCC 4.9, Qt 5.5.1) )
    Во время выполнения этапа «Сборка Android APK»
    11:31:14: Прошло времени: 00:17.
    

    Кто что знает про ошибку номер 14?
    Спасибо.



  • Так... решил проблему самостоятельно. Проблема в том что JDK7 не переваривает эти скрипты, ну или наоборот. Надо ставить JDK8.


Log in to reply