• Article for your preferred language does not exist. Below is international version of the article.

Article ID: 119212, created on Dec 19, 2013, last review on May 10, 2014

  • Applies to:
  • APS

Symptoms

I try to build a package with apsbuild, but it fails:

root@sandbox> apsbuild package/
Building package.......
Warning: To generate schema from PHP code for service 'service1' element <schema> of this service should be removed from APP-META.xml.
Warning: To generate schema from PHP code for service 'service2' element <schema> of this service should be removed from APP-META.xml.
Generating APP-LIST.xml.......
Validating package.......
Package format version - 2.0
scripts/service1.php:1: Error: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
scripts/service2.php:1: Error: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
Validation complete: 2 Error(s), 0 Warning(s)
Error: Failed to build package. Package is not valid.

Cause

apsbuild finds php code where it expects to see json (this error comes from json parser). Most probably element in APP-META.xml points to a script instead of schema:

<...>
<schema path="scripts/service1.php"/>
<...>
<schema path="scripts/service2.php"/>
<...>

Resolution

If you want aps-php-runtime to generate schema automatically from script: remove the line with element altogether

If you want apsbuild to use your custom schema files: edit the path to point to schema file itself:

<schema path="schemas/service1.schema"/>

717db81efe94e616312b74fb03a5d474

Email subscription for changes to this article
Save as PDF