cordova -v): 9.0.0 ([email protected])cordova platform ls): android 8.0.0I get failure when I try to release the apk for publishing, I get the following error:
Compile without errors in cordova 9.0
I get failure for mipmap/icon not found.
It's happening because on latest cordova versions the icon isn't compiled anymore for mipmap/icon.png but for mipmap/ic_launcher.png.
`
Task :app:processReleaseResources FAILED
23 actionable tasks: 1 executed, 22 up-to-date
Android resource linking failed
C:\Projetos\utrack-app\platforms\android\appsrc\main\res\xml\authenticator.xml:2: AAPT: error: resource mipmap/icon (aka br.com.grupounicad.utrackv2:mipmap/icon) not found.
error: failed linking file resources.`
It is same with me. Did you find any solution?
Yes, you have to remove the plugin from cordova and then add it again using the variables to set it manually.
Remove your platforms (e.g: android):
ionic cordova platform rm android
Remove the plugin manually:
ionic cordova plugin rm cordova-plugin-mauron85-background-geolocation
Reinstall the plugin using it's variables
ionic cordova plugin add cordova-plugin-mauron85-background-geolocation@alpha \
--variable GOOGLE_PLAY_SERVICES_VERSION=11+ \
--variable ANDROID_SUPPORT_LIBRARY_VERSION=26+ \
--variable ALWAYS_USAGE_DESCRIPTION="App requires access to your location" \
--variable MOTION_USAGE_DESCRIPTION="App requires access to motion detection" \
--variable ICON="@mipmap/ic_launcher" \
--variable SMALL_ICON="@mipmap/ic_launcher"
And then add your platform again:
ionic cordova platform add android
ionic cordova prepare android
ionic cordova run android
I'm having too many issues related to this plugin unfortunately, I hope the author can make it work without problems for Ionic 4.
I'm getting the same problem.
@Makepool just use the command as I said above and it will be fixed.
I'm closing this issue, anyone who wants to fix the problem with ionic 4 just read my comment above.
@n0minal Hi, I reopen this issue because your fix is just insanely time consuming.
For the app to work you need to change what is causing the problem (aka the mimap ressource)
So as you wrote it :
--variable ICON="@mipmap/ic_launcher" \
--variable SMALL_ICON="@mipmap/ic_launcher"
The file to change is in : projectRoot/platforms/android/android.json
Here find the line "res/xml/authenticator.xml"
now change the @mipmap/icon for @mipmap/ic_launcher there (needs 2 modifications only in the xml object line)
change :
"xml": "<account-authenticator android:accountType=\"@string/mauron85_bgloc_account_type\" android:icon=\"@mipmap/icon\" android:label=\"@string/app_name\" android:smallIcon=\"@mipmap/icon\" xmlns:android=\"http://schemas.android.com/apk/res/android\" />",
to :
"xml": "<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\" />",
It should work, also this should be fixed in the plugin directly.
@mightytyphoon thanks a lot
@Divyanshu30 my plugin version: "3.0.3" 锛孖t doesn't work for me. Can you write in more detail?
@mightytyphoon this worked for me as well! Thank you 馃檹馃徏
Most helpful comment
@n0minal Hi, I reopen this issue because your fix is just insanely time consuming.
For the app to work you need to change what is causing the problem (aka the mimap ressource)
So as you wrote it :
The file to change is in :
projectRoot/platforms/android/android.jsonHere find the line "res/xml/authenticator.xml"
now change the @mipmap/icon for @mipmap/ic_launcher there (needs 2 modifications only in the xml object line)
change :
to :
It should work, also this should be fixed in the plugin directly.