Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt android demo出错 #760

Closed
KellyGodLv opened this issue Apr 11, 2020 · 29 comments
Closed

qt android demo出错 #760

KellyGodLv opened this issue Apr 11, 2020 · 29 comments
Milestone

Comments

@KellyGodLv
Copy link

xmake -v
configure
{
sh = E:\android-ndk-r21\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++
ndk = E:/android-ndk-r21
ndk_stdcxx = true
host = windows
sdk = C:/Users/76441/AppData/Local/Android/Sdk
buildir = build
ndk_toolchains_ver = 4.9
cross = arm-linux-androideabi-
ndk_sdkver = 21
arch = armeabi-v7a
build_toolver = 29.0.3
ccache = true
gcc_toolchain = E:\android-ndk-r21\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64
mode = release
qt_sdkver = 5.12.7
cxx = E:\android-ndk-r21\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++
bin = E:\android-ndk-r21\toolchains\llvm\prebuilt\windows-x86_64\bin
ld = E:\android-ndk-r21\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++
kind = static
ndkver = 21
android_sdk = C:/Users/76441/AppData/Local/Android/Sdk
plat = android
qt = E:\Qt\Qt5.12.7\5.12.7\android_armv7
}
error: ...mdir\core\sandbox\modules\import\core\base\scheduler.lua:47: attempt to index field 'progress' (a number value)
stack traceback:
[C]: in function 'error'
@programdir\core\base\os.lua:787: in function 'raise'
...mdir\core\sandbox\modules\import\core\base\scheduler.lua:47: in function 'co_start_named'
@programdir\modules\private\async\runjobs.lua:185: in function <@programdir\modules\private\async\runjobs.lua:144>
[C]: in function 'trycall'
@programdir\core\base\scheduler.lua:423: in function 'co_group_begin'
...mdir\core\sandbox\modules\import\core\base\scheduler.lua:85: in function 'co_group_begin'
@programdir\modules\private\async\runjobs.lua:144: in function 'runjobs'
@programdir\actions\build\build.lua:221: in function 'build'
@programdir\actions\build\main.lua:116: in function <@programdir\actions\build\main.lua:111>
[C]: in function 'trycall'
@programdir\core\sandbox\modules\try.lua:121: in function 'try'
@programdir\actions\build\main.lua:110: in function <@programdir\actions\build\main.lua:83>
[C]: in function 'load'
@programdir\core\base\task.lua:520: in function 'run'
@programdir\core\main.lua:259: in function 'cotask'
@programdir\core\base\scheduler.lua:317: in function <@programdir\core\base\scheduler.lua:315>

@KellyGodLv
Copy link
Author

PS C:\Users\76441\Desktop\demo\appdemo> xmake -D
error: @programdir\core\main.lua:261: @programdir\actions\build\main.lua:124: ...mdir\core\sandbox\modules\import\core\base\scheduler.lua:87: ...mdir\core\sandbox\modules\import\core\base\scheduler.lua:47: @programdir\modules\private\async\runjobs.lua:213: @programdir\rules\qt\deploy\android.lua:33: attempt to index field 'progress' (a number value)
stack traceback:
[@programdir\rules\qt\deploy\android.lua:33]: in function 'after_build'
[@programdir\actions\build\build.lua:120]: in function 'jobfunc'
[@programdir\modules\private\async\runjobs.lua:190]:
[C]: in function 'trycall'
[@programdir\core\sandbox\modules\try.lua:121]: in function 'try'
[@programdir\modules\private\async\runjobs.lua:187]: in function 'cotask'
[@programdir\core\base\scheduler.lua:317]:

stack traceback:
[C]: in function 'error'
@programdir\core\base\os.lua:787: in function 'raise'
@programdir\modules\private\async\runjobs.lua:213: in function 'catch'
@programdir\core\sandbox\modules\try.lua:127: in function 'try'
@programdir\modules\private\async\runjobs.lua:187: in function 'cotask'
@programdir\core\base\scheduler.lua:317: in function <@programdir\core\base\scheduler.lua:315>
stack traceback:
[C]: in function 'error'
@programdir\core\base\os.lua:787: in function 'raise'
...mdir\core\sandbox\modules\import\core\base\scheduler.lua:47: in function 'co_start_named'
@programdir\modules\private\async\runjobs.lua:185: in function <@programdir\modules\private\async\runjobs.lua:144>
[C]: in function 'trycall'
@programdir\core\base\scheduler.lua:423: in function 'co_group_begin'
...mdir\core\sandbox\modules\import\core\base\scheduler.lua:85: in function 'co_group_begin'
@programdir\modules\private\async\runjobs.lua:144: in function 'runjobs'
@programdir\actions\build\build.lua:221: in function 'build'
@programdir\actions\build\main.lua:116: in function <@programdir\actions\build\main.lua:111>
[C]: in function 'trycall'
@programdir\core\sandbox\modules\try.lua:121: in function 'try'
@programdir\actions\build\main.lua:110: in function <@programdir\actions\build\main.lua:83>
[C]: in function 'load'
@programdir\core\base\task.lua:520: in function 'run'
@programdir\core\main.lua:259: in function 'cotask'
@programdir\core\base\scheduler.lua:317: in function <@programdir\core\base\scheduler.lua:315>
stack traceback:
[C]: in function 'error'
@programdir\core\base\os.lua:787: in function 'raise'
@programdir\core\main.lua:261: in function 'cotask'
@programdir\core\base\scheduler.lua:317: in function <@programdir\core\base\scheduler.lua:315>

@waruqi
Copy link
Member

waruqi commented Apr 12, 2020

这个我记得dev上已经修复了才对,你是用的最新的么 更新到dev试试 xmake update dev

@KellyGodLv
Copy link
Author

我用Windows xmake二进制 update dev好像不能自动切换更新 我之前都是人工更新对应的lua文件 ,回头我更新下这个文件试试

@waruqi
Copy link
Member

waruqi commented Apr 12, 2020

update dev会从ci拉安装包更新安装 应该可以的才对,除非下载失败了 如果原本就是最近版本 core没动 可以尝试仅更新lua xmake update -s dev

@KellyGodLv
Copy link
Author

@KellyGodLv
Copy link
Author

KellyGodLv commented Apr 12, 2020

TIM截图20200412104610

@waruqi
Copy link
Member

waruqi commented Apr 12, 2020

是不是权限不够写入c盘失败了。。可以开个管理员终端更新下试试,不行你就自己 从ci上下载安装包装吧:https://ci.appveyor.com/api/buildjobs/4r0p1378iwekhl9a/artifacts/xmake-installer.exe

@KellyGodLv
Copy link
Author

android.lua 在写入 android-deployment-settings.json 需要将 \ 转换成 / 否则 在Windows运行时候 会提示找不到SDK

 "android-deployment-settings.json")
    local content=format([[
        {
           "description": "This file is generated by qmake to be read by androiddeployqt and should not be modified by hand.",
           "qt": "%s",
           "sdk": "%s",
           "ndk": "%s",
           "sdkBuildToolsRevision": "%s",
           "toolchain-prefix": "llvm",
           "tool-prefix": "llvm",
           "toolchain-version": "%s",
           "ndk-host": "%s",
           "target-architecture": "%s",
           "qml-root-path": "%s",
           "stdcpp-path": "%s",
           "useLLVM": true,
           "application-binary": "%s"
        }]], qt.sdkdir, android_sdkdir, ndk, android_build_toolver, ndk_toolchains_ver, ndk_host, target_arch, os.projectdir(), stdcpp_path, target:targetfile());
        content=string.gsub( content,"\\","/")
    
        io.writefile(android_deployment_settings,content )

@waruqi
Copy link
Member

waruqi commented Apr 13, 2020

你这样全局改,容易干扰其他非路径值,而且linux下\\也是有效路径字符,会有影响。

估计是在json里面,需要对''做转义才行,你先改成这样试试呢,如果ok我回头调整下:

    local function _escape_path(p)
        return os.args(p, {escape = true})
    end
    io.writefile(android_deployment_settings, format([[
    {
       "description": "This file is generated by qmake to be read by androiddeployqt and should not be modified by hand.",
       "qt": "%s",
       "sdk": "%s",
       "ndk": "%s",
       "sdkBuildToolsRevision": "%s",
       "toolchain-prefix": "llvm",
       "tool-prefix": "llvm",
       "toolchain-version": "%s",
       "ndk-host": "%s",
       "target-architecture": "%s",
       "qml-root-path": "%s",
       "stdcpp-path": "%s",
       "useLLVM": true,
       "application-binary": "%s"
    }]], _escape_path(qt.sdkdir), _escape_path(android_sdkdir), _escape_path(ndk), android_build_toolver, ndk_toolchains_ver, ndk_host, target_arch, _escape_path(os.projectdir()), _escape_path(stdcpp_path), _escape_path(target:targetfile())))

@waruqi waruqi added this to the v2.3.3 milestone Apr 13, 2020
@KellyGodLv
Copy link
Author

试了一下 可以了 ,不过这个编译过程还是有其他过程,有时候可以有时候不行

[100%]: generating.qt.app appdemo.apk
E:\Qt\Qt5.12.7\5.12.7\android_armv7\bin\androiddeployqt.exe --input build\.qt\app\android\appdemo\android-deployment-settings.json --output build\.qt\app\android\appdemo\android-build --android-platform android-28 --jdk "C:\\Program Files (x86)\\Java\\jdk1.8.0_71" --gradle --no-gdbserver
Generating Android Package
  Input file: build\.qt\app\android\appdemo\android-deployment-settings.json
  Output directory: C:/Users/76441/Desktop/demo/appdemo/build/.qt/app/android/appdemo/android-build/
  Application binary: build\android\armeabi-v7a\release\libappdemo.so
  Android build platform: android-28
  Install to device: No
  -- Skipping E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/iconengines/libqsvgicon.so. It has unmet dependencies: lib/libQt5Svg.so.
  -- Skipping E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqsvg.so. It has unmet dependencies: lib/libQt5Svg.so.
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'
E:/android-ndk-r21/toolchains/llvm/prebuilt/windows-x86_64/bin\llvm-strip.exe: 
error: unknown argument '-strip-all'

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android-build'.
> Cannot convert URL 'E:QtQt5.12.75.12.7android_armv7/src/android/java/res' to 
a file.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
Building the android package failed!
  -- For more information, run this command with --verbose.
error: execv(E:\Qt\Qt5.12.7\5.12.7\android_armv7\bin\androiddeployqt.exe --input build\.qt\app\android\appdemo\android-deployment-settings.json --output build\.qt\app\android\appdemo\android-build --android-platform android-28 --jdk "C:\\Program Files (x86)\\Java\\jdk1.8.0_71" --gradle --no-gdbserver) failed(14)  

可能跟androiddeployqt.exe传递的参数有关,我在QtCreator都是正常的,NDK与SDK版本应该没问题

@KellyGodLv
Copy link
Author

 {
       "description": "This file is generated by qmake to be read by androiddeployqt and should not be modified by hand.",
       "qt": "E:\\Qt\\Qt5.12.7\\5.12.7\\android_armv7",
       "sdk": "C:\\Users\\76441\\AppData\\Local\\Android\\Sdk",
       "ndk": "E:/android-ndk-r21",
       "sdkBuildToolsRevision": "29.0.3",
       "toolchain-prefix": "llvm",
       "tool-prefix": "llvm",
       "toolchain-version": "4.9",
       "ndk-host": "windows-x86_64",
       "target-architecture": "armeabi-v7a",
       "qml-root-path": "C:\\Users\\76441\\Desktop\\demo\\appdemo",
       "stdcpp-path": "E:\\android-ndk-r21\\sources\\cxx-stl\\llvm-libc++\\libs\\armeabi-v7a\\libc++_shared.so",
       "useLLVM": true,
       "application-binary": "build\\android\\armeabi-v7a\\release\\libappdemo.so"
    }

@waruqi
Copy link
Member

waruqi commented Apr 13, 2020

试了一下 可以了 ,不过这个编译过程还是有其他过程,有时候可以有时候不行

_escape_path这个patch我merge进去了,dev上

可能跟androiddeployqt.exe传递的参数有关,我在QtCreator都是正常的,NDK与SDK版本应该没问题

这个你自己捣鼓下吧,当初搞完mac上部署,win上一直没有环境测试(之前也有人反馈过 #404 #571 )。

你可以自己对比下qt生层的json和xmake生成的差异,然后调整下 https://github.com/xmake-io/xmake/blob/master/xmake/rules/qt/deploy/android.lua

@KellyGodLv
Copy link
Author

好的

@KellyGodLv
Copy link
Author

目前测试下来基本可以用,NDK版本需要选择Android studio SDK目录中的 ndk-build,不然有时候编译不过去,原因未知, 2使用xmake -v基本编译成功 比使用xmake 经常编译失败,原因未知
基本都是这几个错误

error: 
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformNativeLibsWithStripDebugSymbolForDebug'.
> A problem occurred starting process 'command 'C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-strip''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Building the android package failed!
  -- For more information, run this command with --verbose.
uild UP-TO-DATE
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:checkDebugManifest UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:prepareLintJar UP-TO-DATE
:mainApkListPersistenceDebug UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:createDebugCompatibleScreenManifests UP-TO-DATE
:processDebugManifest UP-TO-DATE
:splitsDiscoveryTaskDebug UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:javaPreCompileDebug UP-TO-DATE
:compileDebugJavaWithJavac UP-TO-DATE
:compileDebugSources UP-TO-DATE
:mergeDebugShaders UP-TO-DATE
:compileDebugShaders UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:transformClassesWithDexBuilderForDebug UP-TO-DATE
:transformDexArchiveWithExternalLibsDexMergerForDebug UP-TO-DATE
:transformDexArchiveWithDexMergerForDebug UP-TO-DATE
:mergeDebugJniLibFolders
:transformNativeLibsWithMergeJniLibsForDebug
:transformNativeLibsWithStripDebugSymbolForDebug FAILED
25 actionable tasks: 3 executed, 22 up-to-date

或者

[100%]: generating.qt.app appdemo.apk
error: 
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugAidl'.
> org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Users\76441\AppData\Local\Android\Sdk\build-tools\28.0.3\aidl.exe''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Building the android package failed!
  -- For more information, run this command with --verbose.
checkDebugClasspath
:preBuild UP-TO-DATE
:preDebugBuild
:compileDebugAidl FAILED
3 actionable tasks: 3 executed

xmake install 在安装apk文件时,如果PC有模拟器,或者adb检测到不止一个设备时,自动安装将会失败,是否考虑 安装完成后直接启动Apk?

@waruqi
Copy link
Member

waruqi commented Apr 14, 2020

2使用xmake -v基本编译成功 比使用xmake 经常编译失败,原因未知

xmake -j1 强制单任务执行试试

是否考虑 安装完成后直接启动Apk?

可以在自定义xmake run里面搞,你可以先在你自己的target/on_run里面弄下。。

@KellyGodLv
Copy link
Author

分别使用了 xmake -j1 xmake xmake -v 只有最后一个是成功的,

PS C:\Users\76441\Desktop\demo\appdemo> xmake -j1
[ 37%]: compiling.qt.moc src\mainwindow.h
[ 50%]: compiling.qt.moc src\mainwindow.cpp
[ 62%]: compiling.release src\mainwindow.cpp
[ 87%]: linking.release libappdemo.so
[100%]: generating.qt.app appdemo.apk
error: 
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugAidl'.
> org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Users\76441\AppData\Local\Android\Sdk\build-tools\28.0.3\aidl.exe''

* Try:
t. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Building the android package failed!
  -- For more information, run this command with --verbose.
checkDebugClasspath UP-TO-DATE
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:compileDebugAidl FAILED
3 actionable tasks: 1 executed, 2 up-to-date

PS C:\Users\76441\Desktop\demo\appdemo> xmake
[ 37%]: compiling.qt.moc src\mainwindow.h
[ 50%]: compiling.qt.moc src\mainwindow.cpp
[ 62%]: compiling.release src\mainwindow.cpp
[ 87%]: linking.release libappdemo.so
[100%]: generating.qt.app appdemo.apk
error: 
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugAidl'.
> org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Users\76441\AppData\Local\Android\Sdk\build-tools\28.0.3\aidl.exe''

* Try:
t. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Building the android package failed!
  -- For more information, run this command with --verbose.
checkDebugClasspath UP-TO-DATE
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:compileDebugAidl FAILED
3 actionable tasks: 1 executed, 2 up-to-date

PS C:\Users\76441\Desktop\demo\appdemo> xmake -v
configure
{
    ld = C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++
    ndk = C:\\Users\\76441\\AppData\\Local\\Android\\Sdk\\ndk-bundle
    ndk_stdcxx = true
    host = windows
    sdk = C:/Users/76441/AppData/Local/Android/Sdk
    plat = android
    buildir = build
    ndk_toolchains_ver = 4.9
    cross = arm-linux-androideabi-
    ndk_sdkver = 28
    arch = armeabi-v7a
    ccache = true
    build_toolver = 29.0.3
    mode = release
    qt_sdkver = 5.12.7
    cxx = C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++
    bin = C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin   
    sh = C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++
    kind = static
    ndkver = 18
    android_sdk = C:/Users/76441/AppData/Local/Android/Sdk
    gcc_toolchain = C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64
    qt = E:\Qt\Qt5.12.7\5.12.7\android_armv7
}
[ 37%]: compiling.qt.moc src\mainwindow.h
E:\Qt\Qt5.12.7\5.12.7\android_armv7\bin\moc.exe -DQT_NO_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include\QtGui -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include\QtWidgets -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include\QtCore -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\mkspecs\android-clang -IC:\Users\76441\Desktop\demo\appdemo\build\.gens\appdemo\android\armeabi-v7a\release\rules\qt\ui src\mainwindow.h -o build\.gens\appdemo\android\armeabi-v7a\release\rules\qt\moc\moc_mainwindow.cpp
[ 50%]: compiling.qt.moc src\mainwindow.cpp
E:\Qt\Qt5.12.7\5.12.7\android_armv7\bin\moc.exe -DQT_NO_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include\QtGui -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include\QtWidgets -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include\QtCore -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\mkspecs\android-clang -IC:\Users\76441\Desktop\demo\appdemo\build\.gens\appdemo\android\armeabi-v7a\release\rules\qt\ui src\mainwindow.cpp -o build\.gens\appdemo\android\armeabi-v7a\release\rules\qt\moc\mainwindow.moc
[ 62%]: compiling.release src\mainwindow.cpp
C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ -c -Oz -std=c++11 -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include\QtGui -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include\QtWidgets -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include\QtCore -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\include -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\mkspecs\android-clang -IC:\Users\76441\Desktop\demo\appdemo\build\.gens\appdemo\android\armeabi-v7a\release\rules\qt\ui -Ibuild\.gens\appdemo\android\armeabi-v7a\release\rules\qt\moc -DQT_NO_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB --sysroot=C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\sysroot -isystem C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\sysroot\usr\include\arm-linux-androideabi -IC:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\sources\cxx-stl\llvm-libc++/include -IC:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\sources\cxx-stl\llvm-libc++/libs/armeabi-v7a/include -IC:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\sources\cxx-stl\llvm-libc++abi\include -Qunused-arguments -mthumb -target armv7-none-linux-androideabi -gcc-toolchain C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64 -D__ANDROID_API__=28 -fPIC -o build\.objs\appdemo\android\armeabi-v7a\release\src\mainwindow.cpp.o src\mainwindow.cpp
[ 87%]: linking.release libappdemo.so
C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ -o build\android\armeabi-v7a\release\libappdemo.so build\.objs\appdemo\android\armeabi-v7a\release\src\mainwindow.cpp.o build\.objs\appdemo\android\armeabi-v7a\release\src\main.cpp.o -LE:\Qt\Qt5.12.7\5.12.7\android_armv7\lib -Wl,-rpath=E:\Qt\Qt5.12.7\5.12.7\android_armv7\lib -s -lQt5Gui -lQt5Widgets -lQt5Core -shared -fPIC -llog -mthumb -target armv7-none-linux-androideabi -gcc-toolchain C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64 --sysroot=C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\platforms\android-28/arch-arm -LC:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\sources\cxx-stl\llvm-libc++/libs/armeabi-v7a -lc++_static -lc++abi -lunwind -latomic
[100%]: generating.qt.app appdemo.apk
E:\Qt\Qt5.12.7\5.12.7\android_armv7\bin\androiddeployqt.exe --input build\.qt\app\android\appdemo\android-deployment-settings.json --output build\.qt\app\android\appdemo\android-build --android-platform android-28 --jdk "C:\\Program Files (x86)\\Java\\jdk1.8.0_71" --gradle --no-gdbserver
Generating Android Package
  Input file: build\.qt\app\android\appdemo\android-deployment-settings.json
  Output directory: C:/Users/76441/Desktop/demo/appdemo/build/.qt/app/android/appdemo/android-build/
  Application binary: build/android/armeabi-v7a/release/libappdemo.so
  Android build platform: android-28
  Install to device: No
  -- Skipping E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/iconengines/libqsvgicon.so. It has unmet dependencies: lib/libQt5Svg.so.
  -- Skipping E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqsvg.so. It has unmet dependencies: lib/libQt5Svg.so.
:checkDebugClasspath UP-TO-DATE
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:compileDebugAidl
:compileDebugRenderscript
:checkDebugManifest
:generateDebugBuildConfig
:prepareLintJar
:mainApkListPersistenceDebug
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:createDebugCompatibleScreenManifests
:processDebugManifest
:splitsDiscoveryTaskDebug
:processDebugResources
:generateDebugSources
:javaPreCompileDebug
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
:compileDebugJavaWithJavac
:compileDebugNdk NO-SOURCE
:compileDebugSources
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:transformClassesWithDexBuilderForDebug
:transformDexArchiveWithExternalLibsDexMergerForDebug
:transformDexArchiveWithDexMergerForDebug
:mergeDebugJniLibFolders
:transformNativeLibsWithMergeJniLibsForDebug
:transformNativeLibsWithStripDebugSymbolForDebug
:checkDebugLibraries
:processDebugJavaRes NO-SOURCE
:transformResourcesWithMergeJavaResForDebug
:validateSigningDebug
:packageDebug
:assembleDebug

BUILD SUCCESSFUL in 14s
29 actionable tasks: 27 executed, 2 up-to-date
Android package built successfully in 16.071 ms.
  -- File: C:/Users/76441/Desktop/demo/appdemo/build/.qt/app/android/appdemo/android-build//build/outputs/apk/debug/android-build-debug.apk
the apk output path: build\android\armeabi-v7a\release\appdemo.apk
[100%]: build ok!

@waruqi
Copy link
Member

waruqi commented Apr 14, 2020

你可以跟下core/base/os.lua里面 os.runv 部分看看对比下,加-v和不加的唯一区别是,加-v用了os.execv 不加就用的 os.runv

而这两的区别就是os.runv内部做了重定向处理,可以看看是否这个重定向导致

function os.runv(program, argv, opt)
-- init options
opt = opt or {}
-- make temporary log file
local logfile = os.tmpfile()
-- execute it
local ok, errors = os.execv(program, argv, table.join(opt, {stdout = logfile, stderr = logfile}))

@KellyGodLv
Copy link
Author

改成 local ok, errors = os.execv(program, argv, opt)可以了
输出的日志

Generating Android Package
  Input file: build\.qt\app\android\appdemo\android-deployment-settings.json   
  Output directory: C:/Users/76441/Desktop/demo/appdemo/build/.qt/app/android/appdemo/android-build/
  Application binary: build/android/armeabi-v7a/release/libappdemo.so
  Android build platform: android-28
  Install to device: No
  -- Skipping E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/iconengines/libqsvgicon.so. It has unmet dependencies: lib/libQt5Svg.so.
  -- Skipping E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqsvg.so. It has unmet dependencies: lib/libQt5Svg.so.
:checkDebugClasspath
:preBuild UP-TO-DATE
:preDebugBuild
:compileDebugAidl
:compileDebugRenderscript
:checkDebugManifest
:generateDebugBuildConfig
:prepareLintJar
:mainApkListPersistenceDebug
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:createDebugCompatibleScreenManifests
:processDebugManifest
:splitsDiscoveryTaskDebug
:processDebugResources
:generateDebugSources
:javaPreCompileDebug
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
:compileDebugJavaWithJavac
:compileDebugNdk NO-SOURCE
:compileDebugSources
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:transformClassesWithDexBuilderForDebug
:transformDexArchiveWithExternalLibsDexMergerForDebug
:transformDexArchiveWithDexMergerForDebug
:mergeDebugJniLibFolders
:transformNativeLibsWithMergeJniLibsForDebug
:transformNativeLibsWithStripDebugSymbolForDebug
:checkDebugLibraries
:processDebugJavaRes NO-SOURCE
:transformResourcesWithMergeJavaResForDebug
:validateSigningDebug
:packageDebug
:assembleDebug

BUILD SUCCESSFUL in 18s

@waruqi
Copy link
Member

waruqi commented Apr 14, 2020

改成 local ok, errors = os.execv(program, argv, opt)可以了

xmake -v 原本就是走的这个,说明是可以的,关键是为啥os.runv不行,你得看下,os.runv 最终走的也是 os.execv。。

可以临时改下os.runv ,比如去掉重定向看看是否ok,比如ok返回值看看,还有里面的 argv参数可以 utils.dump(argv)对比下 看看

@KellyGodLv
Copy link
Author

TIM截图20200414170310
改成这样才可以用,如果没改 失败时OK的值为14 ,其他的我不会跟踪了,

@KellyGodLv
Copy link
Author

stdout stderr,有一个在都会编译失败

@KellyGodLv
Copy link
Author

我在execv中 打开进程的参数dump下来,就重定向差别 其他看起来都一样

xmake 
"E:\Qt\Qt5.12.7\5.12.7\android_armv7\bin\androiddeployqt.exe"
{ 
  "--input",
  "build\.qt\app\android\appdemo\android-deployment-settings.json",
  "--output",
  "build\.qt\app\android\appdemo\android-build",
  "--android-platform",
  "android-28",
  "--jdk",
  "C:\Program Files (x86)\Java\jdk1.8.0_71",
  "--gradle",
  "--no-gdbserver"
}
{
  stdout = "C:\Users\76441\AppData\Local\Temp\.xmake\200414\_D375DF53B1A543608E1F362AA9C7EFD0",
  stderr = "C:\Users\76441\AppData\Local\Temp\.xmake\200414\_D375DF53B1A543608E1F362AA9C7EFD0" 
}
xmake -v
"E:\Qt\Qt5.12.7\5.12.7\android_armv7\bin\androiddeployqt.exe"
{
  "--input",
  "build\.qt\app\android\appdemo\android-deployment-settings.json",
  "--output",
  "build\.qt\app\android\appdemo\android-build",
  "--android-platform",
  "android-28",
  "--jdk",
  "C:\Program Files (x86)\Java\jdk1.8.0_71",
  "--gradle",
  "--no-gdbserver"
}
{ }

@waruqi
Copy link
Member

waruqi commented Apr 14, 2020

那就是重定向了,androiddeployqt 执行就会出问题。。这个xmake也没办法哈。。你可以试下 手动拼下完整命令 在cmd下 重定向执行看看 是否也会失败。

@waruqi
Copy link
Member

waruqi commented Apr 14, 2020

-- For more information, run this command with --verbose.

可以在os.runv开启重定向,同时执行 androiddeployqt 的时候,追加 --verbose, 然后失败后看下更详细的输出,看看有没有什么线索,为啥会失败

@KellyGodLv
Copy link
Author

线索很多,看不懂

error: 
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugAidl'.
> org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Users\76441\AppData\Local\Android\Sdk\build-tools\28.0.3\aidl.exe''

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
Building the android package failed!
/Qt/Qt5.12.7/5.12.7/android_armv7/src/android/templates/res/values C:/Users/76441/Desktop/demo/appdemo/build/.qt/app/android/appdemo/android-build/res/values
Copying Android package template.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.jar. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.properties. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/src/3rdparty/gradle/gradlew. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/src/3rdparty/gradle/gradlew.bat. Same or newer file already in place.
  -- Copied C:/Users/76441/Desktop/demo/appdemo/build/.qt/app/android/appdemo/android-build/AndroidManifest.xml
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/src/android/templates/build.gradle. Same or newer file already in place.
  -- Copied C:/Users/76441/Desktop/demo/appdemo/build/.qt/app/android/appdemo/android-build/res/values/libs.xml
Detecting dependencies of application.
Reading dependencies from build/android/armeabi-v7a/release/libappdemo.so
      lib/libQt5Core.so
      lib/libQt5Gui.so
      lib/libQt5Widgets.so
Reading dependencies from E:/Qt/Qt5.12.7/5.12.7/android_armv7/lib/libQt5Core.so
Appending dependency: lib/libQt5Core.so
Reading dependencies from E:/Qt/Qt5.12.7/5.12.7/android_armv7/lib/libQt5Gui.so
      lib/libQt5Core.so
Appending dependency: lib/libQt5Gui.so
Reading dependencies from E:/Qt/Qt5.12.7/5.12.7/android_armv7/lib/libQt5Widgets.so
      lib/libQt5Core.so
      lib/libQt5Gui.so
Appending dependency: lib/libQt5Widgets.so
Reading Android dependencies for Qt5Core
Reading Android dependencies for Qt5Gui
Appending dependency from xml: plugins/platforms/android/libqtforandroid.so
Appending dependency from xml: plugins/iconengines/libqsvgicon.so
Appending dependency from xml: plugins/imageformats/libqgif.so
Appending dependency from xml: plugins/imageformats/libqicns.so
Appending dependency from xml: plugins/imageformats/libqico.so
Appending dependency from xml: plugins/imageformats/libqjpeg.so
Appending dependency from xml: plugins/imageformats/libqsvg.so
Appending dependency from xml: plugins/imageformats/libqtga.so
Appending dependency from xml: plugins/imageformats/libqtiff.so
Appending dependency from xml: plugins/imageformats/libqwbmp.so
Appending dependency from xml: plugins/imageformats/libqwebp.so
Reading Android dependencies for Qt5Widgets
Appending dependency from xml: plugins/styles/libqandroidstyle.so
Reading dependencies from E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/platforms/android/libqtforandroid.so
      lib/libQt5Core.so
      lib/libQt5Gui.so
Reading dependencies from E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/platforms/android/libqtforandroid.so
      lib/libQt5Core.so
      lib/libQt5Gui.so
Scanning for QML imports.
Copying STL library
  -- Skipping file C:/Users/76441/AppData/Local/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so. Same or newer file already in place.
Copying 16 dependencies from Qt into package.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/lib/libQt5Core.so. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/lib/libQt5Gui.so. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/lib/libQt5Widgets.so. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/jar/QtAndroid.jar. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/platforms/android/libqtforandroid.so. Same or newer file already in place.
  -- Skipping E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/iconengines/libqsvgicon.so. It has unmet dependencies: lib/libQt5Svg.so.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqgif.so. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqicns.so. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqico.so. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqjpeg.so. Same or newer file already in place.
  -- Skipping E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqsvg.so. It has unmet dependencies: lib/libQt5Svg.so.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqtga.so. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqtiff.so. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqwbmp.so. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/imageformats/libqwebp.so. Same or newer file already in place.
  -- Skipping file E:/Qt/Qt5.12.7/5.12.7/android_armv7/plugins/styles/libqandroidstyle.so. Same or newer file already in place.
Checking if application binary is in package.
Stripping libraries to minimize size.
Updating Android package files with project settings.
  -- res/values/libs.xml
  -- AndroidManifest.xml
Pregenerating entry list for assets file engine.
Initialized native services in: C:\Users\76441\.gradle\native
Using 8 worker leases.
Starting Build
Settings evaluated using settings file 'C:\Users\76441\Desktop\demo\appdemo\build\.qt\app\android\appdemo\android-build\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\76441\Desktop\demo\appdemo\build\.qt\app\android\appdemo\android-build\build.gradle'.
Included projects: [root project 'android-build']
Evaluating root project 'android-build' using build file 'C:\Users\76441\Desktop\demo\appdemo\build\.qt\app\android\appdemo\android-build\build.gradle'.
Creating configuration androidTestUtil
Creating configuration compile
Creating configuration apk
Creating configuration provided
Creating configuration api
Creating configuration implementation
Creating configuration runtimeOnly
Creating configuration compileOnly
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration androidTestCompile
Creating configuration androidTestApk
Creating configuration androidTestProvided
Creating configuration androidTestApi
Creating configuration androidTestImplementation
Creating configuration androidTestRuntimeOnly
Creating configuration androidTestCompileOnly
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration testCompile
Creating configuration testApk
Creating configuration testProvided
Creating configuration testApi
Creating configuration testImplementation
Creating configuration testRuntimeOnly
Creating configuration testCompileOnly
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration debugCompile
Creating configuration debugApk
Creating configuration debugProvided
Creating configuration debugApi
Creating configuration debugImplementation
Creating configuration debugRuntimeOnly
Creating configuration debugCompileOnly
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration androidTestDebugCompile
Creating configuration androidTestDebugApk
Creating configuration androidTestDebugProvided
Creating configuration androidTestDebugApi
Creating configuration androidTestDebugImplementation
Creating configuration androidTestDebugRuntimeOnly
Creating configuration androidTestDebugCompileOnly
Creating configuration androidTestDebugWearApp
Creating configuration androidTestDebugAnnotationProcessor
Creating configuration testDebugCompile
Creating configuration testDebugApk
Creating configuration testDebugProvided
Creating configuration testDebugApi
Creating configuration testDebugImplementation
Creating configuration testDebugRuntimeOnly
Creating configuration testDebugCompileOnly
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration releaseCompile
Creating configuration releaseApk
Creating configuration releaseProvided
Creating configuration releaseApi
Creating configuration releaseImplementation
Creating configuration releaseRuntimeOnly
Creating configuration releaseCompileOnly
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration testReleaseCompile
Creating configuration testReleaseApk
Creating configuration testReleaseProvided
Creating configuration testReleaseApi
Creating configuration testReleaseImplementation
Creating configuration testReleaseRuntimeOnly
Creating configuration testReleaseCompileOnly
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Parsing the SDK, no caching allowed
Parsing C:\Users\76441\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-21\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\build-tools\19.1.0\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\build-tools\21.1.2\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\build-tools\27.0.3\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\build-tools\28.0.2\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\build-tools\28.0.3\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\build-tools\29.0.3\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\cmake\3.6.4111459\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\emulator\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\extras\android\m2repository\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\extras\google\m2repository\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\extras\intel\Hardware_Accelerated_Execution_Manager\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\extras\m2repository\com\android\support\constraint\constraint-layout-solver\1.0.2\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\extras\m2repository\com\android\support\constraint\constraint-layout\1.0.2\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\ndk-bundle\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\ndk\19.2.5345600\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\patcher\v4\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\platform-tools\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\platforms\android-21\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\platforms\android-27\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\platforms\android-28\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\platforms\android-29\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\sources\android-21\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\sources\android-28\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\package.xml
Parsing C:\Users\76441\AppData\Local\Android\Sdk\tools\package.xml
SDK initialized in 1277 ms
Using incremental javac compilation for : debug.
Using incremental javac compilation for : debugUnitTest.
Using incremental javac compilation for : release.
Using incremental javac compilation for : releaseUnitTest.
Using incremental javac compilation for : debugAndroidTest.
All projects evaluated.
Selected primary task 'assembleDebug' from project :
Tasks to be executed: [task ':checkDebugClasspath', task ':preBuild', task ':preDebugBuild', task ':compileDebugAidl', task ':compileDebugRenderscript', task ':checkDebugManifest', task ':generateDebugBuildConfig', task ':prepareLintJar', task ':mainApkListPersistenceDebug', task ':generateDebugResValues', task ':generateDebugResources', task ':mergeDebugResources', task ':createDebugCompatibleScreenManifests', task ':processDebugManifest', task ':splitsDiscoveryTaskDebug', task ':processDebugResources', task ':generateDebugSources', task ':javaPreCompileDebug', task ':compileDebugJavaWithJavac', task ':compileDebugNdk', task ':compileDebugSources', task ':mergeDebugShaders', task ':compileDebugShaders', task ':generateDebugAssets', task ':mergeDebugAssets', task ':transformClassesWithDexBuilderForDebug', task ':transformDexArchiveWithExternalLibsDexMergerForDebug', task ':transformDexArchiveWithDexMergerForDebug', task ':mergeDebugJniLibFolders', task ':transformNativeLibsWithMergeJniLibsForDebug', task ':transformNativeLibsWithStripDebugSymbolForDebug', task ':checkDebugLibraries', task ':processDebugJavaRes', task ':transformResourcesWithMergeJavaResForDebug', task ':validateSigningDebug', task ':packageDebug', task ':assembleDebug']
:checkDebugClasspath (Thread[main,5,main]) started.
:checkDebugClasspath
Skipping task ':checkDebugClasspath' as it is up-to-date.
:checkDebugClasspath UP-TO-DATE
:checkDebugClasspath (Thread[main,5,main]) completed. Took 0.078 secs.
:preBuild (Thread[main,5,main]) started.
:preBuild
Skipping task ':preBuild' as it has no actions.
:preBuild UP-TO-DATE
:preBuild (Thread[main,5,main]) completed. Took 0.0 secs.
:preDebugBuild (Thread[main,5,main]) started.
:preDebugBuild
Skipping task ':preDebugBuild' as it is up-to-date.
:preDebugBuild UP-TO-DATE
:preDebugBuild (Thread[main,5,main]) completed. Took 0.006 secs.
:compileDebugAidl (Thread[main,5,main]) started.
:compileDebugAidl
Task ':compileDebugAidl' is not up-to-date because:
  Task has failed previously.
All input files are considered out-of-date for incremental task ':compileDebugAidl'.
Unable do incremental execution: full task run
Starting process 'command 'C:\Users\76441\AppData\Local\Android\Sdk\build-tools\28.0.3\aidl.exe''. Working directory: C:\Users\76441\Desktop\demo\appdemo\build\.qt\app\android\appdemo\android-build Command: C:\Users\76441\AppData\Local\Android\Sdk\build-tools\28.0.3\aidl.exe -pC:\Users\76441\AppData\Local\Android\Sdk\platforms\android-28\framework.aidl -oC:\Users\76441\Desktop\demo\appdemo\build\.qt\app\android\appdemo\android-build\build\generated\source\aidl\debug -IE:\Qt\Qt5.12.7\5.12.7\android_armv7\src\android\java\src -IC:\Users\76441\Desktop\demo\appdemo\build\.qt\app\android\appdemo\android-build\src\debug\aidl -IC:\Users\76441\Desktop\demo\appdemo\build\.qt\app\android\appdemo\android-build\aidl -IC:\Users\76441\Desktop\demo\appdemo\build\.qt\app\android\appdemo\android-build\src -dC:\Users\76441\AppData\Local\Temp\aidl7661141059405377742.d E:\Qt\Qt5.12.7\5.12.7\android_armv7\src\android\java\src\org\kde\necessitas\ministro\IMinistro.aidl
:compileDebugAidl FAILED
:compileDebugAidl (Thread[main,5,main]) completed. Took 0.046 secs.
3 actionable tasks: 1 executed, 2 up-to-date
VCS Checkout Cache (C:\Users\76441\Desktop\demo\appdemo\build\.qt\app\android\appdemo\android-build\.gradle\vcsWorkingDirs) has not been cleaned up in 0 days

@KellyGodLv
Copy link
Author

command line 是这么写的 成功!

E:\Qt\Qt5.12.7\5.12.7\android_armv7\bin\androiddeployqt.exe --input build\.qt\app\android\appdemo\android-deployment-settings.json --output build\.qt\app\android\appdemo\android-build --android-platform android-28 --jdk "C:\\Program Files (x86)\\Java\\jdk1.8.0_71" --gradle --no-gdbserver > 1.txt

@waruqi
Copy link
Member

waruqi commented Apr 14, 2020

那就不知道了,不行你就先xmake -v 这么用着吧,回头有时间我装下qt环境看看 不过得稍微等段时间

@waruqi
Copy link
Member

waruqi commented Apr 19, 2020

你这的case我暂时没法复现,不过我装了个win qt 5.14的最新版本,即使不加-v也能正常生成Apk成功了。。

不过,话说qt 5.14又大改过了整个结构(lib库命名也变了,deploy.json的参数设置也变了不少),我做了很多的适配才搞定

我现在暂时没磁盘空间再去重装5.12了,装个5.14我清理了很久才腾出空间来装。。不行也可以升级到最新5.14的qt试试

@waruqi
Copy link
Member

waruqi commented Apr 26, 2020

这个先这样吧,5.14上应该可以了,这边实在没空间再去整个5.12来试了。最近要封板了 暂时不动了。

@waruqi waruqi closed this as completed Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants