我正在尝试使用命令
为Android创建apk./build.py --package org.test.hideapp --name hideapp --version 1.0 --dir /home/home/Downloads/Projects/test5/hideapp debug adb installd
但是,我收到了错误
./build.py --package org.test.hideapp --name hideapp --version 1.0 --dir /home/home/Downloads/Projects/test5/hideapp debug adb installd
Updated project.properties
Updated local.properties
----------
build.xml: Failed to find version-tag string. File must be updated.
In order to not erase potential customizations, the file will not be automatically regenerated.
If no changes have been made to the file, delete it manually and run the command again.
If you have made customizations to the build process, the file must be manually updated.
It is recommended to:
* Copy current file to a safe location.
* Delete original file.
* Run command again to generate a new file.
* Port customizations to the new file, by looking at the new rules file
located at <SDK>/tools/ant/build.xml
* Update file to contain
version-tag: custom
to prevent file from being rewritten automatically by the SDK tools.
----------
Updated file ./proguard-project.txt
Traceback (most recent call last):
File "./build.py", line 412, in <module>
make_package(args)
File "./build.py", line 304, in make_package
make_pythonzip()
File "./build.py", line 132, in make_pythonzip
python_files = [x for x in listfiles(d) if select(x)]
File "./build.py", line 96, in listfiles
for item in os.listdir(d):
OSError: [Errno 2] No such file or directory: '/home/home/Downloads/python-for-android/src/private/lib/python2.7'
答案 0 :(得分:1)
尽管你没有尝试创造一些神奇的东西,但只创建一个apk
,考虑buildozer
所以你需要这样做:
pip install buildozer
buildozer init
进行初始化。它在项目目录中创建名为buildozer.spec
的文件,您可以通过两种方式指定版本:main.py中的__version__
指令(version.regex
和version.filename
) ,或明确地在version
指令创建一个apk并(可选)将其部署在某个连接的设备上:
buildozer android debug deploy run
默认情况下,bin
目录中会有一个apk文件。