enterprise-samples icon indicating copy to clipboard operation
enterprise-samples copied to clipboard

Google Play gives parse error using app restriction in this sample

Open codingjeremy opened this issue 6 years ago • 6 comments

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:

  1. Import sample into Android Studio.
  2. Rename package to remove example and be unique.
  3. Generated a signed APK.
  4. 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.

codingjeremy avatar Sep 10 '19 20:09 codingjeremy

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>

codingjeremy avatar Sep 10 '19 20:09 codingjeremy

Comment by MoritzHeilmann Wednesday Nov 30, 2016 at 18:52 GMT


any news on that?

codingjeremy avatar Sep 10 '19 20:09 codingjeremy

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>

codingjeremy avatar Sep 10 '19 20:09 codingjeremy

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.

codingjeremy avatar Sep 10 '19 20:09 codingjeremy


sualpcakir16 avatar Mar 08 '22 22:03 sualpcakir16

sualpcakir16 avatar Mar 08 '22 22:03 sualpcakir16

This should now be fixed in the renamed sample ManagedConfigurations.

pfmaggi avatar Nov 18 '22 12:11 pfmaggi