This article has been archived and is no longer updated by Apple.

iAd Producer: JavaScript alert displays when opening

When you open iAd Producer, it displays this alert: "Javascript file package.json is invalid."

This alert may display if you have another application in /Applications that identifies .json files as JavaScript source files. While .json files are similar to JavaScript files, .json files do not parse correctly as JavaScript, thus causing this alert to display.

To resolve the issue:

  1. Identify the program that is treating .json as JavaScript by running this command in Terminal:

    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump

  2. In the output, find a line with a ".json" tag (such as the following):

    tags: .json, application/json

  3. Immediately above that line, you should find a line listing the application that is identifying .json files as JavaScript. For example:

    uti: com.foo.application.json

  4. Either remove the identified application or move the application out of /Applications (for example, to ~/Desktop).

  5. Run the following command to remove the entry from the launch services database:

    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

  6. Reopen iAd Producer.

Note: To use the application that identifies .json files as JavaScript source files, reinstall it or move it back to the /Applications folder. When you open iAd Producer, you will again see the JavaScript alert. Repeat steps 4-6 to resolve the issue.

Published Date: