在 React Native 中构建 Apk 失败

FAILED Building Apk in React Native

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

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:bundleReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed C:\Users\Yoan\React Native\new\app\android\app\build\intermediates\bundle_manifest\release\processReleaseManifest\bundle-manifest\AndroidManifest.xml:13: AAPT: error: resource mipmap/ic_launcher (aka com.hotelmaids:mipmap/ic_launcher) not found.

 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) 未找到。

我删除了那些文件夹。我发现有人和控制台说他们重复了,我又遇到了另一个错误

运行 在您的 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 文件夹!