question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

https://build.phonegap.com given build error "app/src/main/res/xml/authenticator.xml:2: AAPT: error: resource mipmap/icon ( myAppId:mipmap/icon) not found"

See original GitHub issue

Hi,

I have use only one plugin that is “mauron85/cordova-plugin-background-geolocation” when buid it given error is “app/src/main/res/xml/authenticator.xml:2: AAPT: error: resource mipmap/icon (aka myAppId:mipmap/icon) not found”.

I have working on latest version phonegap thiat is <preference name="phonegap-version" value="cli-9.0.0" />

and plugins are : <plugin name="cordova-plugin-whitelist" spec="1.3.3" /> <plugin name="cordova-plugin-statusbar" spec="2.4.2" /> <plugin name="cordova-plugin-device" spec="2.0.2" /> <plugin name="cordova-plugin-splashscreen" spec="5.0.2" /> <plugin name="cordova-plugin-ionic-webview" spec="^4.0.0" /> <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" /> <plugin name="@mauron85/cordova-plugin-background-geolocation"/> <engine name="android" spec="^8.1.0" />

how can I solve this issue please help me.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
lydongraycommented, Mar 5, 2020

For others that stumble on this error, here is some more info on what I was doing wrong in my Ionic/Angular project. When adding the cordova-plugin-background-geolocation plugin to my project, a file called authenticator.xml in /platforms/android/app/src/main/res/xml/ is updated to include a <account-authenticator> node. This node has a number of properties based on the <cordova-plugin-background-geolocation> plugin configuration in config.xml. Making changes to the config.xml will not be reflected in authenticator.xml unless you remove and re-add the plugin (see https://www.npmjs.com/package/@mauron85/cordova-plugin-background-geolocation).

Note: The configuration needs to be defined in config.xml before you add the plugin. Removing the plugin will remove the configuration in config.xml.

In my case, my icons were named ic_launcher.png (not icon.png), so in my config.xml file I had to configure the icon settings accordingly.

  1. Remove the plugin > cordova plugin remove cordova-plugin-background-geolocation
  2. Update configuration in config.xml
<plugin name="cordova-plugin-background-geolocation" spec="@mauron85/cordova-plugin-background-geolocation@^3.1.0">
  <variable name="GOOGLE_PLAY_SERVICES_VERSION" value="11+" />
  <variable name="ANDROID_SUPPORT_LIBRARY_VERSION" value="26+" />
  <variable name="ICON" value="@mipmap/ic_launcher" />
  <variable name="SMALL_ICON" value="@mipmap/ic_launcher" />
  <variable name="ACCOUNT_NAME" value="@string/app_name" />
  <variable name="ACCOUNT_LABEL" value="@string/app_name" />
  <variable name="ACCOUNT_TYPE" value="$PACKAGE_NAME.account" />
  <variable name="CONTENT_AUTHORITY" value="$PACKAGE_NAME" />
  <variable name="ALWAYS_USAGE_DESCRIPTION" value="App requires background tracking " />
  <variable name="MOTION_USAGE_DESCRIPTION" value="App requires motion detection" />
</plugin>
  1. Re-add the plugin > ionic cordova plugin add cordova-plugin-background-geolocation

I guess as an alternative, you could modify the authenticator.xml file or manually add icon.png to your resources but I see these more as a hack than a robust solution.

0reactions
stale[bot]commented, Sep 11, 2020

This issue has been automatically closed, because it has not had recent activity. If you believe this issue shouldn’t be closed, please reopen or write down a comment requesting issue reopening with explanation why you think it’s important. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
xml :2: AAPT: error: resource mipmap/icon (aka io.ionic.starter:mipmap/icon) not found. error: failed linking file resources. * Try: Run with --stacktrace option ...
Read more >
ionic2 build apk @mipmap/icon error - android - Stack Overflow
xml :2: error: Error: No resource found that matches the given name (at 'smallIcon' with value '@mipmap/icon'). no idea how to fix it...
Read more >
AAPT error resource mipmap ic_launcher_foreground (aka ...
ERROR :E: app\src\main\res\mipmap-anydpi-v26\ic_launcher. xml :4: AAPT : error : resource mipmap/ic_launcher_foreground (aka com.Mandi.
Read more >
Create app icons with Image Asset Studio - Android Developers
Android Studio includes a tool called Image Asset Studio that helps you generate your own app icons from material icons, custom images, ...
Read more >
Problem with mipmap icon - MSDN - Microsoft
But when I compile the solution I get the error: Error: No resource found that matches the given name (at 'icon' with value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found