gpt4 book ai didi

android - 构建 Cordova Android 应用程序时,构建找不到 aidl

转载 作者:数据小太阳 更新时间:2023-10-29 02:45:23 26 4
gpt4 key购买 nike

我使用 Cordova 3.0 的 phonegap/cordova 应用运行良好。然后我出于不相关的原因将我的 Android SDK 更新到 4.3(更准确地说是 Titanium 应用程序),突然构建失败,并出现以下错误:

...
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] Found 1 AIDL files.
[aidl] Compiling 1 AIDL files.

BUILD FAILED
/Applications/adt-bundle/sdk/tools/ant/build.xml:647: The following error occurred while executing this line:
/Applications/adt-bundle/sdk/tools/ant/build.xml:653: Execute failed: java.io.IOException: Cannot run program "/Applications/adt-bundle/sdk/platform-tools/aidl" (in directory "/Users/cool/Dropbox/Workspaces/Cordova3Plus/TrueBudgetFree/platforms/android"): error=2, No such file or directory
...
Caused by: java.io.IOException: error=2, No such file or directory
...

我已经检查了文件位置,并且...

//the aidl executable isn't actually in
Applications/adt-bundle/sdk/platform-tools/
//Instead, it is in a ser
Applications/adt-bundle/sdk/build-tools/[sdk version]/

有几个 SDK 版本(17.0.0 到 19.0.0 和“Android-4.3”)的子文件夹。这些目录中的每一个都包含 aidl 可执行文件。

我尝试将 ../sdk/build-tools 文件夹添加到我的 $PATH (Mac),但没有帮助。

我假设构建器将版本名称插入到路径字符串中,但我无法确定,因为我不了解这些构建过程的内部工作原理。我所能看到的,有点,就是路径被引用/编辑的地方。

第 647/653 行的 build.xml 具有以下代码:

<echo level="info">Handling aidl files...</echo>
<aidl executable="${aidl}"
framework="${project.target.framework.aidl}"
libraryBinAidlFolderPathRefid="project.library.bin.aidl.folder.path"
genFolder="${gen.absolute.dir}"
aidlOutFolder="${out.aidl.absolute.dir}">
<source path="${source.absolute.dir}"/>
</aidl>

我找到了 this comment这表明 aidl 文件偶尔会随着新的 SDK 移动一次。

我试过恢复到 Android SDK 4.2,但没有用。

这里的原因可能是什么(更重要的是:解决方案)?

最佳答案

丑陋的答案:我只是将该死的 aidl 可执行文件复制到 build.xml 期望的位置。

再次尝试构建后,结果发现以下文件也应该位于平台工具中,即使它们位于构建工具中......

适合

但是dx找不到dx.jar,所以你也必须复制lib/dx.jar...

这导致构建成功。虽然这很可怕。

我还想到我可以尝试将对/platform-tools 文件夹(在 build.xml 内)的引用替换为对/build-tools 的引用。还没有尝试过,它同样古怪古怪。

关于android - 构建 Cordova Android 应用程序时,构建找不到 aidl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20119945/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com