Google Play gives parse error using app restriction in this sample
Issue by MSohm
Thursday Sep 29, 2016 at 18:55 GMT
Originally opened as https://github.com/googlesamples/android-AppRestrictionSchema/issues/1
When uploading a version of this sample AppRestrictionSchema to Google Play, it is rejected with the following error:
Upload failed You uploaded an APK which specifies an app restrictions schema document in its manifest, but there were parsing errors in the document. Restriction profile has one or more invalid nested restrictions.
To reproduce:
- Import sample into Android Studio.
- Rename package to remove example and be unique.
- Generated a signed APK.
- Upload APK to Google Play.
Expected Results. APK accepted by Google Play.
Actual Results: Google Play fails to parse the APK with error quoted above.
Comment by MSohm
Thursday Sep 29, 2016 at 19:02 GMT
Google Play is failing to parse this section of the app_restriction.xml.
<restriction
android:description="@string/description_profile"
android:key="profile"
android:restrictionType="bundle"
android:title="@string/title_profile">
<restriction
android:defaultValue="@string/default_profile_name"
android:description="@string/description_profile_name"
android:key="name"
android:restrictionType="string"
android:title="@string/title_profile_name"/>
<restriction
android:defaultValue="@integer/default_profile_age"
android:description="@string/description_profile_age"
android:key="age"
android:restrictionType="integer"
android:title="@string/title_profile_age"/>
</restriction>
Comment by michaelprimez
Wednesday Nov 30, 2016 at 20:59 GMT
I am getting the exact same error message.
app_restrictions.xml
<restriction
android:key="security_configuration"
android:title="@string/security_configuration"
android:restrictionType="bundle">
<restriction
android:key="security_mandatory"
android:title="@string/security_mandatory_optional"
android:restrictionType="bool"/>
<restriction
android:key="security_passcode_type"
android:title="@string/security_passcode_type"
android:restrictionType="choice"
android:entries="@array/passcode_type"
android:entryValues="@array/passcode_type_values">
</restriction>
<restriction
android:key="security_passcode_length"
android:title="@string/security_passcode_length"
android:restrictionType="integer"/>
<restriction
android:key="security_passcode_timeout"
android:title="@string/security_passcode_timeout"
android:restrictionType="integer"/>
<restriction
android:key="security_passcode_expire_timeout"
android:title="@string/security_passcode_expire_timeout"
android:restrictionType="integer"/>
<restriction
android:key="security_passcode_max_attepts"
android:title="@string/security_passcode_max_attepts"
android:restrictionType="integer"/>
</restriction>
<restriction
android:key="header_configuration"
android:title="@string/header_configuration"
android:restrictionType="bundle">
<restriction
android:key="header_secret"
android:title="@string/header_secret"
android:restrictionType="string"/>
</restriction>
Comment by michaelprimez
Friday Dec 02, 2016 at 12:46 GMT
In case that someone interesting putting the bundle inside a bundle_array solve the parsing error.
This should now be fixed in the renamed sample ManagedConfigurations.