phonegap build for kitkat - phonegap-build

I have made a phonegap app which works on all other devices except my tablet which runs KitKat(the app installs but displays a blank white screen instead of the content). I checked to see if this was an issue with it being a tablet but it seems to be the android version as the exact same app build works on another tablet running android lollipop...
This is the code in my config file, is there something else I need to add or something I should remove so that it will run correctly on the KitKat tablet?
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.helloworld"
version="1.0.0"
xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
xmlns:android = "http://schemas.android.com/apk/res/android">
<config-file platform="android" parent="/manifest" mode="merge">
<supports-screens
android:xlargeScreens="true"
android:largeScreens="true"
android:smallScreens="true"
android:requiresSmallestWidthDp="600"
/>
<uses-sdk android:minSdkVersion="19"
android:targetSdkVersion="19"/>
</config-file>
<name>My App</name>
<description>
Tablet App.
</description>
<content src="index.html"/>
<preference name="target-device" value="universal" />
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="19"/>
<preference name="orientation" value="landscape" />
<access origin="*"/>
</widget>
I am not using an plugins, and am using build.phonegap to build my app.
Thanks in advance

I managed to get the google chrome remote device debugger working and it was an error in my code: I had used let instead of var and KitKat does not recognize let.
I changed all my let declarations to var and now it works perfectly.

Related

Packaged & Installed UWP App Not In Start Menu

I generated the app package for my UWP project via sideload and installed it with the Powershell script that was made. Although the app installed and a folder was made in WindowsApps I cannot launch the app because it is not in the Start Menu. Any ideas on how to fix this?
Edit:
Applications tag in WAP Package Manifest:
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="WorksPackage2"
Description="Package"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png"
AppListEntry="none">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" />
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<uap:Extension Category="windows.appService">
<uap:AppService Name="iTunesConnection" />
</uap:Extension>
<desktop:Extension
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
Category="windows.fullTrustProcess"
Executable="iTunesConsole\iTunesConsole.exe">
</desktop:Extension>
</Extensions>
</Application>
Applications tag in UWP Manifest:
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="Works.App">
<uap:VisualElements
DisplayName="Works"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="Works"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExtension">
<uap3:AppExtension Name="microsoft.gameBarUIExtension"
Id="YourUniqueIdHere"
DisplayName="iTunes Controller"
Description="desc"
PublicFolder="GameBar">
<uap3:Properties>
<GameBarWidget Type="Standard">
<HomeMenuVisible>true</HomeMenuVisible>
<PinningSupported>true</PinningSupported>
<Window>
<Size>
<Height>300</Height>
<Width>400</Width>
<MinHeight>150</MinHeight>
<MinWidth>200</MinWidth>
<MaxHeight>1000</MaxHeight>
<MaxWidth>1000</MaxWidth>
</Size>
<ResizeSupported>
<Horizontal>true</Horizontal>
<Vertical>true</Vertical>
</ResizeSupported>
</Window>
</GameBarWidget>
</uap3:Properties>
</uap3:AppExtension>
</uap3:Extension>
</Extensions>
</Application>
The problem is that you have:
AppListEntry="none"
which says "please don't add an entry to the Start menu."

Websocket trouble with windows application build with cordova

I have a major trouble with my application.
I have an application angular 2. I packaged this app with Cordova. And then with visual studio, I have built a windows application.
In my app I use WebSocket, my app uses WebSockets to send a message to a local server WS. This server is running in local through a windows service.
My problem is that I can't connect my app with the WS server. In the on error event, I don't have anything.
If I build my app on my computer and install it in this same computer it works, but if I install this app in another computer or tablet it doesn't work.
All devices are on windows 10.
Here are my config.xml from my cordova project
<?xml version="1.0" encoding="utf-8"?>
<widget defaultlocale="fr-FR" id="toto" version="1.0.0" windows-packageVersion="1.0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps">
<content src="index.html" />
<access origin="*" />
<vs:features />
<preference name="SplashScreen" value="screen" />
<preference name="windows-target-version" value="10.0" />
<preference name="windows-phone-target-version" value="10.0" />
<preference name="WindowsDefaultUriPrefix" value="ms-appx://" />
<plugin name="cordova-plugin-whitelist" version="1" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="wp8">
<splash height="1280" src="res/screens/wp8/SplashScreenImage.png" width="768" />
</platform>
<plugin name="cordova-windows-capability-localnetwork" src="https://github.com/dilhan2013/cordova-windows-capability-localnetwork.git" version="0.1.0" />
<vs:platformSpecificValues>
<vs:platformSpecificWidget platformName="windows">
</vs:platformSpecificWidget>
</vs:platformSpecificValues>
<preference name="DisallowOverscroll" value="true" />
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
<plugin name="cordova-plugin-console" version="1.0.7" />
</widget>
Thank you for your help.
Sorry in advance for my English
The problem in this particular situation comes from the fact that the app is trying to reach the Web Socket running on localhost.
Like it is mentioned as an answer to this post : Cannot connect to localhost in windows store application, developed windows store app can be isolated from loopback for security reasons.
The solution consists first in finding the installed app PackageFamilyName (this can also be done with the SID from regedit, like in the post mentioned above). For this, run this Power Shell command:
Get-AppxPackage | ? { $_.Name -like 'APP_NAME' }
APP_NAME can be part of the name you know your app has.
Once the description of the package is displayed, add the app to the NetIsolation exemption list by entering the PackageFamilyName in the following Power Shell command:
CheckNetIsolation LoopbackExempt -a -n="PackageFamilyName"
The app should now be part of the exemption list displayed with:
CheckNetIsolation LoopbackExempt -s
And it should be allowed to access the localhost.
Check your WS server, does it accept incoming requests from hosts other than localhost?

Windows 10 IOT Foundation namespace is missing IOT

We are trying to add iot capabilities to our Package.appxmanifest for a cordova project. Visual studio complains that the capability we are trying to use cannot be found nor is it a child of the foundation name space.
The underlined iot:Capability shows the following when hovered over:
The element 'BackgroundTasks' in namespace 'http://schemas.microsoft.com/appx/manifest/foundation/winows10' has invalid child element 'Capabilities' in namespace 'http://schemas.microsoft.com/appx/manifest/iot/windows10'. List of possible elements expected: '...
The thing is I created this as a new project and let vs do all the work yet it cannot resolve it's own entries it's creating. We see this with both a new C# and JS project that VS generated. Can anyone help us? (Yes we added the references "Windows IoT Extensions for the UWP" 10.0.10586.0 to the project as well.). FYI We get the same error when adding as well.
Here's the package.appxmanifest:
<?xml version='1.0' encoding='utf-8'?>
<Package IgnorableNamespaces="uap mp iot" xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10">
<Identity Name="com.project.syndication.sitepad" Publisher="CN=$username$" Version="2.0.0.0" />
<mp:PhoneIdentity PhoneProductId="a885d1d0-453e-11e6-a59d-550bfa336405" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>SitePad App</DisplayName>
<PublisherDisplayName>ERT</PublisherDisplayName>
<Logo>images\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily MaxVersionTested="10.0.10586.0" MinVersion="10.0.10586.0" Name="Windows.Universal" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="com.project.syndication.sitepad" StartPage="ms-appx-web:///www/index.html">
<uap:VisualElements BackgroundColor="#464646" Description="CordovaApp" DisplayName="SitePad App" Square150x150Logo="images\Square150x150Logo.png" Square44x44Logo="images\Square44x44Logo.png">
<uap:SplashScreen Image="images\splashscreen.png" />
<uap:DefaultTile ShortName="SitePad App" Square310x310Logo="images\Square310x310Logo.png" Square71x71Logo="images\Square71x71Logo.png" Wide310x150Logo="images\Wide310x150Logo.png" />
</uap:VisualElements>
<uap:ApplicationContentUriRules>
<uap:Rule Match="ms-appx-web:///" Type="include" WindowsRuntimeAccess="all" />
</uap:ApplicationContentUriRules>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<uap:Capability Name="picturesLibrary" />
<iot:Capability Name="systemManagement" />
</Capabilities>
</Package>
The hovering error looks like a bug with something(VS?), I'm seeing it multiple times, yet my code still compiles and runs OK.
No worries on this.

why does cordova app hang on launch in xcode with cpu 100%?

cordova version 5.0.0
xcode version 7.3
i have a cordova app (with ember.js) that, when launched, hangs on launch in xcode. this does not happen every time, it is intermittent. when it does happen, the cpu in cordova hovers around 100%. the app is non responsive; taps on buttons do nothing.
below is the system log, and listed here are the plugins being used. how can i begin to debug this? i can't connect to the app with safari debugger; the app is listed in the develop menu but the debugger is blank.
plugins:
<plugin name="cordova-plugin-crosswalk-webview" spec="1.5.0" />
<plugin name="cordova-plugin-device" spec="1.1.1" />
<plugin name="cordova-plugin-statusbar" spec="2.1.0" />
<plugin name="cordova-plugin-network-information" spec="1.2.0" />
<plugin name="cordova-plugin-inappbrowser" spec="1.2.0" />
<plugin name="cordova-plugin-appsee" spec="2.1.55" />
<plugin name="ionic-plugin-keyboard" spec="1.0.8" />
<plugin name="sk.kcorp.cordova.ios-security" spec="https://github.com/robertklein/cordova-ios-security.git" />
<plugin name="cordova-plugin-whitelist" spec="https://github.com/sovolve/cordova-plugin-whitelist.git" />
<plugin name="cordova-plugin-contacts" spec="2.0.1" />
<preference name="android-windowSoftInputMode" value="adjustPan" />
<preference name="android-configChanges" value="orientation|keyboardHidden" />
<plugin name="cordova-plugin-facebook4" spec="~1.4.1">
<variable name="APP_ID" value="1650330931884748" />
<variable name="APP_NAME" value="Wonder" />
</plugin>
<plugin name="onesignal-cordova-plugin" spec="~1.11.2" />
last chunk of system log (there's a lot more, too much to fit here)
http://pastebin.com/7HzgP4eB
Which version of cordova-ios are you running? Version 4.0.0 of cordova-ios had a bug which caused 100% CPU usage on launch (see https://issues.apache.org/jira/browse/CB-10276 for more information). This has been fixed since 4.1.0. You can check by running this command:
cordova platform version
To update to the latest version, run:
cordova platform update ios

Telerik AppBuilder Using Custom Plugin

I have recently started some app development with Telerik's AppBuilder and am running into one thing that I'm not certain of. I added a custom plugin to my project (Cordova Local Notifications Plugin) which seemed to work (it shows up in my solution now under a Plugins folder), but I have no idea how to reference the scripts and such from it. According to the Telerik documentation (Reference the Custom Plugin in index.html and config.xml), they say to add includes for anything with in the plugin.xml file, yet this plugin doesn't have that.
Any ideas on how I reference their script so I can start using it? Do I just reference Plugins/cordova-plugin-local-notifications-master/www/local-notification.js file direct or something else? Here is their plugin.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="de.appplant.cordova.plugin.local-notification"
version="0.8.0dev">
<name>LocalNotification</name>
<description>The purpose of the plugin is to create an platform independent javascript interface for Cordova based mobile applications to access the specific Notification API on each platform.</description>
<repo>https://github.com/katzer/cordova-plugin-local-notifications.git</repo>
<keywords>notification, local notification, alarm, scheduler, tile, live tiles, ios, android, windows phone 8, wp8</keywords>
<license>Apache 2.0</license>
<author>Sebastián Katzer</author>
<engines>
<engine name="cordova" version=">=3.0.0" />
</engines>
<dependency id="org.apache.cordova.device" url="https://github.com/apache/cordova-plugin-device" />
<js-module src="www/local-notification.js" name="LocalNotification">
<clobbers target="plugin.notification.local" />
</js-module>
<!-- ios -->
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="LocalNotification">
<param name="ios-package" value="APPLocalNotification" onload="true" />
<param name="onload" value="true" />
</feature>
</config-file>
<header-file src="src/ios/APPLocalNotification.h" />
<source-file src="src/ios/APPLocalNotification.m" />
</platform>
<!-- android -->
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="LocalNotification">
<param name="android-package" value="de.appplant.cordova.plugin.localnotification.LocalNotification"/>
</feature>
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<!--
* The alarm receiver is triggered when a scheduled alarm is fired. This class
* reads the information in the intent and displays this information in the
* Android notification bar. The notification uses the default notification
* sound and it vibrates the phone.
-->
<receiver android:name="de.appplant.cordova.plugin.localnotification.Receiver" />
<!--
* This class is triggered upon reboot of the device. It needs to re-register
* the alarms with the AlarmManager since these alarms are lost in case of
* reboot.
-->
<receiver android:name="de.appplant.cordova.plugin.localnotification.Restore" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!--
* The receiver activity is triggered when a notification is clicked by a user.
* The activity calls the background callback and brings the launch inten
* up to foreground.
-->
<activity android:name="de.appplant.cordova.plugin.localnotification.ReceiverActivity" android:launchMode="singleInstance" />
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
</config-file>
<lib-file src="libs/android/android-support-v4.jar" />
<source-file src="src/android/LocalNotification.java" target-dir="src/de/appplant/cordova/plugin/localnotification" />
<source-file src="src/android/Receiver.java" target-dir="src/de/appplant/cordova/plugin/localnotification" />
<source-file src="src/android/Options.java" target-dir="src/de/appplant/cordova/plugin/localnotification" />
<source-file src="src/android/Restore.java" target-dir="src/de/appplant/cordova/plugin/localnotification" />
<source-file src="src/android/ReceiverActivity.java" target-dir="src/de/appplant/cordova/plugin/localnotification" />
</platform>
<!-- wp8 -->
<platform name="wp8">
<config-file target="config.xml" parent="/*">
<feature name="LocalNotification">
<param name="wp-package" value="LocalNotification"/>
</feature>
</config-file>
<source-file src="src/wp8/LocalNotification.cs" />
<source-file src="src/wp8/Options.cs" />
</platform>
</plugin>
Any JavaScript file references are automatically inserted into your app when AppBuilder creates a build, so there is really not much you have to do aside from including the plugin. BTW, you should look for custom plugins first on the Verified Plugins Marketplace - which includes instructions on including the plugin in your AppBuilder project.

Resources