Skip to content

Android Build Needs To Be Updated - Doc And Termex #66562

@vindicatorr

Description

@vindicatorr

Description

The documentation and script for cross-compiling Android seems to be out of date.

Reproduction Steps

$ NDK_DIR="<path_to>/23.1.7779620/" \
__lldb_Dir="<path_to>/23.1.7779620/toolchains/llvm" \
PATH="<path_to>/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/python3/bin/python3.9:$PATH" \
./eng/common/cross/build-android-rootfs.sh arm64 31

Expected behavior

Build on Arch Linux

Actual behavior

Target API level: 31
Target architecture: arm64
NDK location: <path_to>/23.1.7779620/
Target Toolchain location: <path_to>/runtime/.tools/android-rootfs/android-ndk-r21
Download dependencies...
cp: cannot stat '<path_to>/runtime/.tools/android-rootfs/tmp/arm64//data/data/com.termux/files/usr/*': No such file or directory

Regression?

No response

Known Workarounds

No response

Configuration

x64
Arch Linux

Other information

cross/init-android-rootfs.sh

cross/build-android-rootfs.sh

__lldb_Dir="$__CrossDir/lldb"

Is this not part of ndk (23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/lldb)?
If this is the same kind of lldb, then I think it should just reference this if NDK_DIR is set.

for path in $(wget -qO- http://termux.net/dists/stable/main/binary-$__AndroidArch/Packages |\

https://termux.net/dists/stable/main/binary-aarch64/Packages results in {"code":"PAGE_NOT_FOUND","message":"Page not found"}
If the only packages that are needed are:

__AndroidPackages="libicu"
__AndroidPackages+=" libandroid-glob"
__AndroidPackages+=" liblzma"
__AndroidPackages+=" krb5"
__AndroidPackages+=" openssl"

... is there any reason why the sources can't be downloaded and just built along with the rest of it? What does Termex end up offering instead?

wget -qO- http://termux.net/$path | dpkg -x - "$__TmpDir"

With dpkg, I'm guessing the script isn't meant for Arch Linux users. It would be good to have a "check" at the start of the script to determine if it should even continue.

EDIT0:

__lldb_Dir="$__CrossDir/lldb"

I also commented out this line since I set the environment variable for it (IF it's supposed to work like that). I'm now going to go about manually doing the sysroot stuff, and then run the build.sh that the script shows at the bottom.

EDIT1:
https://github.com/termux/termux-packages/wiki/Package-Management
So maybe https://packages.termux.org/apt/termux-main/dists/stable/main/binary-aarch64/Packages now?

EDIT2:
I'm seeing

echo "By default, the NDK will be downloaded into the cross/android-rootfs/android-ndk-$__NDK_Version directory. If you already have an NDK installation,"

seem to counter with
__CrossDir="$__ScriptBaseDir/../../../.tools/android-rootfs"

cross vs .tools
In addition to

where it looks like it should be echo . //Note the space.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions