Skip to main content
 首页 » 编程设计

android之目标 ID android-8 无效。使用 'android list targets' 获取目标 ID

2025年05月04日47duanxz

我想从我的 python main.py 文件构建 apk。我正在运行这个命令

./build.py --package org.test.testapp --name testapp --version 1.0 --dir testapp debug adb installd 

我得到的错误是

Error: Target id 'android-8' is not valid. Use 'android list targets' to get the target ids. 
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' 

请您参考如下方法:

这意味着你没有按照要求/python-for-android 安装过程进行操作。您遇到此问题是因为您没有在计算机上安装 Android API 8。