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: Cannot read property 'get' of null #51

Closed
fmendoza opened this Issue Jul 7, 2016 · 11 comments

Comments

Projects
None yet
5 participants
@fmendoza

fmendoza commented Jul 7, 2016

Hello

I'm receiving this error during the build process on Android

I think the error is caused in the script afterAndroidPrepare.js

// detect parse.com or parse-server mode
var parseServerUrl = configXml.data.find('preference[@name="ParseServerUrl"]').get('value');

For some reason is not finding the preference tag ParseServerUrl in config.xml but I have added the tags correctly.

@taivo

This comment has been minimized.

Show comment
Hide comment
@taivo

taivo Jul 9, 2016

Owner

Probably a casing issue in your preference tag. Can you paste your config.xml here?

Owner

taivo commented Jul 9, 2016

Probably a casing issue in your preference tag. Can you paste your config.xml here?

@taivo

This comment has been minimized.

Show comment
Hide comment
@taivo

taivo Jul 11, 2016

Owner

Hello @fmendoza , are you good? Can we close this or is there still a problem?

Owner

taivo commented Jul 11, 2016

Hello @fmendoza , are you good? Can we close this or is there still a problem?

@fmendoza

This comment has been minimized.

Show comment
Hide comment
@fmendoza

fmendoza Jul 12, 2016

See my config.xml below.

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.kok.kok_admin" version="1.1.13" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Kok Admin</name>
    <description>
    </description>
    <author email="info@kok-app.com" href="http://www.kok-app.com">
        Kok
    </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-navigation href="http://*/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="ParseAppId" value="RPcAkYIZ6pnpBzAPaFDvfec102d6c3xRrfgjXnmF" />
    <preference name="ParseClientKey" value="QpI2SWaWUguWyOEUE1pJhm6tmoLZBMisPJsDvsK5" />
    <preference name="ParseServerUrl" value="PARSE_DOT_COM" />
    <platform name="android">
        <allow-intent href="market:*" />
        <preference name="android-minSdkVersion" value="15" />
        <icon density="mdpi" src="res/android/default/icon/drawable-mdpi/ic_launcher.png" />
        <icon density="hdpi" src="res/android/default/icon/drawable-hdpi/ic_launcher.png" />
        <icon density="xhdpi" src="res/android/default/icon/drawable-xhdpi/ic_launcher.png" />
        <icon density="xxhdpi" src="res/android/default/icon/drawable-xxhdpi/ic_launcher.png" />
        <icon density="xxxhdpi" src="res/android/default/icon/drawable-xxxhdpi/ic_launcher.png" />
        <splash density="port-hdpi" src="res/android/default/splash/drawable-hdpi/screen.png" />
        <splash density="port-mdpi" src="res/android/default/splash/drawable-mdpi/screen.png" />
        <splash density="port-xhdpi" src="res/android/default/splash/drawable-xhdpi/screen.png" />
        <splash density="port-xxhdpi" src="res/android/default/splash/drawable-xxhdpi/screen.png" />
        <splash density="port-xxxhdpi" src="res/android/default/splash/drawable-xxxhdpi/screen.png" />
        <splash density="land-hdpi" src="res/android/default/splash/drawable-land-hdpi/screen.png" />
        <splash density="land-mdpi" src="res/android/default/splash/drawable-land-mdpi/screen.png" />
        <splash density="land-xhdpi" src="res/android/default/splash/drawable-land-xhdpi/screen.png" />
        <splash density="land-xxhdpi" src="res/android/default/splash/drawable-land-xxhdpi/screen.png" />
        <splash density="land-xxxhdpi" src="res/android/default/splash/drawable-land-xxxhdpi/screen.png" />
    </platform>
    <platform name="ios">
        <preference name="KeyboardDisplayRequiresUserAction" value="false" />
        <config-file platform="ios" target="*-Info.plist" parent="NSAppTransportSecurity">
         <dict>
             <key>NSAllowsArbitraryLoads</key><true/>
         </dict>
        </config-file>
        <config-file platform="ios" target="*-Info.plist" parent="ITSAppUsesNonExemptEncryption">
         <false/>
        </config-file>
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="res/ios/default/icon/Icon.png" width="57" />
        <icon height="114" src="res/ios/default/icon/Icon@2x.png" width="114" />
        <icon height="40" src="res/ios/default/icon/Icon-40.png" width="40" />
        <icon height="80" src="res/ios/default/icon/Icon-40@2x.png" width="80" />
        <icon height="120" src="res/ios/default/icon/Icon-40@3x.png" width="120" />
        <icon height="50" src="res/ios/default/icon/Icon-Small-50.png" width="50" />
        <icon height="100" src="res/ios/default/icon/Icon-Small-50@2x.png" width="100" />
        <icon height="60" src="res/ios/default/icon/Icon-60.png" width="60" />
        <icon height="120" src="res/ios/default/icon/Icon-60@2x.png" width="120" />
        <icon height="180" src="res/ios/default/icon/Icon-60@3x.png" width="180" />
        <icon height="72" src="res/ios/default/icon/Icon-72.png" width="72" />
        <icon height="144" src="res/ios/default/icon/Icon-72@2x.png" width="144" />
        <icon height="76" src="res/ios/default/icon/Icon-76.png" width="76" />
        <icon height="152" src="res/ios/default/icon/Icon-76@2x.png" width="152" />
        <icon height="29" src="res/ios/default/icon/Icon-small.png" width="29" />
        <icon height="58" src="res/ios/default/icon/Icon-small@2x.png" width="58" />
        <icon height="87" src="res/ios/default/icon/Icon-small@3x.png" width="87" />
        <splash height="1136" src="res/ios/default/splash/Default-568h@2x.png" width="640" />
        <splash height="1334" src="res/ios/default/splash/Default-667h@2x.png" width="750" />
        <splash height="2208" src="res/ios/default/splash/Default-Portrait-736h@3x.png" width="1242" />
        <splash height="1242" src="res/ios/default/splash/Default-Landscape-736h@3x.png" width="2208" />
        <splash height="1536" src="res/ios/default/splash/Default-Landscape@2x.png" width="2048" />
        <splash height="768" src="res/ios/default/splash/Default-Landscape.png" width="1024" />
        <splash height="2048" src="res/ios/default/splash/Default-Portrait@2x.png" width="1536" />
        <splash height="1024" src="res/ios/default/splash/Default-Portrait.png" width="768" />
        <splash height="960" src="res/ios/default/splash/Default@2x.png" width="640" />
        <splash height="480" src="res/ios/default/splash/Default.png" width="320" />
    </platform>
    <engine name="android" spec="~5.1.1" />
    <plugin name="cordova-plugin-inappbrowser" spec="~1.4.0" />
    <plugin name="cordova-plugin-splashscreen" spec="~3.2.2" />
    <plugin name="cordova-plugin-statusbar" spec="~2.1.3" />
    <plugin name="cordova-plugin-whitelist" spec="~1.2.2" />
    <plugin name="cordova-plugin-geolocation" spec="~2.2.0" />
    <plugin name="cordova-plugin-x-toast" spec="~2.5.2" />
    <plugin name="ionic-plugin-keyboard" spec="~2.2.0" />
    <plugin name="cordova-plugin-camera" spec="~2.2.0" />
    <plugin name="cordova-plugin-globalization" spec="~1.0.3" />
    <engine name="ios" spec="~4.1.0" />
    <plugin name="cordova-plugin-crosswalk-webview" spec="~1.7.0" />
    <preference name="xwalkVersion" value="18+" />
    <preference name="xwalkZOrderOnTop" value="true" />
    <preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
    <preference name="xwalkMode" value="embedded" />
    <preference name="xwalkMultipleApk" value="true" />
    <plugin name="cordova-plugin-dialogs" spec="~1.2.1" />
    <plugin name="cordova-plugin-actionsheet" spec="https://github.com/EddyVerbruggen/cordova-plugin-actionsheet.git" />
    <plugin name="parse-push-plugin" spec="https://github.com/taivo/parse-push-plugin" />
</widget>

fmendoza commented Jul 12, 2016

See my config.xml below.

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.kok.kok_admin" version="1.1.13" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Kok Admin</name>
    <description>
    </description>
    <author email="info@kok-app.com" href="http://www.kok-app.com">
        Kok
    </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-navigation href="http://*/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="ParseAppId" value="RPcAkYIZ6pnpBzAPaFDvfec102d6c3xRrfgjXnmF" />
    <preference name="ParseClientKey" value="QpI2SWaWUguWyOEUE1pJhm6tmoLZBMisPJsDvsK5" />
    <preference name="ParseServerUrl" value="PARSE_DOT_COM" />
    <platform name="android">
        <allow-intent href="market:*" />
        <preference name="android-minSdkVersion" value="15" />
        <icon density="mdpi" src="res/android/default/icon/drawable-mdpi/ic_launcher.png" />
        <icon density="hdpi" src="res/android/default/icon/drawable-hdpi/ic_launcher.png" />
        <icon density="xhdpi" src="res/android/default/icon/drawable-xhdpi/ic_launcher.png" />
        <icon density="xxhdpi" src="res/android/default/icon/drawable-xxhdpi/ic_launcher.png" />
        <icon density="xxxhdpi" src="res/android/default/icon/drawable-xxxhdpi/ic_launcher.png" />
        <splash density="port-hdpi" src="res/android/default/splash/drawable-hdpi/screen.png" />
        <splash density="port-mdpi" src="res/android/default/splash/drawable-mdpi/screen.png" />
        <splash density="port-xhdpi" src="res/android/default/splash/drawable-xhdpi/screen.png" />
        <splash density="port-xxhdpi" src="res/android/default/splash/drawable-xxhdpi/screen.png" />
        <splash density="port-xxxhdpi" src="res/android/default/splash/drawable-xxxhdpi/screen.png" />
        <splash density="land-hdpi" src="res/android/default/splash/drawable-land-hdpi/screen.png" />
        <splash density="land-mdpi" src="res/android/default/splash/drawable-land-mdpi/screen.png" />
        <splash density="land-xhdpi" src="res/android/default/splash/drawable-land-xhdpi/screen.png" />
        <splash density="land-xxhdpi" src="res/android/default/splash/drawable-land-xxhdpi/screen.png" />
        <splash density="land-xxxhdpi" src="res/android/default/splash/drawable-land-xxxhdpi/screen.png" />
    </platform>
    <platform name="ios">
        <preference name="KeyboardDisplayRequiresUserAction" value="false" />
        <config-file platform="ios" target="*-Info.plist" parent="NSAppTransportSecurity">
         <dict>
             <key>NSAllowsArbitraryLoads</key><true/>
         </dict>
        </config-file>
        <config-file platform="ios" target="*-Info.plist" parent="ITSAppUsesNonExemptEncryption">
         <false/>
        </config-file>
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="res/ios/default/icon/Icon.png" width="57" />
        <icon height="114" src="res/ios/default/icon/Icon@2x.png" width="114" />
        <icon height="40" src="res/ios/default/icon/Icon-40.png" width="40" />
        <icon height="80" src="res/ios/default/icon/Icon-40@2x.png" width="80" />
        <icon height="120" src="res/ios/default/icon/Icon-40@3x.png" width="120" />
        <icon height="50" src="res/ios/default/icon/Icon-Small-50.png" width="50" />
        <icon height="100" src="res/ios/default/icon/Icon-Small-50@2x.png" width="100" />
        <icon height="60" src="res/ios/default/icon/Icon-60.png" width="60" />
        <icon height="120" src="res/ios/default/icon/Icon-60@2x.png" width="120" />
        <icon height="180" src="res/ios/default/icon/Icon-60@3x.png" width="180" />
        <icon height="72" src="res/ios/default/icon/Icon-72.png" width="72" />
        <icon height="144" src="res/ios/default/icon/Icon-72@2x.png" width="144" />
        <icon height="76" src="res/ios/default/icon/Icon-76.png" width="76" />
        <icon height="152" src="res/ios/default/icon/Icon-76@2x.png" width="152" />
        <icon height="29" src="res/ios/default/icon/Icon-small.png" width="29" />
        <icon height="58" src="res/ios/default/icon/Icon-small@2x.png" width="58" />
        <icon height="87" src="res/ios/default/icon/Icon-small@3x.png" width="87" />
        <splash height="1136" src="res/ios/default/splash/Default-568h@2x.png" width="640" />
        <splash height="1334" src="res/ios/default/splash/Default-667h@2x.png" width="750" />
        <splash height="2208" src="res/ios/default/splash/Default-Portrait-736h@3x.png" width="1242" />
        <splash height="1242" src="res/ios/default/splash/Default-Landscape-736h@3x.png" width="2208" />
        <splash height="1536" src="res/ios/default/splash/Default-Landscape@2x.png" width="2048" />
        <splash height="768" src="res/ios/default/splash/Default-Landscape.png" width="1024" />
        <splash height="2048" src="res/ios/default/splash/Default-Portrait@2x.png" width="1536" />
        <splash height="1024" src="res/ios/default/splash/Default-Portrait.png" width="768" />
        <splash height="960" src="res/ios/default/splash/Default@2x.png" width="640" />
        <splash height="480" src="res/ios/default/splash/Default.png" width="320" />
    </platform>
    <engine name="android" spec="~5.1.1" />
    <plugin name="cordova-plugin-inappbrowser" spec="~1.4.0" />
    <plugin name="cordova-plugin-splashscreen" spec="~3.2.2" />
    <plugin name="cordova-plugin-statusbar" spec="~2.1.3" />
    <plugin name="cordova-plugin-whitelist" spec="~1.2.2" />
    <plugin name="cordova-plugin-geolocation" spec="~2.2.0" />
    <plugin name="cordova-plugin-x-toast" spec="~2.5.2" />
    <plugin name="ionic-plugin-keyboard" spec="~2.2.0" />
    <plugin name="cordova-plugin-camera" spec="~2.2.0" />
    <plugin name="cordova-plugin-globalization" spec="~1.0.3" />
    <engine name="ios" spec="~4.1.0" />
    <plugin name="cordova-plugin-crosswalk-webview" spec="~1.7.0" />
    <preference name="xwalkVersion" value="18+" />
    <preference name="xwalkZOrderOnTop" value="true" />
    <preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
    <preference name="xwalkMode" value="embedded" />
    <preference name="xwalkMultipleApk" value="true" />
    <plugin name="cordova-plugin-dialogs" spec="~1.2.1" />
    <plugin name="cordova-plugin-actionsheet" spec="https://github.com/EddyVerbruggen/cordova-plugin-actionsheet.git" />
    <plugin name="parse-push-plugin" spec="https://github.com/taivo/parse-push-plugin" />
</widget>
@taivo

This comment has been minimized.

Show comment
Hide comment
@taivo

taivo Jul 29, 2016

Owner

I'm not able to replicate the error, even after replacing my entire config.xml with yours.

If the problem persists, I'm going to need your help debugging the line

var parseServerUrl = configXml.data.find('preference[@name="ParseServerUrl"]').get('value');

on your system. Try to see if configXml.data has recognizable content. Then try to see if you can search for 'preference' alone (without the name attribute).

Owner

taivo commented Jul 29, 2016

I'm not able to replicate the error, even after replacing my entire config.xml with yours.

If the problem persists, I'm going to need your help debugging the line

var parseServerUrl = configXml.data.find('preference[@name="ParseServerUrl"]').get('value');

on your system. Try to see if configXml.data has recognizable content. Then try to see if you can search for 'preference' alone (without the name attribute).

@taivo taivo closed this Sep 28, 2016

@ccastroelo

This comment has been minimized.

Show comment
Hide comment
@ccastroelo

ccastroelo Jun 11, 2017

Hello fmendoza, I have the same problem. How did you solved?

ccastroelo commented Jun 11, 2017

Hello fmendoza, I have the same problem. How did you solved?

@istornz

This comment has been minimized.

Show comment
Hide comment
@istornz

istornz Jun 13, 2017

Same for me :/

istornz commented Jun 13, 2017

Same for me :/

@fmendoza

This comment has been minimized.

Show comment
Hide comment
@fmendoza

fmendoza Jun 13, 2017

I didn't do anything to solve the issue. Maybe a problem with Cordova? Make sure that you have updated Cordova to latest version.

fmendoza commented Jun 13, 2017

I didn't do anything to solve the issue. Maybe a problem with Cordova? Make sure that you have updated Cordova to latest version.

@istornz

This comment has been minimized.

Show comment
Hide comment
@istornz

istornz Jun 14, 2017

Hum strange, I'm running latest version of Cordova and Ionic-cli and I still have the error ...

istornz commented Jun 14, 2017

Hum strange, I'm running latest version of Cordova and Ionic-cli and I still have the error ...

@sujen2009

This comment has been minimized.

Show comment
Hide comment
@sujen2009

sujen2009 Jun 15, 2017

Same issue here.... If i remove parse plugin it compiles without error....

Looks like I was missing
preference ParseNotificationIcon
in config.xml, it wasn't in doc though...

sujen2009 commented Jun 15, 2017

Same issue here.... If i remove parse plugin it compiles without error....

Looks like I was missing
preference ParseNotificationIcon
in config.xml, it wasn't in doc though...

@istornz

This comment has been minimized.

Show comment
Hide comment
@istornz

istornz Jun 15, 2017

@sujen2009 Wow works great with ParseNotificationIcon added to config.xml thanks !

istornz commented Jun 15, 2017

@sujen2009 Wow works great with ParseNotificationIcon added to config.xml thanks !

@sujen2009

This comment has been minimized.

Show comment
Hide comment
@sujen2009

sujen2009 Jun 16, 2017

@istornz Happy to help :) :)

sujen2009 commented Jun 16, 2017

@istornz Happy to help :) :)

ulion added a commit to ulion/parse-push-plugin that referenced this issue Jun 26, 2018

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