作者:uka9032934 | 来源:互联网 | 2024-11-04 16:40
在尝试为Unity编译一个简单的Java库时,运行`antjar`命令后遇到了JavaI/O异常。具体错误信息为“无法启动程序${aAPT},错误代码2”,这通常表示指定的文件或目录不存在。此问题可能是由于环境配置不正确或路径设置有误导致的。建议检查相关路径和环境变量,确保所有依赖项都已正确安装和配置。
I'm trying to compile a simple Java library for Unity, and after running ant jar, I get the following message:
我正在尝试为Unity编译一个简单的Java库,运行ant jar后,我收到以下消息:
/Applications/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:649: The following error occurred while executing this line:
/Applications/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:694: Execute failed: java.io.IOException: Cannot run program "/Users/****/UnityProjects/****/JavaTestPlugin/${aapt}": error=2, No such file or directory
This is strange, because I've compiled this class before successfully, and I have everything I would think I need. Namely Android Studio, and related packages (Tools, Android 4/5, etc). I noticed that aapt is not located in my adt-bundle/sdk/platform-tools directory, but it is in one of the build-tools directories. Even including the latter in my path did not help.
这很奇怪,因为我在成功之前编译了这个类,并且我拥有我认为需要的一切。即Android Studio和相关软件包(Tools,Android 4/5等)。我注意到aapt不在我的adt-bundle / sdk / platform-tools目录中,但是它位于一个build-tools目录中。即使在我的道路上包括后者也无济于事。
Anyway, I am running Mac OS 10.10.3, with the most up-to-date version of Android Studio. This class compiled before upgrading to Yosemite. I've seen suggestions on how to fix this issue, but all of those suggestions apply to Linux as opposed to Mac OS.
无论如何,我正在使用最新版本的Android Studio运行Mac OS 10.10.3。此类在升级到Yosemite之前编译。我已经看到了如何解决这个问题的建议,但所有这些建议都适用于Linux而不是Mac OS。
2 个解决方案