android - Android 版 Qt : QtCreator build/deploy error when executing step "Build Android APK"

标签 android c++ qt qt-creator fedora

浏览了一些网页后,我仍然无法弄清楚为什么在 Qt Creator 中为 Android 构建一个简单的基本 Qt 项目时出现以下错误:

10:01:29: Starting: "/usr/bin/make" 
/home/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/android-ndk-r10e/platforms/android-9/arch-arm/ -Wl,-soname,libtestAndroid.so -Wl,-rpath=/home/Qt5.5.1-for-android/5.5/android_armv5/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libtestAndroid.so main.o mainwindow.o moc_mainwindow.o   -L/home/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi -L/home/android-ndk-r10e/platforms/android-9/arch-arm//usr/lib -L/home/Qt5.5.1-for-android/5.5/android_armv5/lib -lQt5Widgets -L/opt/android/ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi -L/opt/android/ndk/platforms/android-9/arch-arm//usr/lib -lQt5Gui -lQt5Core -lGLESv2 -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc
10:01:29: The process "/usr/bin/make" exited normally.
10:01:29: Removing directory /home/qt-android-projects/testandroid/build/android-build
10:01:29: Starting: "/usr/bin/make" INSTALL_ROOT=/home/qt-android-projects/testandroid/build/android-build install
/home/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/android-ndk-r10e/platforms/android-9/arch-arm/ -Wl,-soname,libtestAndroid.so -Wl,-rpath=/home/Qt5.5.1-for-android/5.5/android_armv5/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libtestAndroid.so main.o mainwindow.o moc_mainwindow.o   -L/home/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi -L/home/android-ndk-r10e/platforms/android-9/arch-arm//usr/lib -L/home/Qt5.5.1-for-android/5.5/android_armv5/lib -lQt5Widgets -L/opt/android/ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi -L/opt/android/ndk/platforms/android-9/arch-arm//usr/lib -lQt5Gui -lQt5Core -lGLESv2 -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc
install -m 755 -p libtestAndroid.so /home/qt-android-projects/testandroid/build/android-build/libs/armeabi/libtestAndroid.so
Makefile:1707: recipe for target 'install_target' failed
install: cannot stat 'libtestAndroid.so': No such file or directory
[install_target] Error 1 (ignored)
11:41:30: The process "/usr/bin/make" exited normally.
11:41:30: Removing directory /home/qt-android-projects/testandroid/build/android-build
11:41:30: Starting: "/usr/bin/make" INSTALL_ROOT=/home/qt-android-projects/testandroid/build/android-build install
/home/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/android-ndk-r10e/platforms/android-9/arch-arm/ -Wl,-soname,libtestAndroid.so -Wl,-rpath=/home/Qt5.5.1-for-android/5.5/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libtestAndroid.so main.o mainwindow.o moc_mainwindow.o   -L/home/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -L/home/android-ndk-r10e/platforms/android-9/arch-arm//usr/lib -L/home/Qt5.5.1-for-android/5.5/android_armv7/lib -lQt5Widgets -L/opt/android/ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a -L/opt/android/ndk/platforms/android-9/arch-arm//usr/lib -lQt5Gui -lQt5Core -lGLESv2 -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc
install -m 755 -p libtestAndroid.so /home/qt-android-projects/testandroid/build/android-build/libs/armeabi-v7a/libtestAndroid.so
Makefile:1707: recipe for target 'install_target' failed
install: cannot stat 'libtestAndroid.so': No such file or directory
make: [install_target] Error 1 (ignored)
11:41:30: The process "/usr/bin/make" exited normally.
11:41:30: Starting: "/home/Qt5.5.1-for-android/5.5/android_armv7/bin/androiddeployqt" --input /home/qt-android-projects/testandroid/build/android-libtestAndroid.so-deployment-settings.json --output /home/qt-android-projects/testandroid/build/android-build --deployment bundled --android-platform android-23 --jdk /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-14.b27.fc21.x86_64 --ant /usr/bin/ant
Cannot find application binary /home/qt-android-projects/testandroid/build/libtestAndroid.so.
11:41:30: The process "/home/Qt5.5.1-for-android/5.5/android_armv7/bin/androiddeployqt" exited with code 2.
Error while building/deploying project testAndroid (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.5.1))
When executing step "Build Android APK"
11:41:30: Elapsed time: 00:04.

我的路径中没有空格。

如某些相关帖子所述,当我跳过 make install 步骤时,没有比这更好的了。它只是不显示以下几行:

Makefile:1707: recipe for target 'install_target' failed
install: cannot stat 'libtestAndroid.so': No such file or directory

系统配置:

在 Linux Fedora 下,为 the Qt's guide状态,我得到了:

  • Android SDK 工具 (r24.4.1)
  • Android NDK (r10e-rc4)
  • Apache ant(/usr/bin/中的 1.9 版)
  • Java SE 开发套件 (java-1.8.0-openjdk-1.8.0.60-14.b27.fc21.x86_64)
  • Android 版 Qt5(5.5.1 版)

我已经使用 ./android update sdk 命令安装了 Android API 23 SDK 工具:

enter image description here

路径(jdk、sdk、ndk、ant)似乎在 QtCreator > Tools > Options > Android 中正确设置。

谢谢

最佳答案

我刚刚重新安装了 NDK,它现在工作正常...

有时候很奇怪...

关于android - Android 版 Qt : QtCreator build/deploy error when executing step "Build Android APK",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33299647/

相关文章:

android - onLongClick() 只有在条件为真时才有效

c++ - 现代 C++ : what is the best approach for function returning a status (ok/not ok) and an error (if status not ok)?

c++ - 我可以在 deleteLater 之后再次使用 QTcpSocket 进行另一个连接吗?

android - 与 Web 服务集成的 Android 应用程序开发的最佳实践是什么?

Java 字符串数组

c++ - 为什么在VC中, 'delete'和 'delete []'都使用标量删除析构函数?

c++ - 使用算法头查找自定义数据类型的 minmax

.net - Windows 上的qyoto

android - 如何从扩展 fragment android编程的ImageButton切换到下一页(调用另一个类)

c++ - Qt 拖放 : cannot move when copy is enabled (Ubuntu Gnome)