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
clippbsy
clippbsyOP2y ago
It appears to be an issue with Termux, since the runs fine from an Ubuntu proot environment.
ted
ted2y ago
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?
clippbsy
clippbsyOP2y ago
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?
ted
ted2y ago
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
clippbsy
clippbsyOP2y ago
How can I use a wrapper?
ted
ted2y ago
I am suggesting writing a one-line shell script
clippbsy
clippbsyOP2y ago
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.
ted
ted2y ago
yeah, that's not what LD_PRELOAD does don't immediately know beyond this point, sorry
clippbsy
clippbsyOP2y ago
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" }
ted
ted2y ago
no reason why not. give it a try. :)
clippbsy
clippbsyOP2y ago
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?
ted
ted2y ago
^
clippbsy
clippbsyOP2y ago
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)

Did you find this page helpful?