使用PGS4A构建游戏时出错
我正在用Python和pygame做一个小游戏。
我想把这个游戏弄到安卓上去。
希望能用到PGS4A这个工具来实现。
在配置好之后,我需要构建游戏。
所以我就输入了这个命令:
python android.py build ~/project/programming/python/gameEngine release install
结果我遇到了这个错误:
BUILD FAILED
/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/tools/ant/build.xml:570: The following error occurred while executing this line:
/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/tools/ant/build.xml:622: The following error occurred while executing this line:
/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/tools/ant/build.xml:658: Execute failed: java.io.IOException: Cannot run program "/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/platform-tools/aapt" (in directory "/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/extras/google/play_licensing/library"): error=2, No such file or directory
我该怎么办呢?我有点迷茫。
我使用的是CrunchBang Linux 11。
3 个回答
要解决这个问题,先去这个网站 http://ady.my/viewer/,在“build”部分下载最新版本的构建工具。下载后,把里面的 'aapt' 和 'dx' 文件,还有 'lib' 文件夹提取出来,然后把这些东西移动到终端指定的文件夹:/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/platform-tools。
代码看起来会和下面的差不多:
mv aapt dx lib /home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/platform-tools
不过,PGS4A 已经过时了。我建议你使用 Python for Android,你可以在这个链接找到它: http://python-for-android.readthedocs.org/en/latest/
出于某种原因,这个问题在使用pgs4a 0.9.6的Windows系统上很常见。
你可以看看这个链接。
确保解压后的文件夹结构和截图里的一样。
你没有安装完整的android-sdk。你需要错误信息中提到的那些缺失文件。你可以选择回退到pgs4a 0.9.4版本,这个版本不需要那些许可文件,或者重新安装android-sdk。
craig@ubuntu-desktop:~/Documents/python/pgs4a-0.9.6$ cd android-sdk/
craig@ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk$ ls
add-ons extras platforms platform-tools SDK Readme.txt temp tools
craig@ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk$ cd extras/
craig@ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras$ ls
google
craig@ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras$ cd google/
craig@ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras/google$ ls
play_apk_expansion play_licensing
craig@ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras/google$ cd play_licensing/
craig@ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras/google/play_licensing$ ls
library LICENSE.txt README.txt sample source.properties test
craig@ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras/google/play_licensing$
这个链接可能对你有帮助。http://discussion.pychildren.org/t/windows-installation/10
你可能在使用64位的操作系统,而这些程序是针对32位的库编译的。
我对CrunchBang的资源库不太了解,但你可以试试
sudo apt-get install libc6:i386 libstdc++6:i386 zlib1g:i386 lib32ncurses5
然后再运行安装程序。