Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unexpected key "NSMainNibFile~ipad" while parsing <dict/> #572

Closed
shanlin2dltk opened this issue Mar 14, 2019 · 2 comments
Closed

Comments

@shanlin2dltk
Copy link

shanlin2dltk commented Mar 14, 2019

Problem

My app used to work fine with ios4.5.4 version, now after using the newly 5.0.0 version, the build failed with error message 'Error: Unexpected key "NSMainNibFile~ipad" while parsing '. The same error happens when using Cordova cli 7.1.0 and 8.1.2. My config.xml has these plugins:

 <engine name="ios" spec="5.0.0" />
    <engine name="android" spec="7.1.0" />
    <plugin name="cordova-plugin-camera" spec="4.0.3">
        <variable name="CAMERA_USAGE_DESCRIPTION" value="Please allow access to the camera to take pictures to attach to your expense submissions." />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="Please allow access to the gallery to attach receipts for your expense submissions." />
    </plugin>
    <plugin name="cordova-plugin-file" spec="6.0.1" />
    <plugin name="cordova-plugin-file-opener2" spec="2.2.0" />
    <plugin name="cordova-plugin-file-transfer" spec="1.7.1" />
    <plugin name="cordova-plugin-fingerprint-aio" spec="1.6.0">
        <variable name="FACEID_USAGE_DESCRIPTION" value="Need to access face recognition function of your device." />
    </plugin>
    <plugin name="cordova-plugin-globalization" spec="1.11.0" />
    <plugin name="cordova-plugin-inappbrowser" spec="3.0.0" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <plugin name="cordova-plugin-device" spec="2.0.2" />
    <plugin name="cordova-plugin-secure-storage" spec="3.0.1" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
    <plugin name="cordova-plugin-wkwebview-engine" spec="1.1.4" />
    <plugin name="cordova-plugin-wkwebview-file-xhr" spec="2.1.1" />
    <plugin name="cordova-plugin-customurlscheme" spec="4.3.0">
        <variable name="URL_SCHEME" value="maconomytime" />
    </plugin>
    <plugin name="cordova-plugin-pincheck" spec="0.0.6" />
    <plugin name="cordova-plugin-app-launcher" spec="0.4.0" />

The verbose output of command cordova build ios --device --verbose gives:
Error: Unexpected key "NSMainNibFile~ipad" while parsing <dict/>.

Since the error message doesn't give details, I have no idea what could go wrong. Can anyone shed some light on the possible causes?

@shanlin2dltk
Copy link
Author

shanlin2dltk commented Mar 14, 2019

the node stack trace looks like this:

Error: Unexpected key "NSMainNibFile~ipad" while parsing <dict/>.
    at invariant (/Users/shanlin/build/extjs_maconomy_time/cordova/node_modules/plist/lib/parse.js:53:11)
    at parsePlistXML (/Users/shanlin/build/extjs_maconomy_time/cordova/node_modules/plist/lib/parse.js:121:9)
    at parsePlistXML (/Users/shanlin/build/extjs_maconomy_time/cordova/node_modules/plist/lib/parse.js:101:23)
    at Object.parse (/Users/shanlin/build/extjs_maconomy_time/cordova/node_modules/plist/lib/parse.js:71:15)
    at ConfigFile_load [as load] (/Users/shanlin/build/extjs_maconomy_time/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js:86:27)
    at new ConfigFile (/Users/shanlin/build/extjs_maconomy_time/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js:53:10)
    at ConfigKeeper_get [as get] (/Users/shanlin/build/extjs_maconomy_time/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigKeeper.js:51:23)
    at PlatformMunger_apply_file_munge [as apply_file_munge] (/Users/shanlin/build/extjs_maconomy_time/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js:78:50)
    at PlatformMunger.reapply_global_munge (/Users/shanlin/build/extjs_maconomy_time/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js:268:14)
    at updateConfigFile (/Users/shanlin/build/extjs_maconomy_time/cordova/platforms/ios/cordova/lib/prepare.js:119:18)

@shanlin2dltk
Copy link
Author

shanlin2dltk commented Mar 14, 2019

It turns out the problem is when adding a custom hook to read/write plist using node plist package, plist incorrectly handles a empty string key. Here is the related report issue.
Actually in my case, I don't need the hook any more. Instead, 'config-file' element functions correctly in Cordova cli 8.1.2. It is not Cordova-ios5.0.0 issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants