nohajc / termux-adb

Run adb in Termux without root permissions!
MIT License
359 stars 36 forks source link

How to fix 'CANNOT LINK EXECUTABLE "termux-adb": cannot locate' #8

Closed BlueAction closed 9 months ago

BlueAction commented 1 year ago

Hello, how can I fix this error when starting termux-adb? Screenshot_20230227_020529

Full log: CANNOT LINK EXECUTABLE "termux-adb": cannot locate symbol "_ZN6google8protobuf8internal14ArenaStringPtr3SetERKNSt6__ndk112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEPNS0_5ArenaE" referenced by "/data/data/com.termux/files/usr/bin/termux-adb"...

nohajc commented 1 year ago

What's the version of Android? Do you use Termux from Google Play Store or F-Droid?

BlueAction commented 1 year ago

I use android 10, termux installed from F-droid

nohajc commented 1 year ago

Ok, I'll see if I can replicate the issue.

Do you have the libprotobuf package installed btw? Could be a broken dependency.

Also the output from ldd $(which termux-adb) could be helpful.

BlueAction commented 1 year ago

Okay, thank you for your interest in my question. This is the output of the ldd program ~ $ ldd $(which termux-adb) libprotobuf.so => /data/data/com.termux/files/usr/lib/libprotobuf.so libbrotlidec.so => /data/data/com.termux/files/usr/lib/libbrotlidec.so libbrotlienc.so => /data/data/com.termux/files/usr/lib/libbrotlienc.so liblz4.so => /data/data/com.termux/files/usr/lib/liblz4.so libusb-1.0.so => /data/data/com.termux/files/usr/lib/libusb-1.0.so libz.so.1 => /data/data/com.termux/files/usr/lib/libz.so.1 libzstd.so.1 => /data/data/com.termux/files/usr/lib/libzstd.so.1 libc++_shared.so => /data/data/com.termux/files/usr/lib/libc++_shared.so libm.so => /system/lib/libm.so libdl.so => /system/lib/libdl.so libc.so => /system/lib/libc.so libabsl_die_if_null.so => /data/data/com.termux/files/usr/lib/libabsl_die_if_null.so libabsl_statusor.so => /data/data/com.termux/files/usr/lib/libabsl_statusor.so libabsl_log_internal_check_op.so => /data/data/com.termux/files/usr/lib/libabsl_log_internal_check_op.so libabsl_log_internal_message.so => /data/data/com.termux/files/usr/lib/libabsl_log_internal_message.so libabsl_log_internal_nullguard.so => /data/data/com.termux/files/usr/lib/libabsl_log_internal_nullguard.so libabsl_hash.so => /data/data/com.termux/files/usr/lib/libabsl_hash.so libabsl_city.so => /data/data/com.termux/files/usr/lib/libabsl_city.so libabsl_raw_hash_set.so => /data/data/com.termux/files/usr/lib/libabsl_raw_hash_set.so libabsl_status.so => /data/data/com.termux/files/usr/lib/libabsl_status.so libabsl_cord.so => /data/data/com.termux/files/usr/lib/libabsl_cord.so libabsl_synchronization.so => /data/data/com.termux/files/usr/lib/libabsl_synchronization.so libabsl_time.so => /data/data/com.termux/files/usr/lib/libabsl_time.so libabsl_time_zone.so => /data/data/com.termux/files/usr/lib/libabsl_time_zone.so libabsl_str_format_internal.so => /data/data/com.termux/files/usr/lib/libabsl_str_format_internal.so libabsl_bad_variant_access.so => /data/data/com.termux/files/usr/lib/libabsl_bad_variant_access.so libabsl_strings.so => /data/data/com.termux/files/usr/lib/libabsl_strings.so libabsl_throw_delegate.so => /data/data/com.termux/files/usr/lib/libabsl_throw_delegate.so libabsl_int128.so => /data/data/com.termux/files/usr/lib/libabsl_int128.so libabsl_spinlock_wait.so => /data/data/com.termux/files/usr/lib/libabsl_spinlock_wait.so ld-android.so => /system/lib/ld-android.so libabsl_examine_stack.so => /data/data/com.termux/files/usr/lib/libabsl_examine_stack.so libabsl_log_internal_format.so => /data/data/com.termux/files/usr/lib/libabsl_log_internal_format.so libabsl_log_internal_proto.so => /data/data/com.termux/files/usr/lib/libabsl_log_internal_proto.so libabsl_strerror.so => /data/data/com.termux/files/usr/lib/libabsl_strerror.so libabsl_log_internal_log_sink_set.so => /data/data/com.termux/files/usr/lib/libabsl_log_internal_log_sink_set.so libabsl_log_internal_globals.so => /data/data/com.termux/files/usr/lib/libabsl_log_internal_globals.so libabsl_log_globals.so => /data/data/com.termux/files/usr/lib/libabsl_log_globals.so libabsl_base.so => /data/data/com.termux/files/usr/lib/libabsl_base.so libabsl_raw_logging_internal.so => /data/data/com.termux/files/usr/lib/libabsl_raw_logging_internal.so libabsl_stacktrace.so => /data/data/com.termux/files/usr/lib/libabsl_stacktrace.so libabsl_symbolize.so => /data/data/com.termux/files/usr/lib/libabsl_symbolize.so libabsl_strings_internal.so => /data/data/com.termux/files/usr/lib/libabsl_strings_internal.so libabsl_log_sink.so => /data/data/com.termux/files/usr/lib/libabsl_log_sink.so liblog.so => /system/lib/liblog.so libabsl_low_level_hash.so => /data/data/com.termux/files/usr/lib/libabsl_low_level_hash.so libabsl_malloc_internal.so => /data/data/com.termux/files/usr/lib/libabsl_malloc_internal.so libc++.so => /system/lib/libc++.so libabsl_cordz_info.so => /data/data/com.termux/files/usr/lib/libabsl_cordz_info.so libabsl_cord_internal.so => /data/data/com.termux/files/usr/lib/libabsl_cord_internal.so libabsl_crc_cord_state.so => /data/data/com.termux/files/usr/lib/libabsl_crc_cord_state.so libabsl_cordz_functions.so => /data/data/com.termux/files/usr/lib/libabsl_cordz_functions.so libabsl_cordz_handle.so => /data/data/com.termux/files/usr/lib/libabsl_cordz_handle.so libabsl_crc32c.so => /data/data/com.termux/files/usr/lib/libabsl_crc32c.so libabsl_crc_internal.so => /data/data/com.termux/files/usr/lib/libabsl_crc_internal.so libabsl_exponential_biased.so => /data/data/com.termux/files/usr/lib/libabsl_exponential_biased.so libbrotlicommon.so => /data/data/com.termux/files/usr/lib/libbrotlicommon.so As well as information about the installed libprotobuf

Screenshot_20230227_130014

nohajc commented 1 year ago

So, I ran pkg upgrade on my Termux installation and now it gives me the same linker error.

Looks like libprotobuf was upgraded and I need to recompile termux-adb against it. I'll get to it as soon as I can and release a new version.

ProjectRedis commented 1 year ago

Same error here, but for "termux-fasboot" command still working properly, only "termux-adb" give me an error Screenshot_20230228-013851_Termux

nohajc commented 1 year ago

Hi all, this issue should be fixed now. Just run pkg upgrade to install the latest revision.

BlueAction commented 1 year ago

Thanks to everyone who provided an answer to my question. Updating the main termux-adb repository, as well as updating packages (pkg update) gave a positive result. Now I can identify my device. Screenshot_20230228_004054 But another question seems to arise from this. When displaying termux-fastboot devices does not display the text encoding correctly is there any way to fix this?

nohajc commented 1 year ago

Can you open a separate issue and provide more details?

E.g. how the output of fastboot devices looks like if you list this particular device from a PC or a rooted phone. That would be helpful for reference.

BlueAction commented 1 year ago

Yeah, sure, I'll do that.

doncarlos999 commented 9 months ago

@nohajc, sorrry to revive an old issue but I think protobuf has updated again as I'm getting the following error:

➜  ~ pkg show protobuf
Package: protobuf
Version: 2:25.1
Maintainer: @termux
Installed-Size: 4100 kB
Depends: libprotobuf (= 2:25.1)
Homepage: https://github.com/protocolbuffers/protobuf
Download-Size: 909 kB
APT-Sources: https://grimler.se/termux/termux-main stable/main aarch64 Packages
Description: Compiler for protocol buffer definition files

➜  ~ termux-adb
CANNOT LINK EXECUTABLE "termux-adb": cannot locate symbol "_ZN6google8protobuf7Message19CopyWithSourceCheckERS1_RKS1_" referenced by "/data/data/com.termux/files/usr/bin/termux-adb"...

Thanks in advance if you can recompile termux-adb against the newer version. And thank you for writing a great piece of software.

nohajc commented 9 months ago

Thanks, I'll fix it.

nohajc commented 9 months ago

Thanks in advance if you can recompile termux-adb against the newer version. And thank you for writing a great piece of software.

I just published a new build. Can you verify it works for you?

offici5l commented 9 months ago

@nohajc Screenshot_20231226-182528_Termux.png

nohajc commented 9 months ago

Ok, I'll double check what's going on. Sorry for the trouble.

doncarlos999 commented 9 months ago

Same for me unfortunately:

~ pkg show termux-adb
Package: termux-adb
Version: 0.2.1-2
Maintainer: nohajc
Installed-Size: 6689 kB
Depends: brotli, libc++, liblz4, libprotobuf, libusb, termux-api, zlib, zstd
Homepage: https://github.com/nohajc/termux-adb
Download-Size: 1665 kB
APT-Manual-Installed: yes
APT-Sources: https://nohajc.github.io termux/extras aarch64 Packages
Description: Run adb and fastboot in Termux without root permissions

➜  ~ termux-adb
CANNOT LINK EXECUTABLE "termux-adb": cannot locate symbol "_ZN6google8protobuf11MessageLite15ParseFromStringENSt6__ndk117basic_string_viewIcNS2_11char_traitsIcEEEE" referenced by "/data/data/com.termux/files/usr/bin/termux-adb"...

Thanks for your continued support.

nohajc commented 9 months ago

It should work now. If you still have trouble with the latest version (0.2.1-3), you might need to do pkg remove termux-adb, apt clean and pkg install termux-adb.

offici5l commented 9 months ago

@nohajc thank you . It's working now

Screenshot_20231226-221807_Termux.png

doncarlos999 commented 9 months ago

Working for me too. Thanks a lot!

nohajc commented 9 months ago

Closing for now. I'll also think about improving the situation. Perhaps I could link protobuf statically to avoid this kind of unexpected breakage.