简体   繁体   中英

Error when uploading .apk to google play : this file is invalid: error getting 'android name' attribute for service: attribute is not a string value

I'm uploading my draft live wallpaper .apk file to google play but I got this error:

this file is invalid: error getting 'android name' attribute for service: attribute is not a string value

I have tested in my emulator + real device and everything works fine.

I signed the apk file before uploading also.

Some of the online resources told me that this problem occurs because of the manifest.xml, but I still cant find the problem..

Here is my manifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.test.wallpaper"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" />
    <uses-feature android:name="android.software.live_wallpaper" />


    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >



            <activity android:name="com.test.wallpaper.SplashActivity"
            android:label="@string/app_name" android:configChanges="keyboardHidden"
            android:windowSoftInputMode="adjustPan" android:launchMode="singleTop"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

      <service
            android:permission="android.permission.BIND_WALLPAPER"
            android:name    = "@string/app_name"
            android:label   = "@string/app_name"
            android:icon    = "@drawable/icon"
        >

            <intent-filter>
                <action android:name="android.service.wallpaper.WallpaperService" />
            </intent-filter>

            <meta-data android:name="android.service.wallpaper" android:resource="@xml/wallpaper"/>

        </service>

        <activity
            android:label       = "Settings"
            android:name        = "Settings"
            android:theme       = "@android:style/Theme.Black"
            android:exported    = "true">
        </activity>
         <activity
            android:name        = "GalleryPreference"
            android:label       = "GalleryPreference"
            android:theme       = "@android:style/Theme.Black"
            android:exported    = "true"
        />

        <activity
            android:name        = "GalleryActivity"
            android:label       = "GalleryActivity"
            android:exported    = "true"
        />

        <service android:name = "com.test.wallpaper.AdapterService" android:enabled="true" android:exported="true"/>
    </application>


</manifest>

Any thoughts ideas or suggestions are appreciated!

Thanks,
Binbon

The first service in your manifest is defining the android:name attribute to be "@string/app_name" . According to the Android docs , this must be a fully qualified class name, like the service definition further down in the manifest. I'm guessing the string "app_name" is not a fully qualified class name.

in my case it was "\\n" in the app_name string. That was wrong.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM