Adb not working due to lack of on raspberry

On my raspberry PI400 adb is not working due to a lack of link to

adb: error while loading shared libraries: cannot open shared object file: No such file or directory

And really:

ldd /usr/bin/adb                                                                                                                                                           127 ✘ (0x0000ffff97206000) => not found => /usr/lib/ (0x0000ffff96e90000) => /usr/lib/ (0x0000ffff96e70000) => /usr/lib/ (0x0000ffff96dc0000) => /usr/lib/ (0x0000ffff96d90000) => /usr/lib/ (0x0000ffff96d60000) => /usr/lib/ (0x0000ffff96d30000) => /usr/lib/ (0x0000ffff96c70000) => /usr/lib/ (0x0000ffff96a20000) => /usr/lib/ (0x0000ffff969f0000) => /usr/lib/ (0x0000ffff96840000)
	/lib/ => /usr/lib/ (0x0000ffff971cd000) => /usr/lib/ (0x0000ffff96800000) => /usr/lib/ (0x0000ffff96750000) => /usr/lib/ (0x0000ffff966f0000) => /usr/lib/ (0x0000ffff966d0000)

I have libprotobuf installed

protobuf                           [Installati] 3.20.1-2                  extra 
    Protocol Buffers - Google's data interchange format

Do we need to recompile the package android-tools?

Yes. But we inherit android-tools from Arch Linux ARM. They just haven’t rebuilt/updated it yet.

And the bug is also on the correspondent forum Arch Linux ARM • View topic - [android-tools] is outdated but without any response.


I was the OP in the archlinuxarm post. I haven’t gotten a response in weeks.
I tried finding the PKGBUILD for android-tools for the arm version but couldn’t find it.
I tried using the PKGBUILD from x86_64 and it failed to build on my Pi.

So I’m stuck there too. Hopefully they fix the issue soon.

I can confirm your report.

I modified the PKGBUILD file in the line arch=(aarch64), gave the command makepkg --clean–syncdeps but the compilation fails with this message

-- Build files have been written to: /home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/build
==> Entro nell'ambiente fakeroot...
==> Avvio di package() in corso...
ninja: Entering directory `build'
[9/226] Building C object vendor/boringssl/crypto/CMakeFiles/crypto.dir/bytestring/cbs.c.o
FAILED: vendor/boringssl/crypto/CMakeFiles/crypto.dir/bytestring/cbs.c.o 
/usr/bin/cc -DBORINGSSL_HAVE_LIBUNWIND -DBORINGSSL_IMPLEMENTATION -I/home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/vendor/boringssl/third_party/googletest/include -I/home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/vendor/boringssl/crypto/../include -march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -ggdb -Wall -fvisibility=hidden -fno-common -Wno-free-nonheap-object -Wimplicit-fallthrough -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes -Wshadow -std=c11 -D_XOPEN_SOURCE=700 -O3 -DNDEBUG -MD -MT vendor/boringssl/crypto/CMakeFiles/crypto.dir/bytestring/cbs.c.o -MF vendor/boringssl/crypto/CMakeFiles/crypto.dir/bytestring/cbs.c.o.d -o vendor/boringssl/crypto/CMakeFiles/crypto.dir/bytestring/cbs.c.o -c /home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/vendor/boringssl/crypto/bytestring/cbs.c
/home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/vendor/boringssl/crypto/bytestring/cbs.c: In function ‘CBS_get_asn1_int64’:
/home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/vendor/boringssl/crypto/bytestring/cbs.c:483:16: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
  483 |     u.bytes[i] = data[len - i - 1];
      |     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/vendor/boringssl/crypto/bytestring/cbs.c:480:5: note: at offset 8 into destination object ‘u’ of size 8
  480 |   } u;
      |     ^
cc1: all warnings being treated as errors
[12/226] Building CXX object vendor/CMakeFiles/libadb.dir/adb/pairing_connection/pairing_connection.cpp.o
/home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/vendor/adb/pairing_connection/pairing_connection.cpp: In static member function ‘static PairingAuthPtr PairingConnectionCtx::CreatePairingAuthPtr(PairingConnectionCtx::Role, const Data&)’:
/home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/vendor/adb/pairing_connection/pairing_connection.cpp:448:1: warning: control reaches end of non-void function [-Wreturn-type]
  448 | }
      | ^
[13/226] Building CXX object vendor/CMakeFiles/libadb.dir/adb/client/auth.cpp.o
/home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/vendor/adb/client/auth.cpp: In function ‘bool load_keys(const string&, bool)’:
/home/leandro/lavoro/android-tools/trunk/src/android-tools-31.0.3p1/vendor/adb/client/auth.cpp:178:49: warning: ignoring attributes on template argument ‘int (*)(DIR*)’ [-Wignored-attributes]
  178 |         std::unique_ptr<DIR, decltype(&closedir)> dir(opendir(path.c_str()), closedir);
      |                                                 ^
[14/226] Building CXX object vendor/CMakeFiles/adb.dir/adb/transport.cpp.o
ninja: build stopped: subcommand failed.
==> ERRORE: Si è verificato un errore in package().
    L'operazione sta per essere interrotta...

As I temporary measure you could either downgrade protobuf (edit: if nothing else depends on it ofc (as mentioned by @Strit)) or use LD_PRELOAD=/path/to/ adb
ArchlinuxARM archived package where you can get and the rest from:

Be aware that downgrading a ibraries like protobuf, will likely result in lots of other stuff not working.

just a hint: you also need ` in same directory as it is the actual file, the other one is just a symlink.

I know, hence I said:

Agreed, could wrote it a bit clearer. :stuck_out_tongue: