【发布时间】:2016-12-27 07:02:32
【问题描述】:
我有一台运行 Android 4.4.2 的 Samsung Galaxy S5 设备 它工作得很好,直到几周前我开始遇到这个问题,Android Studio 在我按下运行并构建 gradle 后无法安装应用程序
其他信息:我第一次尝试在模拟器上运行该应用程序,在我做了一些更改后,我尝试再次在模拟器上运行,但没有应用更改
这是 gradle 文件:
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'
}
这是 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
这是错误
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
【问题讨论】:
-
重建、清理和重新运行
-
缓存重启无效。
-
VVB 这不是一个永久的解决方案,它并不总是有效,@Sohail Zahid 请问我该怎么做呢??
-
位于项目设置下方。
-
@SohailZahid 不幸的是,缓存无效并没有解决我的问题
标签: android android-studio gradle build ioexception