简体   繁体   English

QT 5.2 Beta 部署 QTQuick 到 Android 失败:json 文件无效

[英]QT 5.2 Beta Deploy QTQuick to Android failed: Invalid json file

I am trying to deploy one of the QT Examples (ie calqlatr or samegame) to my Android Phone (4.0.4).我正在尝试将 QT 示例之一(即 calqlatr 或 samegame)部署到我的 Android 手机 (4.0.4)。 I am using Windows 7 32Bit and QtCreator 3.0.0Beta.我使用的是 Windows 7 32Bit 和 QtCreator 3.0.0Beta。 I successfully added the device and the kits to deploy it to QtCreator.我成功添加了设备和套件以将其部署到 QtCreator。

The build of the example succeeds as well but during the deployment I get the following error:示例的构建也成功了,但在部署期间我收到以下错误:

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'

I checked the named json file and it looks ok for me:我检查了命名的 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"
}

As there is no further error description I don't have a clue where to go next.由于没有进一步的错误描述,我不知道下一步该去哪里。 I also have a slight uncertainty in the Android NDK, I downloaded and used: android-ndk-r9b-windows-x86.zip is that correct or do I need android-ndk-r9b-windows-x86-legacy-toolchains.zip ?我在 Android NDK 中也有一些不确定性,我下载并使用了: android-ndk-r9b-windows-x86.zip 是正确的还是我需要 android-ndk-r9b-windows-x86-legacy-toolchains.zip ?

Thank your for any suggestions.感谢您的任何建议。

Ok, I'll answer the question myself.好的,我会自己回答这个问题。 Sorry for that.对不起。

After some even more research I realized that the Problem was due to lengthy paths.经过更多的研究,我意识到问题是由于冗长的路径造成的。

The default build path from QTCreator made Windows to fail during some command-line calls. QTCreator 的默认构建路径使 Windows 在某些命令行调用期间失败。 I changed the build-paths to short directory names and everything succeeded.我将构建路径更改为短目录名称,一切都成功了。

Best regards.此致。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM