当我尝试运行>选择部署目标>选择我的真实Android设备。
我自己建立设备后自动断开连接并且设备状态为[OFFLINE]
活动记录在这里。
int values = 0;
while(values >= 0)
{
...
}
而且有时我在android studio 2.3中发现了这样的事件日志
2:40 PM Executing tasks: [:app:assembleDebug]
2:41 PM Gradle build finished with 1 warnings(s) in 7s 577ms
2:41 PM An existing connection was forcibly closed by the remote host
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:471)
at com.android.ddmlib.SplitApkInstaller.uploadApk(SplitApkInstaller.java:152)
at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:78)
at com.android.ddmlib.Device.installPackages(Device.java:904)
at com.android.tools.idea.run.tasks.SplitApkDeployTask$SplitApkInstaller.installApp(SplitApkDeployTask.java:117)
at com.android.tools.idea.run.RetryingInstaller.install(RetryingInstaller.java:86)
at com.android.tools.idea.run.tasks.SplitApkDeployTask.perform(... (show balloon)
2:41 PM Session 'app': Error Installing APKs
已经尝试过。
从设置中禁用“即时运行”功能。
执行干净的构建并再次运行。
终端窗口=使用此命令启动和停止adb服务器" adb kill-server"和" adb start-server"。
启用和禁用USB调试。
注意:如果我重新启动设备和Windows PC,那么它可以正常运行,但每次都无法重新启动,因此任何人都有更好的解决方案来应对':错误安装APK问题。