android - QtCreator 甚至无法构建空项目 - 执行此行时发生以下错误

标签 android c++ qt ant qt-creator

我刚刚使用 tutorial on Qt website 安装的 Qt creator 出现了一些非常无用的错误.

-dex:
      [dex] input: D:\techsys\build-androidtest-Android_for_armeabi_v7a_GCC_4_9_Qt_5_5_1-Debug\android-build\bin\classes
      [dex] input: D:\techsys\build-androidtest-Android_for_armeabi_v7a_GCC_4_9_Qt_5_5_1-Debug\android-build\libs\QtAndroid-bundled.jar
      [dex] input: D:\techsys\build-androidtest-Android_for_armeabi_v7a_GCC_4_9_Qt_5_5_1-Debug\android-build\libs\QtAndroidAccessibility-bundled.jar
      [dex] Pre-Dexing D:\techsys\build-androidtest-Android_for_armeabi_v7a_GCC_4_9_Qt_5_5_1-Debug\android-build\libs\QtAndroid-bundled.jar -> QtAndroid-bundled-15710ac48ee3b8e0790e2c0724eced85.jar
       [dx] Error occurred during initialization of VM
       [dx] Could not reserve enough space for object heap
       [dx] Error: Could not create the Java Virtual Machine.
       [dx] Error: A fatal exception has occurred. Program will exit.

BUILD FAILED
C:\Users\mareda\AppData\Local\Android\android-sdk\tools\ant\build.xml:888: The following error occurred while executing this line:
C:\Users\mareda\AppData\Local\Android\android-sdk\tools\ant\build.xml:890: The following error occurred while executing this line:
C:\Users\mareda\AppData\Local\Android\android-sdk\tools\ant\build.xml:902: The following error occurred while executing this line:
C:\Users\mareda\AppData\Local\Android\android-sdk\tools\ant\build.xml:283: null returned: 1

Total time: 1 second
Building the android package failed!
  -- For more information, run this command with --verbose.
11:50:50: The process "C:\Qt\android.5.5.1\5.5\android_armv7\bin\androiddeployqt.exe" exited with code 14.
Error while building/deploying project androidtest (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.5.1))
When executing step "Build Android APK"
11:50:50: Elapsed time: 00:05.

我不太明白这是什么意思。这是我的配置:

image description

我还尝试选择使用 Gradle 而不是 Ant。它没有影响任何东西。最让我吃惊的是尴尬的错误:执行此行时发生以下错误: 没有提及任何实际错误。

最佳答案

修复方法如下:

Go to Start->Control Panel->System->Advanced(tab)->Environment Variables->System Variables->New:
Variable name: _JAVA_OPTIONS
Variable value: -Xmx512M



Variable name: Path
Variable value: ;C:\Program Files\Java\jre6\bin;F:\JDK\bin;
Change this to your appropriate path.

关于android - QtCreator 甚至无法构建空项目 - 执行此行时发生以下错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33607670/

相关文章:

c# - 解析 XAML : "Integer types not allowed" errors for many attributes such as width 时出错

java - 无法在android数据绑定(bind)中制作点击事件

c++ - Qt 信号和槽线程安全

qt - 将 QStackedWidget 调整为打开的页面

visual-studio - 如何将 Visual C++ 项目导入 Qt Creator?

android - 以编程方式在 Google Play 商店上为应用程序启用自动更新

java - 使用 GSON 解析 JSON 内部字段

c++ - B+树实现,** vs *

c++ - 标量初始值设定项代码中的多余元素使用 gcc 而非 g++ 进行编译

C++类Classname的使用;