Could I contain permission name in string res

2019-02-23 00:19发布

Sample code:

<permission
    android:name="@string/permission_name"
    android:protectionLevel="signature" >
</permission>

Error while building: missing name attribute in element .

But I don't want to duplicate permission name in my different applications. Is exist some way for fix it and contain permission in resources?

1条回答
地球回转人心会变
2楼-- · 2019-02-23 00:41

No, that's impossible. Take a look here. You can use resources to specify a label, but not the name:

The name must be unique, so it should use Java-style scoping — for example, "com.example.project.PERMITTED_ACTION".

查看更多
登录 后发表回答