Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authenticator.xml resource mipmap/icon not found #678

Closed
shomid opened this issue Feb 20, 2019 · 13 comments
Closed

authenticator.xml resource mipmap/icon not found #678

shomid opened this issue Feb 20, 2019 · 13 comments

Comments

@shomid
Copy link

shomid commented Feb 20, 2019

I updated cordova-android of 7.1.4 to 8.0.0 in ionic project.
in browser work correctly with ionic serve
but when build with ionic cordova android build throws the following error.

 authenticator.xml:2: AAPT: error: resource mipmap/icon not found

how to fix this problem ?

@janpio
Copy link
Member

janpio commented Feb 20, 2019

Please don't delete the issue template, but fill it with all information required to understand your problem: https://github.com/apache/cordova-android/issues/new?template=BUG_REPORT.md

@baversjo
Copy link

Found this in a google search, just wanted to mention I got the exact same problem after an upgrade from 7.1.4 to 8.0.0 in my cordova project.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  /Users/johan/projects/smrt-system/cordova/platforms/android/app/src/main/res/xml/authenticator.xml:2: AAPT: error: resource mipmap/icon (aka com.smrtsystems.mobile:mipmap/icon) not found.

  error: failed linking file resources.

Unsure if it's a bug or what, will investigate..

@baversjo
Copy link

baversjo commented Feb 27, 2019

@shomid I think this is not a problem with cordova itself, but rather the background-geolocation plugin:

            "cordova-plugin-mauron85-background-geolocation": {
                "ANDROID_SUPPORT_LIBRARY_VERSION": "23+",
                "GOOGLE_PLAY_SERVICES_VERSION": "+",
                "ICON": "@mipmap/icon",
                "SMALL_ICON": "@mipmap/icon",
                "ACCOUNT_NAME": "@string/app_name",
                "ACCOUNT_LABEL": "@string/app_name",
                "ACCOUNT_TYPE": "$PACKAGE_NAME.account",
                "CONTENT_AUTHORITY": "$PACKAGE_NAME",
                "ALWAYS_USAGE_DESCRIPTION": "This app always requires location tracking",
                "MOTION_USAGE_DESCRIPTION": "This app requires motion detection"
            }

mauron85/cordova-plugin-background-geolocation#553

So, I think you should close this issue and discuss in this one instead ^

@Maykelmattar
Copy link

It's ridiculous just create under platforms\android\app\src\main\res a file with mipmap as a name and put inside it your icon as icon.png run it and enjoy your day!

@RogerBrad
Copy link

Thank you so much - I found your solution after hours and hours of struggling.

Just as correction>
Create a directory : platforms\android\app\src\main\res\mipmap.
Then copy resources\splash.png to icon.png in the new mipmap directory.

Thanks again !!!

@ZumelzuR
Copy link

Is not a good practice to touch the files inside platforms> (edit or create stuff there), so I recommend to change the ICON variable and keep it like
<plugin name="@mauron85/cordova-plugin-background-geolocation" spec="3.0.3"> ... <variable name="ICON" value="@mipmap/ic_launcher" /> ... </plugin>

This route "mipmap/ic_launcher" will work. BTW now package is @mauron85/cordova-plugin-background-geolocation, the other one is deprecated

@RiyadKhalifeh
Copy link

Thank you so much - I found your solution after hours and hours of struggling.

Just as correction>
Create a directory : platforms\android\app\src\main\res\mipmap.
Then copy resources\splash.png to icon.png in the new mipmap directory.

Thanks again !!!

Thanks, save my day!!

@sandy912
Copy link

Thank you so much - I found your solution after hours and hours of struggling.

Just as correction>
Create a directory : platforms\android\app\src\main\res\mipmap.
Then copy resources\splash.png to icon.png in the new mipmap directory.

Thanks again !!!

Thank you!!

@alhassimdiallo
Copy link

Thank you so much - I found your solution after hours and hours of struggling.

Just as correction>
Create a directory : platforms\android\app\src\main\res\mipmap.
Then copy resources\splash.png to icon.png in the new mipmap directory.

Thanks again !!!

Thank you very much !

@breautek
Copy link
Contributor

Closing as the issue doesn't appear to be actually related to cordova-android but with a third-party plugin.

Solutions are posted above.

@rohitksingh
Copy link

rohitksingh commented Oct 1, 2021

I changed the name to ic_launcher and it worked.

<account-authenticator
    android:accountType="@string/mauron85_bgloc_account_type"
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name"
    android:smallIcon="@mipmap/ic_launcher"
    xmlns:android="http://schemas.android.com/apk/res/android" />

@TelmoFerreira
Copy link

Add this to config.xml
<resource-file src="resources/icon.png" target="app/src/main/res/mipmap/icon.png" />

@scipioni
Copy link

Add this to config.xml <resource-file src="resources/icon.png" target="app/src/main/res/mipmap/icon.png" />

yes, it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests