OpenMandriva-specific(?) issue when building Android roms

Hi,

I semi-regularly compile two android roms, YAAP and LMODroid
I am thinking that my build environment is wrong on OpenMandriva, as I keep getting an issue that I have not gotten on openSUSE or Fedora.

FAILED: //frameworks/base/core/res:remote-color-resources-arsc generate remote_views_color_resources.arsc
Outputs: out/soong/.intermediates/frameworks/base/core/res/remote-color-resources-arsc/gen/res/raw/remote_views_color_resources.arsc
Error: exited with code: 1
Command: out/host/linux-x86/bin/sbox --sandbox-path out/soong/.temp --output-dir out/soong/.intermediates/frameworks/base/core/res/remote-color-resources-arsc/gen --manifest out/soong/.intermediates/frameworks/base/core/res/remote-color-resources-arsc/genrule.sbox.textproto
Output:
The failing command was run inside an sbox sandbox in temporary directory
out/soong/.temp/sbox/dfd5e2aa43132e1da12f85868104b741e7ae7bc4
The failing command line can be found in
out/soong/.temp/sbox/dfd5e2aa43132e1da12f85868104b741e7ae7bc4/sbox_command.0.bash
Info-ZIP UnZip 6.1c25-BETA (2018-12-20)
 Copyright (c) 1990-2018 Info-ZIP.  License: unzip --license
        THIS IS A BETA VERSION OF UNZIP -- NOT FOR GENERAL DISTRIBUTION.
Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
 Default action: Extract files in list, except those in xlist, to exdir;
 file[.zip] may be a wildcard.  -Z => ZipInfo mode ("unzip -Z" for usage).
Options (primary mode):
  -p  extract files to pipe, no messages     -l  list files (short format)
  -f  freshen existing files, create none    -t  test compressed archive data
  -u  update files, create if necessary      -z  display archive comment only
  -v  list verbosely/show version info       -T  timestamp archive to latest
Options (modifiers):
  -n  never overwrite existing files         -q  quiet mode (-qq => quieter)
  -o  overwrite files WITHOUT prompting      -a  auto-convert any text files
  -j[=N] junk paths (strip all/top-N dirs)   -aa treat ALL files as text
  -C  match filenames case-insensitively     -L  make (some) names lowercase
  -X | -k  restore UID/GID | permissions     -V  retain VMS version numbers
  -K  keep setuid/setgid/tacky permissions   -D- restore dir (-D: no) times
  -M  pipe through "more" pager
More help: unzip -hh   Examples:
  unzip data1 -x joe   # Extract all files except joe from archive data1.zip
  unzip -p foo | more  # Pipe contents of foo.zip into program "more"
  unzip -fo foo ReadMe # Replace quietly existing ReadMe if archive file newer
exit status 9

with the failing command being

mkdir -p out/soong/.temp/sbox/dfd5e2aa43132e1da12f85868104b741e7ae7bc4/out/remote-color-resources-arsc && unzip -x out/soong/.intermediates/frameworks/base/core/res/remote-color-resources-apk/gen/remote-color-resources.apk resources.arsc -d out/soong/.temp/sbox/dfd5e2aa43132e1da12f85868104b741e7ae7bc4/out/remote-color-resources-arsc && mkdir -p $(dirname out/soong/.temp/sbox/dfd5e2aa43132e1da12f85868104b741e7ae7bc4/out/res/raw/remote_views_color_resources.arsc) && mv out/soong/.temp/sbox/dfd5e2aa43132e1da12f85868104b741e7ae7bc4/out/remote-color-resources-arsc/resources.arsc out/soong/.temp/sbox/dfd5e2aa43132e1da12f85868104b741e7ae7bc4/out/res/raw/remote_views_color_resources.arsc && echo 'Created out/soong/.temp/sbox/dfd5e2aa43132e1da12f85868104b741e7ae7bc4/out/res/raw/remote_views_color_resources.arsc'

I tested whether it was because -x was being called first, and when i made a small script that moved -x foo to the end before running unzip, the error then became this:

FAILED: //frameworks/base/core/res:remote-color-resources-arsc generate remote_views_color_resources.arsc
Outputs: out/soong/.intermediates/frameworks/base/core/res/remote-color-resources-arsc/gen/res/raw/remote_views_color_resources.arsc
Error: exited with code: 1
Command: out/host/linux-x86/bin/sbox --sandbox-path out/soong/.temp --output-dir out/soong/.intermediates/frameworks/base/core/res/remote-color-resources-arsc/gen --manifest out/soong/.intermediates/frameworks/base/core/res/remote-color-resources-arsc/genrule.sbox.textproto
Output:
The failing command was run inside an sbox sandbox in temporary directory
out/soong/.temp/sbox/dfd5e2aa43132e1da12f85868104b741e7ae7bc4
The failing command line can be found in
out/soong/.temp/sbox/dfd5e2aa43132e1da12f85868104b741e7ae7bc4/sbox_command.0.bash
unzip:  cannot find/open "resources.arsc", "resources.arsc.zip", or "resources.arsc.ZIP".
exit status 9

I installed fedora on a separate drive and reran the build, with which it completed without errors. This makes me believe that it’s an error with my environment on OpenMandriva, and I’m truly stumped as to how I can fix this, if there’s anyone that ran into this or knows a solution I’d love to hear.

I am running ROME (23.08) on kernel 6.5.0-desktop-0.rc6.1omv2390.
Many thanks.
Collin

Hi,
this is because Android is really really picky about what version of unzip is being used.

It likes 6.0, but can’t handle 6.1 or the alternative implementation of unzip that comes with libarchive (which is a shame, that version is much better in many other ways).

I’ve run into this as well a couple of days back and modified our version of unzip to behave like 6.0.

Running dnf --refresh distro-sync unzip should fix this. (You may have to rm -rf out as well, the build process may not like having the old artifacts around).

1 Like

Thanks a million, the update fixed it!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.