我正试图通过我们的EMM服务器为一个内部专用应用程序设置AppConfig变量。我查看了这里的文档“设置托管配置”,并验证了我的https://developer.android.com/work/managed-configurations和app_restrictions.xml文件是否正确填充。
AndroidManifesst.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<application>
...
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
<meta-data
android:name="android.content.APP_RESTRICTIONS"
android:resource="@xml/app_restrictions"></meta-data>
</provider>
</application>
...
</manifest>app_restrictions.xml:
<?xml version="1.0" encoding="utf-8"?>
<restrictions xmlns:android="http://schemas.android.com/apk/res/android">
<restriction
android:key="app_configurator"
android:title="@string/app_configurator"
android:restrictionType="bool"
android:defaultValue="false">
</restriction>
<restriction
android:key="z_number"
android:title="@string/z_number"
android:restrictionType="string"
android:defaultValue="Testing123">
</restriction>
</restrictions>在测试中,将testing应用程序与设备所有者一起使用:如果手动添加应用程序响应的键和值,“加载应用程序清单限制”按钮(当我期望它应该加载app_restrictions.xml中定义的详细信息时)没有任何作用。
在发布时,通过管理Google和从我们的EMM解决方案中设置应用程序:应用程序配置选项卡不包含任何参数,并有一条消息:“此应用程序不支持应用程序配置”。显示无法配置该应用程序。
鉴于应用程序在设置值时确实会响应,但是无法设置值似乎表明Test和EMM解决方案无法读取我的app_restrictions.xml的值。
文档表明,上述两个文件就是所需的全部。但是,我已经看到了一些关于Google服务的参考,这些服务向MDM提供了这些信息,所以我不确定我是否理解进一步研究的过程。
希望有人能帮我指点。
发布于 2021-12-13 06:56:55
在AndroidManifest.xml文件中,“meta”标记的位置不正确。该问题在以下更新后得到解决:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<application>
<meta-data
android:name="android.content.APP_RESTRICTIONS"
android:resource="@xml/app_restrictions"></meta-data>
...
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
</provider>
</application>
...
</manifest>https://stackoverflow.com/questions/70299194
复制相似问题