gpt4 book ai didi

android-studio - Android Studio Instant Run 总是重启应用程序

转载 作者:行者123 更新时间:2023-12-01 21:57:27 24 4
gpt4 key购买 nike

在Android Studio中,“即时运行”功能“应用更改”enter image description here始终重新启动应用程序,即使代码没有更改(Android Studio 2.3.0 - MacOS 10.12.3)。当应用程序处于调试状态并在断点处暂停时会发生这种情况,如果我尝试应用更改应用程序重新启动 enter image description here

这是我的 build.gradle:

apply plugin: 'com.android.application'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
allprojects {
repositories {
mavenCentral()
}
}


android {
compileSdkVersion 23
buildToolsVersion '25.0.2'
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig {
minSdkVersion 17
targetSdkVersion 23
multiDexEnabled true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}



sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src/main/java']
resources.srcDirs = ['src/main/java']
aidl.srcDirs = ['src/main/java']
renderscript.srcDirs = ['src/main/java']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

// Move the tests to tests/java, tests/res, etc...
//instrumentTest.setRoot('tests')
}
}

最佳答案

调试器中始终禁用即时运行:

On Android Studio 2.3, if you deploy your app by clicking Debug , pushing subsequent code changes by clicking Apply Changes always results in a cold swap. To learn more, go to issue #234401.

来自https://developer.android.com/studio/run/index.html#instant-run

除此之外,您的配置似乎选中了所有复选框。

关于android-studio - Android Studio Instant Run 总是重启应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42666008/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com