Instant Run is disabled for non-debug variants

解决InstantRun禁用问题
本文介绍了在使用JRebelforAndroid插件时遇到InstantRun被禁用的问题及解决方案。通常情况下,此问题是由于应用处于release版本而非debug版本导致。文章提供了修改build.gradle文件以启用debug模式的方法。

报错:

Instant Run is disabled for non-debug variants

解决办法:

我是在用JRebel for Android插件时出现了上面的提示,原因是编译版本是release版本,因此不能使用。需要在Build Variants中换成debug版本。

网上提供的解决办法如下(添加内容到build.gradle文件中):

buildTypes {
    release {
    //  TODO:打包发版时关闭
        debuggable true
}
yum repolist all Repository extras is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Repository PowerTools is listed more than once in the configuration Repository AppStream is listed more than once in the configuration repo id repo name status AppStream CentOS-8 - AppStream - repo.huaweicloud.com enabled BaseOS CentOS-8 - Base - repo.huaweicloud.com enabled PowerTools CentOS-8 - PowerTools - repo.huaweicloud.com enabled appstream CentOS Linux 8 - AppStream disabled appstream-source CentOS Linux 8 - AppStream - Source disabled base CentOS-8.5.2111 - Base - mirrors.aliyun.com enabled baseos CentOS Linux 8 - BaseOS disabled baseos-source CentOS Linux 8 - BaseOS - Source disabled centosplus CentOS-8 - Plus - repo.huaweicloud.com disabled cr CentOS Linux 8 - ContinuousRelease disabled debuginfo CentOS Linux 8 - Debuginfo disabled devel CentOS Linux 8 - Devel WARNING! FOR BUILDROOT USE ONLY! disabled epel Extra Packages for Enterprise Linux 8 - x86_64 enabled epel-debuginfo Extra Packages for Enterprise Linux 8 - x86_64 - Debug disabled epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 - RETIRED disabled epel-modular-debuginfo Extra Packages for Enterprise Linux Modular 8 - x86_64 - Debug - RETIRED disabled epel-modular-source Extra Packages for Enterprise Linux Modular 8 - x86_64 - Source - RETIRED disabled epel-source Extra Packages for Enterprise Linux 8 - x86_64 - Source disabled epel-testing Extra Packages for Enterprise Linux 8 - Testing - x86_64 disabled epel-testing-debuginfo Extra Packages for Enterprise Linux 8 - Testing - x86_64 - Debug disabled epel-testing-modular Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - RETIRED disabled epel-testing-modular-debuginfo Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - Debug - RETIRED disabled epel-testing-modular-source Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - Source - RETIRED disabled epel-testing-source Extra Packages for Enterprise Linux 8 - Testing - x86_64 - Source disabled extras CentOS-8 - Extras - repo.huaweicloud.com enabled extras-source CentOS Linux 8 - Extras - Source disabled fasttrack CentOS Linux 8 - FastTrack disabled ha CentOS Linux 8 - HighAvailability disabled media-appstream CentOS Linux 8 - Media - AppStream disabled media-baseos CentOS Linux 8 - Media - BaseOS disabled plus CentOS Linux 8 - Plus disabled plus-source CentOS Linux 8 - Plus - Source disabled powertools CentOS Linux 8 - PowerTools disabled powertools-source CentOS Linux 8 - PowerTools - Source disabled
最新发布
06-11
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

猎羽

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值