Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR getting 'name' attribute: attribute is not a string value

Uploading my apk file to google play makes this error:

Your APK cannot be analyzed using aapt. Error output: Failed to run aapt dump badging: ERROR getting 'name' attribute: attribute is not a string value

Since I know that this problem is within my manifest file, I have put it here:

AndroidManifext.xml:

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

    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

    <permission
        android:name="ir.altontech.newsimpay.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="ir.altontech.newsimpay.permission.C2D_MESSAGE" />

    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />

    <application xmlns:tools="http://schemas.android.com/tools"
        android:name="ir.altontech.newsimpay.Classes.Model.AnalyticsApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="false"
        android:theme="@style/AppTheme"
        tools:replace="android:supportsRtl">

        <receiver
            android:name="com.adjust.sdk.AdjustReferrerReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

        <receiver android:name=".Receivers.SmsListener">
            <intent-filter android:priority="1000">
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            </intent-filter>
        </receiver>

        <receiver
            android:name="com.google.android.gms.analytics.AnalyticsReceiver"
            android:enabled="true">
            <intent-filter>
                <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.google.android.gms.analytics.AnalyticsService"
            android:enabled="true"
            android:exported="false" />

        <activity
            android:name="ir.altontech.newsimpay.Activities.Introduction"
            android:screenOrientation="portrait" />
        <activity
            android:name="ir.altontech.newsimpay.Activities.Main"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:taskAffinity="ir.altontech.simpay"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="adjustPan"/>

        <activity
            android:name=".Activities.SpecificPage"
            android:screenOrientation="portrait">
            <intent-filter>
                <data
                    android:host="ir.altontech.simpay.specific"
                    android:scheme="simpay" />
                <data
                    android:host="ad.simpay.ir"
                    android:scheme="http" />

                <action android:name="android.intent.action.VIEW" />

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

        <activity
            android:name=".Activities.SplashActivity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:taskAffinity="ir.altontech.simpay"
            android:theme="@style/AppTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <activity
            android:name=".Activities.FastCharge"
            android:launchMode="singleInstance"
            android:screenOrientation="portrait"
            android:taskAffinity="ir.altontech.simpay"
            android:theme="@style/fast_charge_theme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
        </activity>

        <activity android:name="ir.altontech.newsimpay.Activities.BarcodeScanner" />
        <activity
            android:name="ir.altontech.newsimpay.Activities.FinalTrainTicket"
            android:screenOrientation="landscape" />
        <activity
            android:name="ir.altontech.newsimpay.Activities.VideoPlayer"
            android:screenOrientation="landscape"
            android:taskAffinity="ir.altontech.simpay" />
        <activity android:name="ir.altontech.newsimpay.Activities.CallBack">
            <intent-filter>
                <data
                    android:host="ir.altontech.simpay.callback"
                    android:scheme="simpay" />

                <action android:name="android.intent.action.VIEW" />

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

        <service
            android:name=".Classes.Services.GCMService"
            android:exported="false" />

        <receiver
            android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.google.android.gms.analytics.CampaignTrackingService"
            android:enabled="true"
            android:exported="false" />

        <!-- services -->

        <!-- registration process service -->
        <service
            android:name="ir.altontech.cloudmessaging.core.registrationprocess.RegistrationProcessService"
            android:exported="false">
            <intent-filter>
                <action android:name="co.shariftech.pushnotification.intent.action.START_PUSH_NOTIFICATION_SERVICE" />
            </intent-filter>
        </service>

        <!-- registration process token refresher service -->
        <service
            android:name="ir.altontech.cloudmessaging.core.registrationprocess.RegistrationProcessTokenRefresherService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.android.gms.iid.InstanceID" />
            </intent-filter>
        </service>

        <!-- push notification service -->
        <service
            android:name="ir.altontech.cloudmessaging.core.pushnotification.PushNotificationService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </service>

        <!-- receivers -->

        <!-- google cloud messaging receiver -->
        <receiver
            android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="ir.altontech.newsimpay" />
            </intent-filter>
        </receiver>

    </application>

</manifest>

I have checked all android:name attributes and couldn't find the problem. Thank you all.

like image 983
A. Badakhshan Avatar asked Mar 26 '17 05:03

A. Badakhshan


2 Answers

so after searching a little I have found three options for you to do:

1- if you have something as follows (which I see you don't ):

<intent-filter>
    <action android:name="@string/alarm_auto_sync" >
</intent-filter>

you should hard code the string and remove @string

2- follow this bug to see what could and have been done to solve this issue as I found out this might be the bug of

aapt dump badging

3- if you have values-fa and values-en and other string values as such you should copy your android:name to values.

for more information on these options visit this question or this question

hope this helps

like image 138
Pouya Danesh Avatar answered Oct 25 '22 13:10

Pouya Danesh


You can go for below suggested link. I hope it helps you.

aapt ERROR getting 'android:name' attribute: attribute is not a string value

Thank you

like image 35
Sejal Baraiya Avatar answered Oct 25 '22 13:10

Sejal Baraiya