Gradle build error
I'm trying to build something with gradle. When building, I get this error:
> A problem occurred starting process 'command '/data/data/com.termux/files/home/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.21.8/3b3111d68b7ef4392cfbbea33a48a95dc7a1f4d7/protoc-3.21.8-linux-aarch_64.exe'
When trying to run the file manually, I get this error:
bash: /data/data/com.termux/files/home/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.21.8/3b3111d68b7ef4392cfbbea33a48a95dc7a1f4d7/protoc-3.21.8-linux-aarch_64.exe: cannot execute: required file not found
What do I need to do to fix this?13 Replies
It appears to be an issue with Termux, since the runs fine from an Ubuntu
proot
environment.it's not an issue so much as a major difference between termux-on-android and a real Linux distro. looks like you have a precompiled
protoc
that assumes a linker path that isn't valid here. (proot does fake this out, so that makes sense)
what are you trying to build?I was attempting to build Ghidra. Everything before this built successfully.
Is there a way to fake this out without entering an Ubuntu
proot
environment? Is it possible to change the linker path?maybe you can replace the protoc binary with either a separately-obtained protoc that's compiled for termux or with a wrapper that invokes the dynamic loader directly on the one you have
looks like termux ships proto2 and you need proto3 - if so, it won't be as simple as installing it from repos
How can I use a wrapper?
I am suggesting writing a one-line shell script
Alright. I've never written a wrapper, so I'll look into it. Thanks.
Running the program using
/system/bin/linker64
, I get an error this error:
"protoc-3.21.8-linux-aarch_64.exe" has unexpected e_type: 2
I tried using LD_PRELOAD=/system/bin/linker64 /data/data/com.termux/files/home/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.21.8/3b3111d68b7ef4392cfbbea33a48a95dc7a1f4d7/protoc-3.21.8-linux-aarch_64.exe
which still gave me the same error I originally had.yeah, that's not what LD_PRELOAD does
don't immediately know beyond this point, sorry
Maybe something like this will work?
proot() {
printf >&2 "\e[1;97m%s\n%s\n\e[0m" "Running in PROOT:" "$1"
proot-distro login ubuntu -- bash -c "$1"
}
no reason why not. give it a try. :)
Here is my script so far:
#!/data/data/com.termux/files/usr/bin/sh
proot() {
printf >&2 "\e[1;97m%s\n%s\n\e[0m" "Running in PROOT:" "$1"
proot-distro login ubuntu -- bash -c "$1"
}
proot "/data/data/com.termux/files/home/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.21.8/3b3111d68b7ef4392cfbbea33a48a95dc7a1f4d7/protoc-3.21.8-linux-aarch_64.exe $@"
I'm about to test it now.
It didn't work because the script would be ran multiple times, causing it to try to run proot-distro
from within Ubuntu, causing it to throw an error about running proot-distro
as root user.
I'll try to find the source code for this protoc version.
Would it be possible to use Termux's protoc
instead?^
Failed to build.
Here's the error I get when building
protobuf
:
ld.lld: error: undefined symbol: __android_log_write
>>> referenced by common.cc:146 (google/protobuf/stubs/common.cc:146)