我能够在 [email protected] 中构建 apk ,但是当我想做ionic add platform <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9bfaf5ffe9f4f2ffdbafb5afb5a9" rel="noreferrer noopener nofollow">[email protected]</a>
时并运行ionic build android
控制台输出
C:\Users\ ...\platforms\android\build\intermediates\res\armv7\debug\xml\authenticator.xml:2: error: Error: No resource found that matches the given name (at 'icon' with value '@mipmap/icon').
C:\Users\ ...\platforms\android\build\intermediates\res\armv7\debug\xml\authenticator.xml:2: error: Error: No resource found that matches the given name (at 'smallIcon' with value '@mipmap/icon').
不知道如何修复它,并且谷歌搜索/搜索 stackoverflow 对我没有帮助......
最佳答案
这是由于 AndroidManifest.xml 中的名称差异而导致的错误 解决这个问题
- 转到 Android
- 点击应用
- 点击源代码
- 点击主界面
- 点击资源
- 打开 AndroidManifest.xml
- 将 android:icon="@mipmap/ic_launcher"> 编辑为图标的 png 文件名 例如: 如果你的图标文件名为potato.png, 您将编辑 android 图标 android:icon="@mipmap/potato">
- 转到"file"并单击“全部保存”
- 再次运行应用
关于android - ionic2 构建 apk @mipmap/icon 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43976311/