【问题标题】:error: uncompiled PNG file passed as argument. Must be compiled first into .flat file错误:未编译的 PNG 文件作为参数传递。必须先编译成 .flat 文件
【发布时间】:2018-10-09 03:45:20
【问题描述】:

在 react-native 中,我正在尝试按照他们的 instructions 生成签名的 APK。但是当我执行这个./gradlew assembleRelease 命令时,它会显示这个错误。 Error details.

我的平台:

  • 操作系统:Windows 10
  • 节点:8.9.1
  • npm: 5.5.1
  • 反应:16.3.2
  • 反应原生:0.55

谁能告诉我,为什么会出现这个错误?

我通过将android.enableAapt2=false 添加到android/gradle.properties 中得到了一个解决方案here 显然,我读到这只是一个临时解决方案。没有办法用其他解决方案解决?

【问题讨论】:

  • stackoverflow.com/questions/35283959/… 可能会有所帮助。
  • @Rishabh Bhatia,使用此链接我可以创建调试 APK,但是当我尝试创建发布 APK 时会发生同样的错误。
  • @loveNZ 是的。答案已经在我的问题详细信息中。正确阅读我的问题详情。
  • 这仍然是个问题! github 上没有上述问题,即使它们都已关闭.. 这令人难以置信,无法创建开箱即用的 apk。 ps:android.enableAapt2=false 不适合我
  • @atitpatel 目前的解决方案是将android.enableAapt2=false 添加到android/gradle.properties 中。我还没有找到其他解决方案。

标签: android reactjs react-native react-native-android


【解决方案1】:

org.gradle.configureondemand=true 添加到android/gradle.properties

【讨论】:

  • 我不推荐使用这个。因为 RN 文档说:Note: Make sure gradle.properties does not include org.gradle.configureondemand=true as that will make the release build skip bundling JS and assets into the APK.。 (facebook.github.io/react-native/docs/…)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-09-09
  • 2021-12-19
  • 2023-03-07
  • 2019-04-03
  • 2016-03-07
相关资源
最近更新 更多