Android 13 build problems

Im tryign to build android 13 but i get stuck with these errors

 repo init -u https://github.com/khadas/android_manifest.git -b khadas-edge2-android13
  File "/home/justin/edge2android13/.repo/repo/main.py", line 95
    )
    ^
SyntaxError: invalid syntax

and

 .repo/repo/repo init -u https://github.com/khadas/android_manifest.git -b Khadas-edge2-android13
  File ".repo/repo/repo", line 51
    def print(self, *args, **kwargs):
            ^
SyntaxError: invalid syntax

Im running Ubuntu 23.04

Android 13 has not been officially released yet. I am still verifying (there may be issues with the company’s network, some warehouses have been unable to download, and I am still analyzing). Of course, you can also download it and give me feedback if you encounter any problems.

I had to run the command like this
python3 .repo/repo/repo init -u https://github.com/khadas/android_manifest.git -b khadas-edge2-android13

It seems at some point i also ended up with a capitol K in the branch name.

Currently downloadign the repo, have seen a few errors about unable to fetch soem things.

What specific error is it?

error: Unable to fully sync the tree
error: Downloading network changes failed.
error: Checking out local projects failed.
Failing repos:
RKDocs/common
bootable/recovery/mtdutils
build/pesto
cts
Try re-running with "-j1 --fail-fast" to exit at the first error.
================================================================================
Repo command failed due to the following `SyncError` errors:
GitCommandError: 'fetch --quiet --progress github --prune --recurse-submodules=no --tags +refs/heads/*:refs/remotes/github/* +refs/tags/*:refs/tags/*' on android_bootable_recovery_mtdutils failed
stdout: fatal: not a git repository: '/home/justin/edge2android13/.repo/projects/bootable/recovery/mtdutils.git'
GitCommandError: 'fetch --quiet --progress aosp --recurse-submodules=no --tags +refs/heads/*:refs/remotes/aosp/* +refs/tags/android-13.0.0_r74:refs/tags/android-13.0.0_r74 +refs/tags/*:refs/tags/*' on platform/build/pesto failed
stdout: fatal: not a git repository: '/home/justin/edge2android13/.repo/projects/build/pesto.git'
GitCommandError: 'fetch --quiet --progress github --prune --recurse-submodules=no --tags +refs/heads/*:refs/remotes/github/* +refs/tags/*:refs/tags/*' on android_RKDocs_common failed
stdout: fatal: not a git repository: '/home/justin/edge2android13/.repo/projects/RKDocs/common.git'
GitCommandError: 'fetch --quiet --progress aosp --recurse-submodules=no --tags +refs/heads/*:refs/remotes/aosp/* +refs/tags/android-13.0.0_r74:refs/tags/android-13.0.0_r74 +refs/tags/*:refs/tags/*' on platform/cts failed
stdout: fatal: not a git repository: '/home/justin/edge2android13/.repo/projects/cts.git'
GitCommandError: 'fetch --quiet --progress github --prune --recurse-submodules=no --tags +refs/heads/*:refs/remotes/github/* +refs/tags/*:refs/tags/*' on android_RKDocs_common failed
stdout: fatal: not a git repository: '/home/justin/edge2android13/.repo/projects/RKDocs/common.git'
+7 additional errors...

@Blah_Blah This is an error caused by network instability. I am also experiencing an error similar to yours, which was resolved through the following methods. In the first few days, I was unable to analyze the cause, and then I dealt with other important and urgent matters. Let’s take a look again today, and I can download it normally. The conclusion is that network instability is the cause.

Repo command failed due to the following `RepoUnhandledExceptionError` errors:
GitCommandError: 'fetch --quiet --progress github --prune --recurse-submodules=no --tags +refs/heads/*:refs/remotes/github/* +refs/tags/*:refs/tags/*' on android_external_camera_engine_rkaiq failed
stdout: * Couldn't find host github.com in the .netrc file; using defaults
GitCommandError: 'fetch --quiet --progress github --prune --recurse-submodules=no --tags +refs/heads/*:refs/remotes/github/* +refs/tags/*:refs/tags/*' on android_build_make failed
stdout: * Couldn't find host github.com in the .netrc file; using defaults
stdout: * Couldn't find host github.com in the .netrc file; using defaults
GitCommandError: 'fetch --quiet --progress github --prune --recurse-submodules=no --tags +refs/heads/*:refs/remotes/github/* +refs/tags/*:refs/tags/*' on android_build_soong failed
stdout: * Couldn't find host github.com in the .netrc file; using defaults
GitCommandError: 'fetch --quiet --progress github --prune --recurse-submodules=no --tags +refs/heads/*:refs/remotes/github/* +refs/tags/*:refs/tags/*' on android_device_khadas_common failed
stdout: * Couldn't find host github.com in the .netrc file; using defaults
+76 additional errors...
$ find .repo/ -iname "*rkaiq.git"
.repo/projects/external/camera_engine_rkaiq.git
.repo/project-objects/android_external_camera_engine_rkaiq.git
$ rm -rf .repo/projects/external/camera_engine_rkaiq.git .repo/project-objects/android_external_camera_engine_rkaiq.git external/camera_engine_rkaiq
$ repo sync -j4 external/camera_engine_rkaiq

$ find .repo/ -iname "*make.git"
.repo/projects/build/make.git
.repo/project-objects/android_build_make.git
$ rm -rf .repo/projects/build/make.git .repo/project-objects/android_build_make.git build/make
$ repo sync -j4 build/make
............................
...........Give two examples
............................

Therefore, for your mistake, you can refer to the following handling (give an example)

$ find .repo/ -iname "*mtdutils.git"
.repo/projects/bootable/recovery/mtdutils.git
.repo/project-objects/android_bootable_recovery_mtdutils.git
$ rm -rf .repo/projects/bootable/recovery/mtdutils.git .repo/project-objects/android_bootable_recovery_mtdutils.git bootable/recovery/mtdutils
$ repo sync -j4 bootable/recovery/mtdutils

Ok lots of progress, but now stuck here:

edge2android13/prebuilts/module_sdk$ git lfs pull
Not in a Git repository.

Been doign a little digging and have found that the default.xml.

Android 12 contains this: <project name="android_prebuilts_module_sdk" path="prebuilts/module_sdk" remote="github" revision="81ff620bcef24d8ccc2208facbb5f27eec25de5b"/>

Android 13 contains this: <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/AdServices" path="prebuilts/module_sdk/AdServices" revision="5f73d8bc7d635d453e532b79ea53b6324919045c" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/AppSearch" path="prebuilts/module_sdk/AppSearch" revision="4d4bec4abe78be84ff4b78e61905b56afc08248c" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/Bluetooth" path="prebuilts/module_sdk/Bluetooth" revision="f4d9bb1578b0b4aa7486219d5e9171121f69f389" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/Connectivity" path="prebuilts/module_sdk/Connectivity" revision="998034260d95b92e98f902a0d846ec1cfc16c555" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/IPsec" path="prebuilts/module_sdk/IPsec" revision="c32128a668a89957b08f6d410a44dd19cb925b82" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/Media" path="prebuilts/module_sdk/Media" revision="34c03f62e190950c106a8a322c124567a056d177" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/MediaProvider" path="prebuilts/module_sdk/MediaProvider" revision="efc4eebbc5a52d59e4c3a62ac2098ff7971e7a80" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/OnDevicePersonalization" path="prebuilts/module_sdk/OnDevicePersonalization" revision="be434514fc7e6effe37bd6c9a7d80483ab2d338a" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/Permission" path="prebuilts/module_sdk/Permission" revision="2af6a378e25400ec0841b724f7d02252bc358c22" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/Scheduling" path="prebuilts/module_sdk/Scheduling" revision="b0ac65beda7c5c8dceb11603c310db12a80ffe07" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/SdkExtensions" path="prebuilts/module_sdk/SdkExtensions" revision="f59307a9f86fd5624117cab8243ad70c3fb452cd" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/StatsD" path="prebuilts/module_sdk/StatsD" revision="2163b15cb60be0bab4c228f4b806c38686222b8c" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/Uwb" path="prebuilts/module_sdk/Uwb" revision="8af17cc2ff3f6285edb89855b1c3574461d9a877" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/Wifi" path="prebuilts/module_sdk/Wifi" revision="ce57cecf013ddc4eefde51b04c405b46c03f30bf" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/art" path="prebuilts/module_sdk/art" revision="6606219e8ea3fc6d23f76edfd3aff36919ec521d" upstream="refs/tags/android-13.0.0_r74"/> <project clone-depth="1" dest-branch="refs/tags/android-13.0.0_r74" groups="pdk" name="platform/prebuilts/module_sdk/conscrypt" path="prebuilts/module_sdk/conscrypt" revision="74f3bcf0371013c63048eee5b3379e0d69e6667a" upstream="refs/tags/android-13.0.0_r74"/>

Android 13: there are no large files in this directory, so please ignore it. Android 13 only has two large file directories. external/camera_engine_rkaiq ,device/khadas/rk3588

this is the latest error i get:

>>>>>>>>>>>>>>>>>>>>> rk3588
libeptz enabled on RK3588
libeptz enabled on RK3588
libeptz enabled on RK3588
[hardware/rockchip/libgralloc frameworks/native/include system/core/libsync system/core/libsync/include external/libdrm/include/drm] 33
[] 33
librockx enabled on RK3588
librockx enabled on RK3588
librockx enabled on RK3588
rk3588 WILL NOT COMPILE rkaiq_tool_server binary
Killed
ninja: build stopped: subcommand failed.

@Blah_Blah The information is too small to tell what the problem is. Are you experiencing a compilation error? Have all the large file directories executed the git lfs pull command? Is there no problem with synchronizing the code?

Sorry yes this is after running ./build.sh -AUCKu, everythign seems to go fine until it start analizing the Android.bp file, then it failes with the above error.

I have all the large files, code sync made it to 100% complete.

============================================
[100% 1/1] analyzing Android.bp files and generating ninja file at out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_out "out/soong"     --out "out"     -o out/soong/build.ninja --globListDir build --globFile out/soong/globs-build.ninja -t -l out/.module_paths/Android.bp.list --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used.build Android.bp
audioflinger want to conditional Compile
devicefactory want to conditional Compile
libRkTeeWeaver want to conditional Compile
libaudioclient want to conditional Compile
libaudiohal want to conditional Compile
libeptz want to conditional Compile
libgralloc_priv want to conditional Compile
libmpimmz conditional Compile
librga want to conditional Compile
librknnrt want to conditional Compile
librkvt_win want to conditional Compile
librockx want to conditional Compile
managerdefault want to conditional Compile
Rockchip conditional compile
libeptz enabled on RK3588
libeptz enabled on RK3588
libeptz enabled on RK3588
[hardware/rockchip/libgralloc frameworks/native/include system/core/libsync system/core/libsync/include external/libdrm/include/drm] 33
librknnrt enabled on RK3588
librknnrt enabled on RK3588
librknnrt enabled on RK3588
Optee Version: v2
0 -DRKAIQ_ENABLE_CAMGROUP
1 -DRKAIQ_HAVE_THUMBNAILS
2 -DRKAIQ_ENABLE_FAKECAM
3 -DRKAIQ_HAVE_MULTIISP
4 -DRKAIQ_HAVE_AWB_V21=1
5 -DRKAIQ_HAVE_GIC_V2=1
6 -DRKAIQ_HAVE_CAC_V03=1
7 -DRKAIQ_HAVE_YNR_V3=1
8 -DRKAIQ_HAVE_CNR_V2=1
9 -DRKAIQ_HAVE_SHARP_V4=1
10 -DRKAIQ_HAVE_BAYER2DNR_V2=1
11 -DRKAIQ_HAVE_BAYERTNR_V2=1
12 -DRKAIQ_HAVE_GAIN_V2=1
13 -DRKAIQ_HAVE_BLC_V1=1
14 -DRKAIQ_HAVE_PDAF=1
15 -DRKAIQ_HAVE_3DLUT_V1=1
16 -DRKAIQ_HAVE_CCM_V1=1
17 -DRKAIQ_HAVE_GAMMA_V11=1
18 -DRKAIQ_HAVE_MERGE_V11=1
19 -DRKAIQ_HAVE_DRC_V11=1
20 -DRKAIQ_HAVE_DEHAZE_V11_DUO=1
21 -DRKAIQ_HAVE_WDR_V1=1
22 -DRKAIQ_HAVE_LDCH_V10=1
23 -DRKAIQ_HAVE_CSM_V1=1
24 -DRKAIQ_HAVE_CGC_V1=1
25 -DRKAIQ_HAVE_AE_V1=1
26 -DRKAIQ_HAVE_AFD_V2=1
27 -DRKAIQ_HAVE_DEBAYER_V1=1
28 -DRKAIQ_HAVE_LSC_V2=1
29 -DRKAIQ_HAVE_DPCC_V1=1
30 -DRKAIQ_HAVE_ACP_V10=1
31 -DRKAIQ_HAVE_AIE_V10=1
32 -DRKAIQ_HAVE_AF=1
33 -DRKAIQ_HAVE_AF_V30=1
cflags size: 34
>>>>>>>>>>>>>>>>>>>>> rk3588
librockx enabled on RK3588
librockx enabled on RK3588
librockx enabled on RK3588
[] 33
Killed
14:55:54 soong bootstrap failed with: exit status 1
ninja: build stopped: subcommand failed.

#### failed to build some targets (48 seconds) ####

Build android failed!

I think im runnign into OOM, just watching my resurces and once RAM is full and Swap fills up the build will fail.

1 Like

I increased my swap fiel size and this helped a lot but now i get this error whiel building android


[100% 2/2] initializing build system ...
device/khadas/common/prebuild.mk:2: warning: Generating manifest snapshot at out/commit_id.xml...
device/khadas/common/prebuild.mk:3: warning: You can disable this by removing this and setting BOARD_RECORD_COMMIT_ID := false in BoardConfig.mk
  File ".repo/repo/repo", line 51
    def print(self, *args, **kwargs):
            ^
SyntaxError: invalid syntax
[  3% 8/249] including build/make/target/board/Android.mk ...
build fstab file with device/khadas/common/scripts/fstab_tools/fstab.in....
rebuilding dtbo image with device/khadas/rk3588/kedge2/dt-overlay.in....
build parameter.txt with device/khadas/common/scripts/parameter_tools/parameter.in....
[ 24% 61/249] including external/rk_tee_user/v2/Android.mk ...
'building rk_tee_user v2'
[ 48% 122/249] including hardware/rockchip/audio/Android.mk ...
"BUILD_BISTREAM_TEST"
[ 49% 124/249] including hardware/rockchip/camera_engine_rkisp/Android.mk ...
TARGET_BOARD_PLATFORM=rk3588
[ 69% 174/249] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:57: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
system/sepolicy/Android.mk:62: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
[ 99% 248/249] finishing build rules ...
FAILED:
cat: cts/tests/tests/os/assets/platform_versions.txt: No such file or directory
cat: cts/tests/tests/os/assets/platform_releases.txt: No such file or directory
In file included from build/make/core/main.mk:1465:
In file included from build/make/core/Makefile:7044:
build/make/core/tasks/cts.mk:49: error:       ============================================================
      Could not find version "13" in CTS platform version file:
      cts/tests/tests/os/assets/platform_versions.txt
      Most likely PLATFORM_VERSION in build/core/version_defaults.mk
      has changed and a new version must be added to this CTS file.
      ============================================================.
15:35:08 ckati failed with: exit status 1

@Blah_Blah Try the following command to check if your SDK has these two files. If not, it indicates that there is an error in your synchronization code. You need to execute the synchronization code command at the same time to check for any errors and resolve them.

$ ls -l cts/tests/tests/os/assets/platform_versions.txt
-rw-rw-r-- 1 hlm hlm 2 Sep 12 18:25 cts/tests/tests/os/assets/platform_versions.txt
$ ls -l cts/tests/tests/os/assets/platform_releases.txt
-rw-rw-r-- 1 hlm hlm 3 Sep 12 18:25 cts/tests/tests/os/assets/platform_releases.txt

Looks liek its all workign now, i was missing some files in a few folders, had to fix these.

I just try to use the built update.img but the device is stuck at the boot animation, goign to try a new build without the change from my my other question.

I have logcat open so can see the device is stuck at file number 2 of the boot anaimtion.

Bellow are some errors, i also noticed that my update image is only 1.9gb.

No files in app dir /system_ext/overlay
No files in app dir /oem/overlay
No files in app dir /odm/overlay
No files in app dir /vendor/priv-app
No files in app dir /odm/priv-app
No files in app dir /odm/app
No files in app dir /oem/app

Failed to mark default storage /data/data/com.android.sdksandbox: No such file or directory

No input device configuration file found for device 'rk805 pwrkey'.
No input device configuration file found for device 'gsensor'.
No input device configuration file found for device 'adc-keys'.
No input device configuration file found for device 'rockchip,dp0 rockchip,dp0'.
No input device configuration file found for device 'rockchip-hdmi0 rockchip-hdmi0'.
No input device configuration file found for device 'khadas_pogo_pin'.

Could not read additional policy file '/vendor/etc/seccomp_policy/rockit.vendor.ext.policy

WebView seems to be failign with

Specified package "android" under uid 1037 but it is not

@Blah_Blah Sorry, I successfully downloaded and compiled the firmware today and verified the same phenomenon as you. I will resolve this issue and inform you as soon as possible.

Thanks for all the help, ill continue on with my launcher till you return, good luck!

@Blah_Blah Through comparison, it was found that one less warehouse was uploaded, resulting in the inability to enter the system. Please execute the following command.

$ repo sync external/libgps