reactjs - React Native - Failed to execute aapt
问题描述
I have just configured React Native FCM, when I try to start the packager:
npm install && gradlew clean
I get the following error:
enter code here
E:\projects\deets-mobile-sp\android\app\build\intermediates\res\merged\debug\values-zh-rCN\values-zh-rCN.xml:73: AAPT: warning: string 'instabug_str_empty' marked untranslatable but exists in locale 'zh-CN'
E:\projects\deets-mobile-sp\android\app\build\intermediates\res\merged\debug\values-zh-rCN\values-zh-rCN.xml:87: AAPT: warning: string 'instabug_str_plus' marked untranslatable but exists in locale 'zh-CN'
E:\projects\deets-mobile-sp\android\app\build\intermediates\res\merged\debug\values-zh-rCN\values-zh-rCN.xml:88: AAPT: warning: string 'instabug_str_powered_by_instabug' marked untranslatable but exists in locale 'zh-CN'
E:\projects\deets-mobile-sp\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:120:31-47: AAPT: No resource found that matches the given name (at 'resource' with value '@mipmap/ic_notif').
E:\projects\deets-mobile-sp\android\app\build\intermediates\res\merged\debug\values-zh-rCN\values-zh-rCN.xml:73: warning: string 'instabug_str_empty' marked untranslatable but exists in locale 'zh-CN'
E:\projects\deets-mobile-sp\android\app\build\intermediates\res\merged\debug\values-zh-rCN\values-zh-rCN.xml:87: warning: string 'instabug_str_plus' marked untranslatable but exists in locale 'zh-CN'
E:\projects\deets-mobile-sp\android\app\build\intermediates\res\merged\debug\values-zh-rCN\values-zh-rCN.xml:88: warning: string 'instabug_str_powered_by_instabug' marked untranslatable but exists in locale 'zh-CN'
warning: string 'instabug_str_record_audio' has no default translation.
E:\projects\deets-mobile-sp\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:118: error: Error: No resource found that matches the given name (at 'resource' with value '@mipmap/ic_notif').
:app:processDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4 mins 17.331 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
解决方案
如我所见,它正在尝试查找名称为ic_notif的资源
Error: No resource found that matches the given name (at 'resource' with value '@mipmap/ic_notif').
尝试以下修复。
- 转到所有四个android/app/src/main/res/mipmap - (hdpi/mdpi/xhdpi/xxhdpi),
- 复制ic_launcher并将其重命名为ic_notif。
或者您可以从示例项目中获取这些 png 图像文件
希望这对您有所帮助。
推荐阅读
- c - 生成“确定性”浮点运算的标志。指针与“快速数学”对齐?
- python - 有效地遍历字符串列表以获得成对 WMD 距离矩阵
- angular - API调用期间不重新加载页面看不到数据
- python - 将带有值的比较运算符传递给函数
- python - 禁止 save() 以防止由于未保存的相关对象 'xxxxxxxx' 而导致数据丢失
- intellij-idea - 如何在 IntelliJ 中自定义创建单元测试?
- angular - 更新子状态(例如重置表单)
- c# - Entity Framework Core 从 xsd 文件创建代码优先库
- php - PHP:如何在数组中获取时间差
- javascript - 不能用jquery清空div