怎么编译 vim 上的 android 系统

我希望自己编译 android 11 或者 12 系统到 vim4 上,请问可以直接通过 aosp 编译吗? 或者公司有 Android 的源码提供下载吗?

Hello @jeff_9999

参考如下文档:

1 Like

在编译的时候,文档里描述是 make -jN otapackage

这里的otapackage是必须加的吗? 我只想要 system.img

我遇到这些异常,能帮忙看一下吗?谢谢

error: frameworks/base/apct-tests/perftests/blobstore/Android.bp:15:1: "BlobStorePerfTests" depends on undefined module "ub-uiautomator"
error: platform_testing/libraries/app-helpers/interfaces/Android.bp:41:1: "app-helpers-clockwork-interfaces" depends on undefined module "ub-uiautomator"
error: frameworks/base/tests/ActivityManagerPerfTests/utils/Android.bp:15:1: "ActivityManagerPerfTestsUtils" depends on undefined module "ub-uiautomator"
error: platform_testing/tests/functional/notificationtests/Android.bp:15:1: "NotificationFunctionalTests" depends on undefined module "ub-uiautomator"
error: frameworks/layoutlib/bridge/Android.bp:42:1: "layoutlib-no-framework" depends on undefined module "tools-common-prebuilt"
error: cts/hostsidetests/harmfulappwarning/testapp/Android.bp:15:1: "CtsHarmfulAppWarningTestApp" depends on undefined module "ub-uiautomator"
error: packages/apps/DocumentsUI/tests/Android.bp:63:1: "DocumentsUITests" depends on undefined module "ub-uiautomator"
error: frameworks/base/startop/iorap/functional_tests/Android.bp:15:1: "iorap-functional-tests" depends on undefined module "androidx.test.uiautomator_uiautomator"

不是必须的,加otapackage后缀会再编译出ota升级包。

提供的log看不出哪里出了问题。
但编译出错的问题,首先需要确保两点:
1,下载的代码是完整的,无错误的。
2,编译工具链安装完整。https://docs.khadas.com/android/zh-cn/vim4/install_toolchains.html

感谢回复,我试试重新 init . 之前 repo sync是成功了.

请问异常有解决吗,我这边编译aosp也报相似的问题

error: frameworks/base/services/tests/servicestests/test-apps/SuspendTestApp/And
roid.bp:15:1: "SuspendTestApp" depends on undefined module "ub-uiautomator"
error: platform_testing/tests/functional/calculator/Android.bp:15:1: "Calculator
FunctionalTests" depends on undefined module "ub-uiautomator"
error: packages/apps/Settings/tests/uitests/Android.bp:15:1: "SettingsUITests" d
epends on undefined module "ub-uiautomator"
error: platform_testing/libraries/aupt-lib/Android.bp:17:1: "AuptLib" depends on
 undefined module "ub-uiautomator"
error: frameworks/layoutlib/bridge/tests/Android.bp:15:1: "layoutlib-tests" depe
nds on undefined module "tools-common-prebuilt"
error: frameworks/layoutlib/bridge/tests/Android.bp:15:1: "layoutlib-tests" depe
nds on undefined module "sdk-common"
error: platform_testing/utils/wifistrengthscanner/Android.bp:17:1: "WifiStrength
ScannerUtil" depends on undefined module "ub-uiautomator"
error: platform_testing/libraries/aupt-lib/Android.bp:31:1: "AuptRunner" depends
 on undefined module "ub-uiautomator"
error: frameworks/layoutlib/validator/Android.bp:17:1: "layoutlib-validator" dep
ends on undefined module "tools-common-prebuilt"
error: platform_testing/tests/jank/jankmicrobenchmark/Android.bp:15:1: "JankMicr
oBenchmarkTests" depends on undefined module "ub-uiautomator"
error: platform_testing/tests/jank/jankmicrobenchmark/Android.bp:15:1: "JankMicr
oBenchmarkTests" depends on undefined module "ub-janktesthelper"
error: frameworks/base/core/tests/coretests/Android.bp:1:1: "FrameworksCoreTests
" depends on undefined module "ub-uiautomator"
error: platform_testing/tests/functional/notificationtests/Android.bp:15:1: "Not
ificationFunctionalTests" depends on undefined module "ub-uiautomator"
13:22:41 soong bootstrap failed with: exit status 1

Hello @hghbot

@william.lin 帮忙看看。

@hghbot 一般编译出错无非是下面两点导致:
1,下载的代码是完整的,无错误的。
2,编译工具链安装完整。https://docs.khadas.com/android/zh-cn/vim4/install_toolchains.html
你再执行下同步代码命令看看是否有报错?并把完整信息发给我确认下。