【发布时间】:2017-08-10 14:16:01
【问题描述】:
我正在为 android 开发 NativeScript 应用程序,并希望实现如下所述的托管配置:https://developer.android.com/work/managed-configurations.html。
我尝试将 app_restrictions.xml 添加到 App_Resources/Android/values 文件夹,但出现以下构建错误:
任务“:mergeF0F1DebugResources”执行失败。 错误:不支持的类型“限制”
这是app_restrictions.xml的内容:
<?xml version="1.0" encoding="utf-8"?>
<restrictions xmlns:android="http://schemas.android.com/apk/res/android">
<restriction
android:key="downloadOnCellular"
android:restrictionType="bool"
android:defaultValue="true" />
</restrictions>
NativeScript 是否支持添加这样的限制?如果是这样,我该如何添加限制资源文件。如果没有,是否有其他方式来实现托管配置?
编辑:由 pkanev 在 cmets 中解决。限制文件必须放在 App_Resources/Android/xml 中。
【问题讨论】:
-
我认为该文件应该放在
xml目录中,而不是在values中。你能测试一下吗? -
构建成功,我试试看限制管理器能否访问这些值。
-
成功了,谢谢!
标签: android nativescript android-restrictions