Android工作室无法在设备上安装应用

Android工作室无法在设备上安装应用

本文介绍了Android工作室无法在设备上安装应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台运行 Android 4.4.2
三星Galaxy S5 设备,它一直运行良好,直到几周后我才开始收到这个问题, Android Studio在按下运行并构建Gradle后无法安装应用程序



其他信息:我试图在emulatir上运行应用程序第一次工作,我做了一些改变后,我试图再次在模拟器上运行,但改变是应用的

这是gradle文件: strong>

  apply plugin:'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion23.0.2

defaultConfig {
applicationIdcom.incorp.anisvikernes.appex
minSdkVersion 19
targetSdkVersion 19
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile( 'proguard-android.txt'),'proguard-rules.pro'
}
}
}

依赖关系{
编译fileTree(dir:' libs',包括:['* .jar'])
testCompile'junit:junit:4.12'
compile'c​​om.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile'c​​om.android.support:support-v4:23.4.0'
compile'c​​om.android.support:cardview-v7:23.1 .0'
}

这是LogCat:

  03:49:45执行任务:[clean,:app:generateDebugSources,:app:generateDebugAndroidTestSources,:app:prepareDebugUnitTestDependencies,: app:mockableAndroidJar,:app:compileDebugSources,:app:compileDebugAndroidTestSources,:app:compileDebugUnitTestSources] 
03:51:04 Gradle在1m中完成18s 412ms
05:23:54执行任务:[:app :assembleDebug]
05:28:19 Gradle构建完成4m 25s 153ms
05:28:32同步过程中出错:一个e xisting连接被远程主机强制关闭
05:28:32会话'app':错误安装APK

这是错误

  08/20 05:28:26:Launch app 
$ adb push D:\projects\appex\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.incorp.anisvikernes.appex
java.io.IOException:现有连接被远程主机强制关闭
安装APK时出错


更新我的驱动程序
之后(Win键+ x - >设备管理器 - >进入我的设备并按下更新按钮)I 更换USB电缆用于将手机连接到我的电脑并立即开始工作


I have a Samsung Galaxy S5 device running Android 4.4.2it was working just fine until a few weeks a go I started getting this issue, Android Studio fail to install the app after I press run and build the gradle

Additional information : I tried to run the app on an emulatir the first time it work and after I did some changes I tried to run on the emulator again but the changes were noy applied

This is the gradle file :

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.incorp.anisvikernes.appex"
    minSdkVersion 19
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:cardview-v7:23.1.0'
}

This is the LogCat :

03:49:45 Executing tasks: [clean, :app:generateDebugSources,       :app:generateDebugAndroidTestSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]
03:51:04 Gradle build finished in 1m 18s 412ms
05:23:54 Executing tasks: [:app:assembleDebug]
05:28:19 Gradle build finished in 4m 25s 153ms
05:28:32 Error during Sync: An existing connection was forcibly closed by the remote host
05:28:32 Session 'app': Error Installing APK

This is the error

08/20 05:28:26: Launching app
$ adb push D:\projects\appex\app\build\outputs\apk\app-debug.apk   /data/local/tmp/com.incorp.anisvikernes.appex
java.io.IOException: An existing connection was forcibly closed by the remote host
Error while Installing APK
解决方案

I actually found a solution that fixed this problem, it will seem really odd and wierd but after updating my driver (Win key+x -> device manager -> going to my device and pressing update button) I changed the USB cable used to connect the phone to my PC and it worked immediately

这篇关于Android工作室无法在设备上安装应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 21:42