make otapackage 失败

简介: make otapackage 失败

平台


rk3288 + android 7.1


问题


使用make otapackage 编译失败, log 如下:


Running:  e2fsck -f -n /tmp/unsparse_system-UwjZR9.img
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
system: 1923/131072 files (0.0% non-contiguous), 148861/524288 blocks
Traceback (most recent call last):
  File "./build/tools/releasetools/add_img_to_target_files", line 476, in <module>
    main(sys.argv[1:])
  File "./build/tools/releasetools/add_img_to_target_files", line 470, in main
    AddImagesToTargetFiles(args[0])
  File "./build/tools/releasetools/add_img_to_target_files", line 389, in AddImagesToTargetFiles
    boot_img=boot_image)
  File "./build/tools/releasetools/add_img_to_target_files", line 109, in AddSystem
    block_list=block_list)
  File "./build/tools/releasetools/add_img_to_target_files", line 118, in BuildSystem
    return CreateImage(input_dir, info_dict, "system", block_list=block_list)
  File "./build/tools/releasetools/add_img_to_target_files", line 214, in CreateImage
    img_out = os.path.join(os.environ["OUT"],"system.img")
  File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
    raise KeyError(key)
KeyError: 'OUT'
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
#### make failed to build some targets (02:39 (mm:ss)) ####


分析


请同事尝试编译, 他那边的代码是正常的, 无法确认根源.

在上面的LOG中 : os.path.join(os.environ[“OUT”],“system.img”)

没写过PY脚本, 假设性地查看了下 OUT 环境变量发现,

我的环境下, OUT是空的. 而同事的OUT目录指向的却是源码编译的OUT目录.

于是找了另外一台PC验证了下, 尝试给OUT赋上正确的值, 结果编译通过了, 那么问题根源找到了.


而后, 对比编译命令发现, 我缺少了执行lunch xxx命令.

惯性所致, 习惯了旧的SDK上, source 完 envsetup.sh 后, 自动lunch了


PS: 有个小插曲, 刚开始并不会报这个错误, 因为我先编译了5.1的代码, 而其中, OUT变量已经赋了值, 虽然不正确, 但不会导致编译失败


相关文章
|
Oracle 关系型数据库 Go
【开发工具】解决 Goland 报错:Found several packages [main, xxx] in ...
【开发工具】解决 Goland 报错:Found several packages [main, xxx] in ...
1724 0
【开发工具】解决 Goland 报错:Found several packages [main, xxx] in ...
|
8月前
Mac系统R语言升级后无法加载包报错 package or namespace load failed in dyn.load
Mac系统R语言升级后无法加载包报错 package or namespace load failed in dyn.load
|
8月前
[cmake] --- find_package
[cmake] --- find_package
165 0
|
存储 Linux 计算机视觉
CMake库打包以及支持find_package(二)
CMake库打包以及支持find_package(二)
319 0
|
测试技术 Linux
CMake库打包以及支持find_package(一)
CMake库打包以及支持find_package(一)
232 0
装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status]
装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status]
|
Android开发
The application could not be installed: INSTALL_FAILED_TEST_ONLY. Android App包安装失败(Bug记录)
The application could not be installed: INSTALL_FAILED_TEST_ONLY. Android App包安装失败(Bug记录)
No package ‘glib-2.0‘ found/No package ‘gobject-2.0‘ found
No package ‘glib-2.0‘ found/No package ‘gobject-2.0‘ found
221 0
No package ‘gtksourceview-3.0‘ found/无法定位软件包 libgtksourceview-3-dev
No package ‘gtksourceview-3.0‘ found/无法定位软件包 libgtksourceview-3-dev
114 0
No package ‘libpeas-1.0‘ found/No package ‘libpeas-gtk-1.0‘
No package ‘libpeas-1.0‘ found/No package ‘libpeas-gtk-1.0‘
63 0