Android A problem was found with the configuration of task ':app:packageRelease'

﹏ヽ暗。殇╰゛Y 2022-06-12 03:25 200阅读 0赞

打包提示这个错误。Error:A problem was found with the configuration of task ‘:app:packageRelease’. 想了一下才发现是添加了一个属性.

  1. Error:A problem was found with the configuration of task ':app:packageDebug'.
  2. > File 'E:\AndroidStudio\work\AUWoQu\YingYongShiChang\app\build\intermediates\res\resources-debug-stripped.ap_' specified for property 'resourceFile' does not exist.
  3. gradle里面添加了这个属性。shrinkResources true.打包的时候会去删除一些不必要 的文件,结果就打包失败了。
  4. 现在先将这个功能注释掉了,还没有想到好的方法。
  5. buildTypes {
  6. release {
  7. minifyEnabled true
  8. shrinkResources false
  9. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  10. }
  11. debug {
  12. //开启代码混淆
  13. minifyEnabled false
  14. // 移除无用的resource文件
  15. shrinkResources false
  16. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  17. }
  18. }

发表评论

表情:
评论列表 (有 0 条评论,200人围观)

还没有评论,来说两句吧...

相关阅读