【问题标题】:FAILED Building Apk in React Native在 React Native 中构建 Apk 失败
【发布时间】:2021-01-18 04:43:45
【问题描述】:

当我尝试使用 ./gradlew bundleRelease 构建 apk 文件时出现此错误

FAILURE:构建失败并出现异常。

  • 出了什么问题:任务“:app:bundleReleaseResources”执行失败。

执行 com.android.build.gradle.internal.tasks.Workers$ActionFacade 时发生故障 Android资源链接失败 C:\Users\Yoan\React Native\new\app\android\app\build\intermediates\bundle_manifest\release\processReleaseManifest\bundle-manifest\AndroidManifest.xml:13: AAPT:错误:资源 mipmap/ic_launcher(又名 com.hotelmaids:mipmap/ic_launcher) 未找到。

 C:\Users\Yoan\React Native\new\app\android\app\build\intermediates\bundle_manifest\release\processReleaseManifest\bundle-manifest\AndroidManifest.xml:13:

AAPT:错误:资源 mipmap/ic_launcher_round(又名 com.hotelmaids:mipmap/ic_launcher_round) 未找到。

我删除了这些文件夹。我在某个地方发现人们和控制台说它们是重复的,我还有另一个错误

【问题讨论】:

    标签: react-native visual-studio-code react-native-android


    【解决方案1】:

    在构建 APK 之前运行此命令:

    react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res --verbose

    然后删除 raw + drawable-.. 文件夹。

    不要删除 mipmap 文件夹!

    【讨论】:

      猜你喜欢
      • 2023-01-11
      • 2018-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-08
      • 2019-03-21
      • 2019-06-06
      相关资源
      最近更新 更多