Reputation: 1568
When I trying to:
RUN > Select Deployment target > Select my Real Android device.
I after build my device disconnect automatically and Device status [OFFLINE]
EVENT LOG HERE:
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
And also sometime I found event log like this in Android Studio 2.3:
2:27 PM IllegalStateException
Android Studio could not interpret the results of the Gradle build correctly.
You may be able to recover from this issue by pressing 'Run' or 'Debug' again.
Please file a bug at b.android.com including this message and your idea.log (Help | Show Log in ..).
Session 'app': Error Launching activity .
Already Tried.
Disable Instant Run feature from settings.
Perform a clean build and run again.
Terminal window = start and stop adb server using this command "adb kill-server" and "adb start-server".
Enable and Disable USB Debugging.
Note: If I restart my device and Windows PC then it works but I can't restart every time so any one have better solutions for 'app': Error Installing APKs issues.
Upvotes: 0
Views: 753
Reputation: 451
Please try with this - ADB Android Device Unauthorized.
This will work for you. if not then let me inform.
Upvotes: 0