From a62c3e3db236ddf68e7ee4fb8b5d92bd7ea272d7 Mon Sep 17 00:00:00 2001 From: Pete Date: Thu, 15 Feb 2024 13:28:44 +0000 Subject: [PATCH] fix build signing for Android 14 --- src/init.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/init.sh b/src/init.sh index fb6e014..dae4142 100755 --- a/src/init.sh +++ b/src/init.sh @@ -59,6 +59,22 @@ if [ "$SIGN_BUILDS" = true ]; then fi done fi + + # Android 14 requires to set a BUILD file for bazel to avoid errors: + cat > $"KEYS_DIR"/BUILD << _EOB +# adding an empty BUILD file fixes the A14 build error: +# "ERROR: no such package 'keys': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package." +# adding the filegroup "android_certificate_directory" fixes the A14 build error: +# "no such target '//keys:android_certificate_directory': target 'android_certificate_directory' not declared in package 'keys'" +filegroup( +name = "android_certificate_directory", +srcs = glob([ + "*.pk8", + "*.pem", +]), +visibility = ["//visibility:public"], +) +_EOB for c in cyngn{-priv,}-app testkey; do for e in pk8 x509.pem; do