【问题标题】:Unable to rename mipmap/icon to ic_launcher?无法将 mipmap/icon 重命名为 ic_launcher?
【发布时间】:2023-04-07 20:10:01
【问题描述】:

当我尝试在第 2 行的authenticator.xml 中将@mipmap/icon 重命名为@mipmap/ic_launcer 时。当我构建我的应用程序时,任何程序都会变回来。

    * What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  C:\ES.eWarrant\eWarrant\platforms\android\app\src\main\res\xml\authenticator.xml:2: AAPT: error: resource mipmap/icon (aka io.ionic.starter:mipmap/icon) not found.

这是我在构建 ionic 应用程序时遇到的错误。

离子信息:

Ionic:

   ionic (Ionic CLI)  : 4.12.0 (C:\Users\ES property\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.4
   @ionic/app-scripts : 3.2.3

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 8.0.0, browser 5.0.4, ios 5.0.0, windows 4.4.2
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 18 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Users\ES-Property\AppData\Local\Android\sdk)
   NodeJS            : v8.12.0 (C:\Program Files\nodejs\node.exe)
   npm               : 3.10.10
   OS                : Windows 10

【问题讨论】:

  • 此文件在您的资源文件夹中可用吗?
  • 如果你的意思是资源/ic_launcher.png 是的。
  • @PeroPeric 请检查mipmap/icon 文件,有吗?
  • 当我将 android 版本恢复到 7.1.1 时,我得到:无法解析配置“:CordovaLib:classpath”的所有文件。 > 找不到 intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.0.1)。在以下位置搜索:jcenter.bintray.com/com/android/tools/external/com-intellij/…
  • 这里的问题和答案可能会引起混淆。请列出资源中的所有文件,这是最好的方法。当你提到 @mipmap/ic_launcher 时,你需要 mipmap 或 mipmap-### 目录中的文件 ic_launcher.png。

标签: android ionic-framework


【解决方案1】:

我所做的是复制 /platforms/android/app/app/src/main/res 上的文件夹 mipmap-whathever 之一,将名称更改为 mipmap,将 ic_launcher.png 更改为 icon.png

【讨论】:

    猜你喜欢
    • 2015-08-17
    • 2022-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多