File xxx specified for property 'resourceFile' does not exist.解决方法

今天刚更新了Android Studio 2.2,重新编译项目时就出现了以下问题:

Error:A problem was found with the configuration of task ':app:packageDebug'.
> File xxx specified for property 'resourceFile' does not exist.
  
  
  • 1
  • 2
  • 1
  • 2

在Stack Overflow查了下,有人说是开启了Instant Run,关闭即可;又有人说是设置了shrinkResources,只需将其设为false。试了下,只需要将shrinkResources改为false即可,开启Instant Run也不会报错,但依旧第一次运行时白屏…(TㅅT)

buildTypes {
    debug {
        //Zipalign优化
        zipAlignEnabled true
        // 移除无用的resource文件
        shrinkResources false
        //混淆
        minifyEnabled false
        //加载默认混淆配置文件
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    release {
        //Zipalign优化
        zipAlignEnabled true
        // 移除无用的resource文件
        shrinkResources true
        //混淆
        minifyEnabled true
        //加载默认混淆配置文件
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
  
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
The "The specified JRE installation does not exist" exception typically occurs when there is a mismatch between the Java Runtime Environment (JRE) configuration in your project and the actual JRE installation on your system. Here are a few possible reasons and solutions for this issue: 1. Incorrect JRE configuration in Eclipse: - Open the project properties in Eclipse by right-clicking on the project and selecting "Properties". - Go to "Java Build Path" and check the "Libraries" tab. - Ensure that the correct JRE is selected. If not, click on "Add Library" and select the appropriate JRE. - Clean and rebuild your project. 2. Incorrect JRE configuration in Tomcat: - Open the Tomcat server configuration in Eclipse by double-clicking on the server in the "Servers" view. - Go to the "Java" tab and check the "JRE" section. - Ensure that the correct JRE is selected. If not, click on "Installed JREs" and add the appropriate JRE. - Restart the Tomcat server. 3. Multiple JRE installations: - Check if you have multiple JRE installations on your system. - Make sure that the JRE you are using for your project is the same as the one you have installed and configured in Eclipse and Tomcat. 4. Environment variables: - Check if the JAVA_HOME environment variable is set correctly. - Ensure that the PATH environment variable includes the bin directory of the JRE installation. 5. Reinstalling JRE: - If none of the above solutions work, try reinstalling the JRE and make sure to configure it correctly in Eclipse and Tomcat.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值