Error on ionic cordova build ios


#1

On Ionic 1, giving me this error on trying to build ios, tried to remove and add platform, still the same error:

(node:2352) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: doc.find is not a function

How to find out from which file does doc.find related to? Probably the error appears because of plugins:


cordova-admobsdk 1.0.4 "Google Mobile Ads SDK for Cordova"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-admob 3.2.4 "Cordova-Phonegap AdMob Plugin"
cordova-plugin-camera 4.0.2 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-device 1.1.7-dev "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-googleplus 5.1.1 "Google SignIn"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.1 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-x-socialsharing 5.1.8 "SocialSharing"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-deeplinks 1.0.15 "Ionic Deeplink Plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
onesignal-cordova-plugin 2.2.0 "OneSignal Push Notifications"

#2

You might need to update your version of Node to a more recent version.


#3

thank you for your suggestion, I did this in Terminal:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash

and the same error still exists, pasting full error:

 ionic cordova build ios
[WARN] Detected @ionic/cli-plugin-cordova in your package.json.

       As of CLI 3.8, it is no longer needed. You can uninstall it:
       
       npm uninstall -D @ionic/cli-plugin-cordova
       

[WARN] Detected @ionic/cli-plugin-ionic1 in your package.json.

       As of CLI 3.8, it is no longer needed. You can uninstall it:
       
       npm uninstall -D @ionic/cli-plugin-ionic1
       

[WARN] Detected @ionic/cli-plugin-gulp in your package.json.

       As of CLI 3.8, it is no longer needed. You can uninstall it:
       
       npm uninstall -D @ionic/cli-plugin-gulp
       

[WARN] Not performing Ionic build for project type: ionic1.
> cordova build ios
(node:3451) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: doc.find is not a function

#4

Started a new project:

  1. Added the same plugins

  2. Copied all the files

Geolocation was not working asking me:


No NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription key is defined in the Info.plist file.

based on the documentation added this into config.xml of a ios platform:


<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
    <string>need location access to find things nearby</string>
</edit-config>

The same error appeared. Any ideas how to update config.xml?


#5

ISSUE FIXED:
according to this:

replaced in config.xml:

<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
    <string>need location access to find things nearby</string>
</edit-config>

to:
<config-file overwrite="true" parent="NSLocationWhenInUseUsageDescription" platform="ios" target="*-Info.plist"> <string>Allow the app to know your location</string> </config-file>

for both Camera and Location and the app successfuly built.


#6

this work for me, thanks


#7

You are welcome :slight_smile: