从源代码构建android-x86时出错

时间:2018-10-26 13:05:14

标签: android android-x86

我正在尝试从android x-86源构建一个.iso图像,但是这样做没有成功。您到这里为止:

1 我使用以下步骤在Mac上创建了一个新的APFS(区分大小写)分区:

  • 打开应用程序→实用程序→磁盘实用程序

  • 单击“查看”按钮,然后更改为“显示所有设备”

  • 选择所需的容器磁盘,然后单击屏幕顶部的添加按钮

  • 选择新分区并命名,例如“ android”

  • 从“格式”菜单中选择“ APFS(区分大小写)”

2 使用此命令在终端中获得src

  • mkdir ~/bin

  • PATH=~/bin:$PATH

  • curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

  • chmod a+x ~/bin/repo

  • mkdir oreo-x86

  • cd oreo-x86

  • repo init -u git://gitscm.sf.net/gitroot/android-x86/manifest -b oreo-x86

  • repo sync

目前,没有发生错误,下载了几个小时后,我在本地得到了一份回购副本。

3 构建.iso映像

在终端中,我尝试使用以下命令进行构建:

  • source build/envsetup.sh
  • lunch android_x86_64-userdebug 这是此命令的输出:

============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=8.1.0 TARGET_PRODUCT=android_x86_64 TARGET_BUILD_VARIANT=userdebug TARGET_BUILD_TYPE=release TARGET_PLATFORM_VERSION=OPM1 TARGET_BUILD_APPS= TARGET_ARCH=x86_64 TARGET_ARCH_VARIANT=x86_64 TARGET_CPU_VARIANT= TARGET_2ND_ARCH=x86 TARGET_2ND_ARCH_VARIANT=x86_64 TARGET_2ND_CPU_VARIANT= HOST_ARCH=x86_64 HOST_2ND_ARCH=x86 HOST_OS=darwin HOST_OS_EXTRA=Darwin-17.4.0-x86_64-i386-64bit HOST_CROSS_OS= HOST_CROSS_ARCH= HOST_CROSS_2ND_ARCH= HOST_BUILD_TYPE=release BUILD_ID=OPM8.181005.003 OUT_DIR=out AUX_OS_VARIANT_LIST= ============================================

  • m -j4 iso_img在此命令处引发错误。 这是输出: ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=8.1.0 TARGET_PRODUCT=android_x86_64 TARGET_BUILD_VARIANT=userdebug TARGET_BUILD_TYPE=release TARGET_ARCH=x86_64 TARGET_ARCH_VARIANT=x86_64 TARGET_2ND_ARCH=x86 TARGET_2ND_ARCH_VARIANT=x86_64 HOST_ARCH=x86_64 HOST_2ND_ARCH=x86 HOST_OS=darwin HOST_OS_EXTRA=Darwin-17.4.0-x86_64-i386-64bit HOST_BUILD_TYPE=release BUILD_ID=OPM8.181005.003 OUT_DIR=out ============================================

ninja: no work to do. [1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja out/target/product/x86_64/clean_steps.mk was modified, regenerating... [2/828] including ./art/Android.mk ... art/build/Android.common.mk:50: warning: unsupported HOST_ARCH=x86_64 [619/828] including ./system/sepolicy/Android.mk ... ./system/sepolicy/Android.mk:111: warning: BOARD_SEPOLICY_VERS not specified, assuming current platform version [828/828] including ./tools/apksig/Android.mk ... platform_testing/build/tasks/tests/instrumentation_metric_test_list.mk: warning: continuous_instrumentation_metric_tests: Unknown installed file for module perf-setup.sh platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module RecyclerViewTests platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module TelecomUnitTests platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module SettingsFunctionalTests platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module LauncherFunctionalTests platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module EmergencyInfoTests platform_testing/build/tasks/tests/native_metric_test_list.mk: warning: continuous_native_metric_tests: Unknown installed file for module perf-setup.sh

`[  1% 997/90508] //frameworks/compile/mclinker/lib/Script:libmcldScript yacc ScriptParser.yy
FAILED: out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_x86_64_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.cpp out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_x86_64_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.h 
BISON_PKGDATADIR=external/bison/data prebuilts/misc/darwin-x86/bison/bison -d  --defines=out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_x86_64_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.h -o out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_x86_64_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.cpp frameworks/compile/mclinker/lib/Script/ScriptParser.yy`
`[  1% 998/90508] //frameworks/compile/mclinker/lib/Script:libmcldScript lex ScriptScanner.ll [darwin]
ninja: build stopped: subcommand failed.
13:51:50 ninja failed with: exit status 1

#### failed to build some targets (01:57 (mm:ss)) ####`

有人知道为什么会发生这种情况吗,我该如何解决?谢谢。

0 个答案:

没有答案