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.

AAPT: error: resource mipmap/icon (aka io.ionic.starter:mipmap/icon) not found.

See original GitHub issue

Im using this plugin on my app, but when I use it on a page, all the times throws this error.

Your Environment

Ionic info:

   Ionic CLI                     : 6.4.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.7
   @angular-devkit/build-angular : 0.901.0
   @angular-devkit/schematics    : 9.1.0
   @angular/cli                  : 9.1.0
   @ionic/angular-toolkit        : 2.2.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 11 other plugins)

Utility:

   cordova-res (update available: 0.11.0) : 0.9.0
   native-run (update available: 1.0.0)   : 0.3.0

System:

   Android SDK Tools : 26.1.1 (/root/Android/Sdk/)
   NodeJS            : v13.8.0 (/usr/local/bin/node)
   npm               : 6.13.6
   OS                : Linux 5.3

Cordova plugin list:```



cordova-android-support-gradle-release 3.0.1 "cordova-android-support-gradle-release"
cordova-plugin-advanced-http 2.4.1 "Advanced HTTP plugin"
cordova-plugin-background-geolocation 3.1.0 "CDVBackgroundGeolocation"
cordova-plugin-background-mode 0.7.3 "BackgroundMode"
cordova-plugin-ble-central 1.2.4 "BLE"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-geolocation 4.0.2 "Geolocation"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.3 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"

Steps to Reproduce

1.sudo ionic cordova run android 2. 3. 4.

Context

I want to use background geolocation to follow my movements durin a period of time

Debug logs

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  /home/absant/Escritorio/workspace/project2/platforms/android/app/src/main/res/xml/authenticator.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 to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s
[ERROR] An error occurred while running subprocess cordova.
        ```


Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:15

github_iconTop GitHub Comments

4reactions
lrcampos97commented, Jul 6, 2020

After hours trying to solve this problem, my DEFINITIVE solution that worked fine (without touch the files inside platforms), was:

1º - run cordova platform remove android

2º - Added this line in my config.xml inside the tag <platform name="android"> <resource-file src="resources/android/icon/drawable-xxxhdpi-icon.png" target="app/src/main/res/mipmap/icon.png" />

3º - Update the plugin settings inside config.xml

<plugin name="@mauron85/cordova-plugin-background-geolocation" spec="3.1.0">
   <variable name="GOOGLE_PLAY_SERVICES_VERSION" value="11+" />
   <variable name="ANDROID_SUPPORT_LIBRARY_VERSION" value="26+" />
   <variable name="ICON" value="@mipmap/icon" />
   <variable name="SMALL_ICON" value="@mipmap/icon" />
   <variable name="ALWAYS_USAGE_DESCRIPTION" value="App requires background tracking " />
   <variable name="MOTION_USAGE_DESCRIPTION" value="App requires motion detection" />
</plugin>

4º - Configure my package.json

// package.json
  {
    "cordova": {
      "plugins": {
      "@mauron85/cordova-plugin-background-geolocation": {
        "GOOGLE_PLAY_SERVICES_VERSION": "11+",
        "ANDROID_SUPPORT_LIBRARY_VERSION": "26+",
        "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"
      },
      },
    },
  }

5º - Last step run cordova platform add android

IONIC VERSION: 6.4.0 CORDOVA VERSION: 9.0.0 (cordova-lib@9.0.1) NODE VERSION: v10.16.0

2reactions
linhtranvucommented, Nov 2, 2020

Please update this as a fix, it is ridiculous that we cannot compile until manual fix this bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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