Android - Failed to run aapt dump badging: 'android:icon' attribute: attribute value reference does not exist

风流意气都作罢 提交于 2021-01-28 14:15:30

问题


I have been trying to upload my APK to Play Store, but it keeps showing me this error:

Failed to run aapt dump badging: AndroidManifest.xml:31: error: ERROR getting 'android:icon' attribute: attribute value reference does not exist

It is a very simple app, here is the Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="mx.com.hearwego.mexicocityaudioguideapp">

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        >
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_maps_key" />

        <activity
            android:name=".MapsActivity"
            android:label="@string/title_activity_maps" />
        <activity
            android:name=".PoiDetailActivity"
            android:label="@string/title_activity_poi_detail"
            android:theme="@style/AppTheme.NoActionBar" />
    </application>

</manifest>

And here is the @mipmap/ic_launcher:

<?xml version="1.0" encoding="utf-8"?>
    <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
        <background android:drawable="@drawable/ic_launcher_background"/>
        <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
    </adaptive-icon>

When I run the app, it works fine, I still can see the icon perfectly. Also when I sign the APK, the APK works fine too. The problem is while uploading to Play Store.

Can someone please help me solve this issue?


回答1:


I haved the same exact message in one app, and the problem was that some string was added to the non-default strings.xml in the app, I solved by just simply adding that resource to all the strings.xml in my app.

I assume that maybe this problem apply to all kind of resources that depends on localization/language.



来源:https://stackoverflow.com/questions/51814228/android-failed-to-run-aapt-dump-badging-androidicon-attribute-attribute-v

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!