本文同步发于:https://www.cnblogs.com/yeshen-org/p/18350232
最近在编译一个老项目,项目中依赖了很多第三方库,用gradle编译要20-30分钟,而且内存开销很大。
公司配的15G内存的电脑,一次编译能用到14G。
编译的时候,ubuntu有概率会卡死(卡死的问题,网上的方法我尝试了一轮,但是没有用,物理重启电脑有效)。
此为背景。昨晚重启之后,我发现adb用不了了。报错如下:
adb devices
adb shell
error: protocol fault (couldn't read status): Connection reset by peer
adb start-server
adb: failed to check server version: protocol fault (couldn't read status): Connection reset by peer
https://forums.linuxmint.com/viewtopic.php?t=415486
mv ~/.android ~/Download
In Android Studio: Open File / Settings
Go to: Settings / Build, Execution, Deployment / Debugger
In Section "Android Debug Bridge (abd)":
Uncheck "Enable adb mDNS for wireless debugging"
Restart Android Studio.
restart the computer.
adb kill-server
adb server -a
adb nodaemon start-server
netstat -tuln | grep 5353
把占用5353端口的udp都给去掉.
export ADB_TRACE=all
wget http://dl-ssl.google.com/android/repository/platform-tools_r30.0.4-linux.zip
./adb start-server
netstat -tuln | grep 5037
把占用5037端口的tcp都给去掉.
adb D 08-09 09:08:44 64447 64447 adb_trace.cpp:187] Android Debug Bridge version 1.0.41
adb D 08-09 09:08:44 64447 64447 adb_trace.cpp:187] Version 30.0.4-6686687
adb D 08-09 09:08:44 64447 64447 adb_trace.cpp:187] Installed as /home/apk/platform-tools_r30.0.4-linux/platform-tools/adb
adb D 08-09 09:08:44 64447 64447 adb_trace.cpp:187]
adb D 08-09 09:08:44 64447 64447 adb_client.cpp:346] adb_connect: service: host:start-server
adb D 08-09 09:08:44 64447 64447 adb_client.cpp:155] _adb_connect: host:version
adb D 08-09 09:08:44 64447 64447 adb_io.cpp:107] writex: fd=3 len=16 30303063686f73743a76657273696f6e 000chost:version
adb D 08-09 09:08:44 64447 64447 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 08-09 09:08:44 64447 64447 adb_io.cpp:88] readx: fd=3 error 104: Connection reset by peer
https://forums.linuxmint.com/viewtopic.php?t=415486
发现更换电脑了之后,还是会这样。
adb devices
adb: failed to check server version: protocol fault (couldn't read status): Connection reset by peer
./gradlew assembleDebug
FAILURE: Build failed with an exception.
* What went wrong:
Unable to find a usable idle daemon. I have connected to 100 different daemons but I could not use any of them to run the build. BuildActionParameters were DefaultBuildActionParameters{, currentDir=/home/yisheng/ssd/netease/cloud-gaming-sdk/CloudGame, systemProperties size=54, envVariables size=67, logLevel=LIFECYCLE, useDaemon=true, continuous=false, injectedPluginClasspath=[]}.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
解决方法一:可以看看 /usr/bin/qzhddr
这个路径有没有软件,卸载下。
解决方法二:看下iptable,处理下iptable的配置(未验证)
解决方法三:找安全组同事处理下…