schema validation failed with the following errors

Viewed 2474

I know that there are a lot of kind of this questions but mine I think that I did not see that yet.When building my android platform, this error appends.

Schema validation failed with the following errors:
 Data path ".scripts[0]" should NOT have additional properties(lazy).
 Data path ".scripts[0]" should be string.
 Data path ".scripts[0]" should match exactly one schema in oneOf.
[ERROR] An error occurred while running subprocess ng.

So How can I figure it out??? PLEASE

4 Answers

On angular.json file if you habe an empty script tag, like this, Just remove it !

 "build": {
      "options": {
       ....,
       "scripts": []      <-- Remove this line

When I moved from @angular-devkit/build-angular version ~0.900.0-rc.3 to version ^0.1100.2 I had the same error. Setting in package.json the following configuration solved my issue:

 "@angular-devkit/build-angular": "~0.900.0-rc.3",

For IONIC

I tried so many suggestions, but finally worked by following these steps :-

  1. Remove node_modules and package-lock.json.
  2. npm cache clean --force
  3. npm install.
  4. Now try to run, if it didn't work go for the next step.
  5. npm i -g npm-check-updates
  6. ncu -u
  7. ionic cordova platform rm android.
  8. ionic cordova platform add android.
  9. npm install.

I think this error might be happening due to new syntax for script tag in angular.json. Please find and update this tag (might be more than one) and update it accordingly to the new syntax:

"scripts": [
   {
      "input": "a.js",
      "input": "b.js"
   }
],
Related