在Android Studio 3.2.1 中,当我更改代码中的某些内容并尝试在我的设备(手机)上运行它时,我收到以下消息:编译失败;有关详细信息,请参阅编译器错误输出。当我查看构建部分时,我可以阅读以下内容:如果我再次尝试运行代码,而不进行任何修改,应用程序将启动并且不会通知任何错误。可能是什么问题呢?编辑这是我的build.gradle代码:apply plugin: 'com.android.application'android { compileSdkVersion 27 defaultConfig { applicationId "***" minSdkVersion 19 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }}dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:27.1.1' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'}
3 回答

慕工程0101907
TA贡献1887条经验 获得超5个赞
立即运行并尝试。文件 > 设置 > 构建、执行、部署 > 即时运行 > 取消选中。
或者
我认为,应用程序>编辑配置>即时应用程序配置缺少您的 Gradle-aware。因此,通过应用程序> 编辑配置> 即时应用程序配置并点击 + 图标并添加 Gradle-aware 来添加它。以及 File > Settings > Build,Execution,Deployment > Instant Run > Un-check 。
添加回答
举报
0/150
提交
取消