繁体   English   中英

将.apk上传到Google Play时出错:此文件无效:获取服务的“ Android名称”属性时出错:该属性不是字符串值

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

我正在将我的动态壁纸草稿.apk文件上传到Google Play,但出现此错误:

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

我已经在模拟器和真实设备中进行了测试,并且一切正常。

我也上传了apk文件签名。

一些在线资源告诉我,此问题是由于manifest.xml引起的,但是我仍然找不到该问题。

这是我的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>

任何想法或建议,表示赞赏!

谢谢,
宾邦

清单中的第一个服务是将android:name属性定义为"@string/app_name" 根据Android 文档 ,该名称必须是完全合格的类名称,例如清单中后面的服务定义。 我猜字符串“ app_name”不是完全合格的类名称。

在我的情况下,app_name字符串中为“ \\ n”。 错了

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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