畸形的Andr​​oid清单违反条款 [英] Malformed android manifest violating terms

查看:149
本文介绍了畸形的Andr​​oid清单违反条款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从谷歌Play中的电子邮件,通知我说,我们已经确定了您的应用程序有一个畸形的Andr​​oidManifest.xml文件这可能使用户难以卸载的应用

应用程序是朴素简单:发送到备用设备

下面是他们的推荐


  

在特定的,应用程序的Andr​​oidManifest.xml含有格式不正确的设备联系接收器入口(通过元数据命名android.app.device_admin的)。要成为一个结构良好的设备管理,入口必须声明与行动意图android.app.action.DEVICE_ADMIN_ENABLED的意图过滤器。建议的修改是使该条目合式如果接收者是设备管理员或删除元数据命名android.app.device_admin的,如果接收者不是设备管理员。


这是Android的部分清单

 <接收
            机器人:MyAdminNAME =
            机器人:权限=android.permission.BIND_DEVICE_ADMIN>
            &所述;元数据
                机器人:名字=android.app.device_admin的
                机器人:资源=@布局/政策>
                &所述;意图滤光器>
                    <作用机器人:名字=android.app.action.DEVICE_ADMIN_ENABLED>
                    < /作用>
                &所述; /意图滤光器>
            < /元数据>
        < /接收器>

说实话,我不知道如何解决它。任何想法?


解决方案

这个问题可能你已经嵌套的<意向滤光器> ...< /意向滤光器> 元数据标记下,而这两个应该是&LT的直接子;接收器/> 。根据该文件,一个有效的声明应该如下:

 <接收>
    &所述;意图滤光器> 。 。 。 &所述; /意图滤光器>
    <元数据/>
< /接收器>

http://developer.android.com/guide/topics/清单/清单,intro.html

I just got an email from Google Play, notifying me that my app will be removed as "we have determined that your app has a malformed AndroidManifest.xml file which may make it difficult for users to uninstall the app"

The app is plain simple: sends the device to standby.

Here is their recommendation

In particular, the app’s AndroidManifest.xml contains a malformed Device Admin receiver entry (as identified by meta-data named android.app.device_admin). To be a well-formed Device Admin, the entry must declare an Intent filter for Intents with action android.app.action.DEVICE_ADMIN_ENABLED. The suggested modification is to make the entry well-formed if the receiver is a Device Admin, or remove the meta-data named android.app.device_admin if the receiver is not a Device Admin.

And here is the part from Android manifest

        <receiver
            android:name=".MyAdmin"
            android:permission="android.permission.BIND_DEVICE_ADMIN" >
            <meta-data
                android:name="android.app.device_admin"
                android:resource="@layout/policies" >
                <intent-filter>
                    <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" >
                    </action>
                </intent-filter>
            </meta-data>
        </receiver>

To be honest, I don't understand how to fix it. Any ideas ?

解决方案

The problem is likely that you've nested <intent-filter>...</intent-filter> under the meta-data tag, whereas both should be direct children of <receiver />. According to the documentation, a valid declaration should look as follows:

<receiver>
    <intent-filter> . . . </intent-filter>
    <meta-data />
</receiver>

http://developer.android.com/guide/topics/manifest/manifest-intro.html

这篇关于畸形的Andr​​oid清单违反条款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆