android - QT 5.2 Beta 将 QTQuick 部署到 Android 失败 : Invalid json file

标签 android c++ qt

我正在尝试将 QT 示例之一(即 calqlatr 或 Samegame)部署到我的 Android 手机 (4.0.4)。我使用的是 Windows 7 32 位和 QtCreator 3.0.0Beta。 我成功添加了设备和套件以将其部署到 QtCreator。

示例的构建也成功,但在部署过程中出现以下错误:

Invalid json file: C:/Qt/Qt5.2.0/5.2.0-beta1/mingw48_32/examples/quick/demos/build-samegame-Android_für_armeabi_GCC_4_8_Qt_5_2_0-Debug/android-libsamegame.so-deployment-settings.json
08:18:32: Der Prozess "C:\Qt\Qt5.2.0\5.2.0-beta1\android_armv5\bin\androiddeployqt.exe" wurde mit dem Rückgabewert 2 beendet.
Fehler beim Erstellen/Deployment des Projekts samegame(Kit: Android für armeabi (GCC 4.8, Qt 5.2.0))
Bei der Ausführung von Schritt 'Deploy to Android device'

我检查了命名的 json 文件,它看起来对我来说没问题:

{
 "description": "This file is generated by qmake to be read by androiddeployqt and should not be modified by hand.",
 "qt": "C:\\Qt\\Qt5.2.0\\5.2.0-beta1\\android_armv5",
 "sdk": "C:/adt-bundle-windows-x86/sdk",
 "ndk": "C:\\Users\\mcc-lan\\android-ndk-r9b",
 "toolchain-prefix": "arm-linux-androideabi",
 "tool-prefix": "arm-linux-androideabi",
 "toolchain-version": "4.8",
 "ndk-host": "windows",
 "target-architecture": "armeabi",
 "application-binary": "C:/Qt/Qt5.2.0/5.2.0-beta1/mingw48_32/examples/quick/demos/build-samegame-Android_für_armeabi_GCC_4_8_Qt_5_2_0-Debug/libsamegame.so"
}

由于没有进一步的错误描述,我不知道下一步该去哪里。 我对 Android NDK 也有一点不确定性,我下载并使用了: android-ndk-r9b-windows-x86.zip 是正确的还是我需要 android-ndk-r9b-windows-x86-legacy-toolchains.zip ?

感谢您的任何建议。

最佳答案

好的, 我自己来回答这个问题。对此感到抱歉。

经过更多研究后,我意识到问题是由于路径过长造成的。

QTCreator 的默认构建路径导致 Windows 在某些命令行调用期间失败。 我将构建路径更改为短目录名称,一切都成功了。

致以诚挚的问候。

关于android - QT 5.2 Beta 将 QTQuick 部署到 Android 失败 : Invalid json file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19972064/

相关文章:

android - 将 urbanairship 添加到 config.xml 后,PhoneGap Android 应用程序崩溃

android - 将 FragmentPagerAdapter 设置为 ViewPager 以编程方式添加 fragment

c++ - TBB Concurrent Vector 和 STL Vector 的区别?

qt - 过滤 QFilesystemModel

c++ - QAbstractItemModel 中的嵌套操作

java - Android的SettingsActivity中如何让修改密码提示确认?

android - 模块依赖于一个或多个 Android 库,但在使用 VS 2017 构建 Cordova 应用程序时出现 Jar 错误

c++ - 如何将 Lense Undistortion 从 Lens Distortion Model 转换为 opencv?

c++ - 这是重命名和重新包含 std::unique_ptr 的好习惯吗?

c++ - 如何在 Qt 中自定义加载屏幕?