Android 10 Build for RK3399

Hi. I am trying to build Android for RK3399 Board following this guide: https://docs.khadas.com/zh-cn/edge/BuildAndroid.html.

I am getting errors on every ./make.sh command run, about missing/duplicate includes in the source.

How do I get past this?

Thank you very much. Regards,

Lorenzo

Hello, and welcome to the community
can you make sure your dependencies have been installed correctly ?
you can ask @goenjoy for some guidance with RK3399 Android 10 builds

all the best !

1 Like

@Electr1 thank you! I will check the dependencies now on a fresh install of Ubuntu Server 18.04 and let you know ihow I get on tomorrow morning… :sweat_smile: I will keep you posted!
Best,

Lorenzo

1 Like

1,


2,
Make sure the code you pulled down is correct.

If there is no problem with the above two points, please post the complete compiled error log.

3 Likes

Hi @goenjoy,

Thank you very much for your prompt response. I have installed all libraries/dependencies as specified in Step 1 of your comment above. The only difference was that python-networkx was not available through aptitude package manager, so it had to be installed via pip.
When I try to init a repo on my server, I use command repo init -u https://github.com/khadas/android_manifest.git -b khadas-edge-Qt for Android 10.0 build as per the links on the official Khadas website.
However, now also that command is failing. I add below the stacktrace, in case you know of a quick fix to it. :slight_smile:

`~/WORKING_DIRECTORY$ repo init -u GIT_URL_ANDROID_10
warning: gpg (GnuPG) is not available.
warning: Installing it is strongly encouraged.

warning: templates not found /build/git-repo-publish/parts/git/install/usr/share/git-core/templates
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
remote: Finding sources: 100% (7/7)
remote: Total 7 (delta 0), reused 7 (delta 0)
Unpacking objects: 100% (7/7), done.
From h ttps://gerrit.googlesource.com/git-repo
89f3ae5…65f51ad master -> origin/master
Traceback (most recent call last):
File “/home/aosp/WORKING_DIRECTORY/.repo/repo/main.py”, line 49, in
import event_log
File “/home/aosp/WORKING_DIRECTORY/.repo/repo/event_log.py”, line 167, in
_EVENT_ID = multiprocessing.Value(‘i’, 1)
File “/snap/git-repo/18/usr/lib/python2.7/multiprocessing/init.py”, line 253, in Value
return Value(typecode_or_type, *args, **kwds)
File “/snap/git-repo/18/usr/lib/python2.7/multiprocessing/sharedctypes.py”, line 108, in Value
lock = RLock()
File “/snap/git-repo/18/usr/lib/python2.7/multiprocessing/init.py”, line 183, in RLock
return RLock()
File “/snap/git-repo/18/usr/lib/python2.7/multiprocessing/synchronize.py”, line 172, in init
SemLock.init(self, RECURSIVE_MUTEX, 1, 1)
File “/snap/git-repo/18/usr/lib/python2.7/multiprocessing/synchronize.py”, line 75, in init
sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 13] Permission denied
`

Is this happening on a root account in linux ???

https://mega.nz/file/qihkgQAS#es8dtqDgEwsxuYW-pNSzDsBoATy4XvJUZLuphJsmjDk
Maybe there is something wrong with the configuration of your repo. Try using the repo here.

xxx/repo/repo init -u https://github.com/khadas/android_manifest.git -b khadas-edge-Qt

Yes, also on root account. Same stack trace too. I believe it is a python issue with Python3 vs 2.7…

Thanks @goenjoy. I will try it in a few hours and let you know!

Maybe, code made in python 2.7 and 3.x have a lot of confusion, It is a real pain to deal with if you don’t take a look at the code itself, the difference is highly substantial…

@lorenz
You can never compile Android with a root account.
If you did that, you have to start over.
All the files will have wrong permissions and it will cause all sorts of problems.

You must also make sure you are using the right Java, OpenJDK 8.

2 Likes

@goenjoy Hi. I have tried with the version you provided above on a fresh install of Ubuntu 16.04 64-bit Desktop. I am still facing the same issue with the exact same stacktrace being output. :frowning_face:
At this point, I am really unsure as to what it could be that is causing the issue, apart from perhaps a change in git-repo codebase…

hlm@Server:/users/hlm$ ls -ld /usr/local/lib/python2.7
drwxrwsr-x 4 root staff 4096 Jul 24 06:02 /usr/local/lib/python2.7

image
Check it out. Is it the same as this? If it is not the same, it will be changed into the same.

Hi @goenjoy. Thank you very much for your help. Using another machine seems to have solved the issue (at least for the cloning).
I have been able to clone both the Android 10.0 repo and the Android 9.0 repo from the khadas github using repo. Now taking a snapshot of the drive so at least I can use it as a fallback solution in case things start going screwy again. I will try to build off what I cloned today when at home later on.
Keep you updated,
Regards.

@goenjoy having some issues still with the build.

Managed to make Uboot and kernel fine, but failing at the make -jN part of the android build. I managed to successfully select build target and all.

Build output below:

[1/1] out/soong/.minibootstrap/minibp out/soong/.bootstrap/build.ninja
[55/56] glob prebuilts/ndk/cpufeatures.bp
[80/80] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
SurfaceFlinger want to conditional Compile
librga want to conditional Compile
libstagefright want to conditional Compile
TARGET_PRODUCT: rk3399
out/build-rk3399-cleanspec.ninja is missing, regenerating…
out/build-rk3399.ninja is missing, regenerating…
[4/1049] including bootable/recovery/Android.mk …
bootable/recovery/Android.mk:104: warning: *** Redirect log to UART
[379/1049] including hardware/rockchip/hwcomposer/Android.mk …
fatal: not a git repository (or any parent up to mount point /media/aosp)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[380/1049] including hardware/rockchip/libgralloc/Android.mk …
fatal: not a git repository (or any parent up to mount point /media/aosp)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[400/1049] including hardware/rockchip/omx_il/Android.mk …
fatal: not a git repository (or any parent up to mount point /media/aosp)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
cp: cannot create regular file ‘.git/hooks/pre-commit’: No such file or directory
tools/hooks .git/hooks
[581/1049] including system/sepolicy/Android.mk …
system/sepolicy/Android.mk:79: warning: BOARD_SEPOLICY_VERS not specified, assuming current platform version
[1049/1049] including vendor/rockchip/root/SuperSU/Android.mk …
build/make/core/aapt2.mk:33: warning: overriding commands for target out/target/common/obj/APPS/Bluetooth_intermediates/flat-res/device/rockchip/common/overlay/packages/apps/Bluetooth/res/values_config.arsc.flat' build/make/core/aapt2.mk:33: warning: ignoring old commands for target out/target/common/obj/APPS/Bluetooth_intermediates/flat-res/device/rockchip/common/overlay/packages/apps/Bluetooth/res/values_config.arsc.flat’
build/make/core/Makefile:28: warning: overriding commands for target out/target/product/rk3399/vendor/lib/libjpeghwenc.so'build/make/core/base_rules.mk:412: warning: ignoring old commands for target out/target/product/rk3399/vendor/lib/libjpeghwenc.so’
build/make/core/Makefile:28: warning: overriding commands for target out/target/product/rk3399/vendor/lib/libjpeghwdec.so'build/make/core/base_rules.mk:412: warning: ignoring old commands for target out/target/product/rk3399/vendor/lib/libjpeghwdec.so’
build/make/core/Makefile:28: warning: overriding commands for target out/target/product/rk3399/vendor/lib64/libjpeghwenc.so' build/make/core/base_rules.mk:412: warning: ignoring old commands for target out/target/product/rk3399/vendor/lib64/libjpeghwenc.so’
build/make/core/Makefile:28: warning: overriding commands for target out/target/product/rk3399/vendor/lib64/libreference-ril.so' build/make/core/base_rules.mk:412: warning: ignoring old commands for target out/target/product/rk3399/vendor/lib64/libreference-ril.so’
build/make/core/Makefile:28: warning: overriding commands for target out/target/product/rk3399/vendor/lib/libreference-ril.so' build/make/core/base_rules.mk:412: warning: ignoring old commands for target out/target/product/rk3399/vendor/lib/libreference-ril.so’
[ 99% 1399/1400] glob tools/tradefederation/core/atest/**/*.py
ninja: error: ‘commit_id.xml’, needed by ‘out/target/product/rk3399/vendor/commit_id.xml’, missing and no known rule to make it
12:36:59 ninja failed with: exit status 1

failed to build some targets (04:58 (mm:ss))

@lorenz
Then use this patch
diff --git a/device/rockchip/common/prebuild.mk b/device/rockchip/common/prebuild.mk
index 28391f63859…af623641b10 100644
— a/device/rockchip/common/prebuild.mk
+++ b/device/rockchip/common/prebuild.mk
@@ -2,5 +2,10 @@
$(warning Generating manifest snapshot at $(OUT_DIR)/commit_id.xml…)
$(warning You can disable this by removing this and setting BOARD_RECORD_COMMIT_ID := false in BoardConfig.mk)
$(shell test -d .repo && .repo/repo/repo manifest -r -o $(OUT_DIR)/commit_id.xml)
+
+ifeq (,$(wildcard commit_id.xml))
+BOARD_RECORD_COMMIT_ID := false
+endif
+
-include $(TARGET_DEVICE_DIR)/prebuild.mk

3 Likes

Sorry, we went on a tour last week. Has this compilation problem been solved according to the solution provided by @mo123?

Will the compiler report this error after you compile the Android 10.0 code?

If I remember, yes.
It’s best to add the patch.
In previous SDK’s, another method I used after making changes to the SDK was to copy the commit_id.xml file from the manifest folder to the root of the SDK and just make it read-only so it couldn’t be overwritten to 0 size.