为 Android 构建时退出并显示代码 9009

发布于 2025-01-14 10:24:39 字数 4960 浏览 1 评论 0原文

当我尝试构建我的第一个 Android 应用程序(即使是在空白的多设备项目上)时,它会返回 exited with code 9009 错误。

[执行错误] 命令“PATH \bin;C:\Program Files (x86)\Kassl\dOPC\lib270\Win32;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBase2020\IDE_spoof;C:\Program 文件 (x86)\dxgettext;C:\ProgramData\Oracle\Java\javapath;C:\Program 文件 (x86)\Embarcadero\Studio\20.0\bin;C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl;C:\Program 文件 (x86)\Embarcadero\Studio\20.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\Win64;C:\Program 文件\AdoptOpenJDK\jdk-8.0.242.08-hotspot\bin;C:\Program Files (x86)\Embarcadero\Studio\21.0\bin;C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl;C:\Program 文件 (x86)\Embarcadero\Studio\21.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl\Win64;C:\Windows\system32;C:\Windows;C:\Windows\System32\ Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program 文件 (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program 文件\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Program 文件\PuTTY;C:\Program Files (x86)\PostgreSQL\10\bin;C:\Users\marc.guillot\AppData\Local\Microsoft\WindowsApps; & “C:\ Users \ marc.guillot \ AppData \ Local \ Android \ Sdk \ build-tools \ 31.0.0 \ dx.bat” --dex --output="C:\Tmp\Apilador\Android64\Debug\classes.dex" "c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\android-support-v4.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\cloud-messaging.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-ads-base.17.2.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-ads.17.2.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-analytics.16.0.8.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-base.16.0.1.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-basement.16.2.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-gass.17.2.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-identity.16.0.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-maps.16.1.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-stats.16.0.1.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-tasks.16.0.1.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-wallet.16.0.1.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-analytics.16.4.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-common.16.1.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-iid-interop.16.0.1.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-iid.17.1.1.dex.jar" "c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-messaging.17.5.0.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\fmx.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\google-play-billing.dex.jar" “c:\程序文件 (x86)\embarcadero\studio\21.0\lib\android\Debug\google-play-licensing.dex.jar" " 退出,代码为 9009。

该错误消息中引用的 SDK 文件夹没有任何 dx.bat 文件,但它确实有一个 d8.bat 文件,当我将其复制到 dx.bat 文件,然后错误消息更改为 [Exec Error] EXEC(1): Invalid output: C:\Tmp\Apilador\Android64\Debug\classes.dex 尽管它有该文件夹的读写权限

似乎与 Delphi 安装的 SDK 不兼容(在“选项”、“部署”、“SDK 管理器”中,它显示为 Android SDK 25.2.5)

。 Delphi 10.4 Update 1?。Embarcadero 文档网站已关闭数月并不能帮助识别这些问题:-(。

更新:

SDK 管理器已配置为使用构建工具31.0.0,但我发现还有一个旧的 30.0.2 文件夹,我已将这些路径更改为旧文件夹,现在 Delphi 可以正确编译。

When I try to build my first Android application (even on a blank multi-device project) it returns an exited with code 9009 error.

[Exec Error] The command "PATH \bin;C:\Program Files
(x86)\Kassl\dOPC\lib270\Win32;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBase2020\IDE_spoof;C:\Program
Files (x86)\dxgettext;C:\ProgramData\Oracle\Java\javapath;C:\Program
Files
(x86)\Embarcadero\Studio\20.0\bin;C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl;C:\Program
Files
(x86)\Embarcadero\Studio\20.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\Win64;C:\Program
Files\AdoptOpenJDK\jdk-8.0.242.08-hotspot\bin;C:\Program Files
(x86)\Embarcadero\Studio\21.0\bin;C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl;C:\Program
Files
(x86)\Embarcadero\Studio\21.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl\Win64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program
Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program
Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Program
Files\PuTTY;C:\Program Files
(x86)\PostgreSQL\10\bin;C:\Users\marc.guillot\AppData\Local\Microsoft\WindowsApps;
&
"C:\Users\marc.guillot\AppData\Local\Android\Sdk\build-tools\31.0.0\dx.bat"
--dex --output="C:\Tmp\Apilador\Android64\Debug\classes.dex" "c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\android-support-v4.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\cloud-messaging.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-ads-base.17.2.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-ads.17.2.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-analytics.16.0.8.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-base.16.0.1.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-basement.16.2.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-gass.17.2.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-identity.16.0.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-maps.16.1.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-stats.16.0.1.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-tasks.16.0.1.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-android-gms.play-services-wallet.16.0.1.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-analytics.16.4.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-common.16.1.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-iid-interop.16.0.1.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-iid.17.1.1.dex.jar" "c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\com-google-firebase.firebase-messaging.17.5.0.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\fmx.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\google-play-billing.dex.jar"
"c:\program files
(x86)\embarcadero\studio\21.0\lib\android\Debug\google-play-licensing.dex.jar"
" exited with code 9009.

The SDK folder referenced in that error message doesn't have any dx.bat file, but it does have a d8.bat file, when I copy it to a dx.bat file then the error message changes to [Exec Error] EXEC(1): Invalid output: C:\Tmp\Apilador\Android64\Debug\classes.dex although it has read and write permissions to that folder.

It seems that the building script is not compatible with the SDK that Delphi installed (in Options, Deployment, SDK Manager it appears as Android SDK 25.2.5).

What should I do to create APKs from my Delphi 10.4 Update 1 ?. The Embarcadero Documentation site having been down for months doesn't help to identify these issues :-(.

Update:

The SDK manager was configured to use the build-tools 31.0.0, but I've seen that there also was an older 30.0.2 folder. I have changed those paths to the older folder and now Delphi compiles correctly.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文