【问题标题】:I can't build expo app (:app:mergeReleaseResources)我无法构建 expo 应用程序 (:app:mergeReleaseResources)
【发布时间】:2021-12-20 13:56:44
【问题描述】:

我昨天构建了 expo 应用程序。 但是我今天无法构建 expo 应用程序(另一个应用程序)。 我根本不更新。 我搜索谷歌,但无法得到任何答案 exp 构建:android

这是世博会应用构建日志

FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseResources'.
[stderr] > java.util.concur rent.ExecutionException: 
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource 
compilation failed
[stderr]   /app/turtle/workingdir/android/sdk33/android-shell-
app/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: error: failed to read PNG 
signature: file does not start with PNG signature.
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info
 or --debug option to get more log output. Run with --scan to get full 
insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 43s

`

【问题讨论】:

  • 您的文件/app/turtle/workingdir/android/sdk33/android-shell- app/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: error: failed to read PNG signature: file does not start with PNG signature. 似乎已损坏。可以用图片编辑器打开吗?尝试用新版本替换它。也尝试构建 -> 重建
  • 找不到文件的方向
  • @Euro 检查 yourproject/android/app/src/main/res/mipmap-xxhdpi
  • 我的项目文件夹中没有android文件夹,但我搜索minmap-xxhdpi文件夹(projectfolder/node_modules/react-native/template/android/app/src/main/res/mipmap-xxhdpi),所以我替换它,但它不起作用
  • 我通过将资产更改为默认值来解决这个问题,但我不明白为什么它无法读取我的图标和启动画面

标签: react-native expo


【解决方案1】:

我也遇到了这个问题,我通过使用“expo-cli build:android -t apk”而不是“exp build:android”解决了这个问题。这构建了没有任何错误的apk,并且所有图像都完美呈现。 确保您已安装 expo-cli。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-09
    • 2018-11-19
    • 1970-01-01
    • 1970-01-01
    • 2017-08-10
    • 2018-10-24
    相关资源
    最近更新 更多