Cordova InAppBrowser plugin broken for OSX platform - macos

When compiling a cordova macos app with the InAppBrowser plugin installed under Mojave 10.14.2 and Xcode 10.1 I get the following error message:
ERROR: Plugin 'InAppBrowser' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml
I've checked the config.xml, and it contains the correct entry:
<plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
I've looked in /plugins and the plugin and its xml file are there.
I've removed and added the plugin and the platform.
Taking a cue from this old (and marked fixed) bug, I manually inserted the following into the config.xml file in Xcode:
<feature name="InAppBrowser">
<param name="osx-package" value="CDVDevice" />
</feature>
That changes the error message to this:
ERROR: Method 'open:' not defined in Plugin 'InAppBrowser'
Any ideas what's going on here?

<platform name="osx">
...
<feature name="InAppBrowser">
<param name="osx-package" value="CDVInAppBrowser" />
</feature>
...
</platform>
This works for me.

Related

Upgrading to Cordova ios6 causes errors in xcode for project

I am able to successfully build and run my app in ios5, but when I upgrade to ios6.1.0 in order to install a plugin that will allow me to use VKwebview and reference local html files, I get 3 fatal errors in xcode:
Property 'userAgent' not found on object of type 'CDVViewController *'
Use of undeclared identifier 'CDVUserAgentUtil'. (these are repeated twice)
I am at a total loss as to even start looking for the answers.
This is my config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.slate.v2" version="1.3.1" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>ACCELERATE RMS</name>
<description>
M-learning accelerated.
</description>
<author email="support#phonegap.com" href="http://phonegap.com">
Cnnect
</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="*" />
<icon density="mdpi" height="57" platform="ios" src="icon.png" width="57" />
<config-file overwrite="true" parent="NSCameraUsageDescription" platform="ios" target="*-Info.plist">
<string>Allow the app to use your camera to take your profile picture.</string>
</config-file>
<preference name="AllowInlineMediaPlayback" value="true" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<platform name="ios">
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</platform>
<platform name="ios">
<preference name="Orientation" value="all" />
</platform>
<engine name="browser" spec="^5.0.4" />
<plugin name="phonegap-plugin-contentsync" spec="~1.4.2" />
<plugin name="cordova-plugin-camera" spec="~4.0.3" />
<plugin name="cordova-plugin-geolocation" spec="~4.0.1" />
<plugin name="cordova-plugin-file" spec="~6.0.1" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.3" />
<plugin name="cordova-plugin-dialogs" spec="~2.0.1" />
<plugin name="cordova-plugin-local-notification" spec="~0.9.0-beta.3">
<variable name="ANDROID_SUPPORT_V4_VERSION" value="26.+" />
</plugin>
<plugin name="phonegap-plugin-barcodescanner" spec="~8.0.1" />
<plugin name="onesignal-cordova-plugin" spec="~2.8.1" />
<plugin name="cordova-plugin-file-transfer" spec="~1.7.1" />
<plugin name="cordova-plugin-wkwebview-engine" spec="^1.2.1" />
<plugin name="cordova-plugin-wkwebviewxhrfix" spec="~0.1.0" />
</widget>
CDVUserAgentUtil has been removed in cordova-ios#6 which is a breaking change (hence the major version increment in cordova-ios to 6).
This class is used by some Cordova plugins in your project hence the error.
You should first update all of your plugins to the latest versions so those which have been updated to removed references to CDVUserAgentUtil are used.
At least one of your plugins - cordova-plugin-file-transfer is deprecated and contains an implicit reference to CDVUserAgentUtil. In this case you could use my fork of this plugin which has been fixed to remove the reference:
cordova plugin rm cordova-plugin-file-transfer && cordova plugin add https://github.com/dpa99c/cordova-plugin-file-transfer
It may be that other plugins in your project still contain references to CDVUserAgentUtil after updating all your plugins.
If this is the case, you should search them for references:
grep -r -l 'CDVUserAgentUtil' plugins/
If you find any references and no plugin upates are available, you could:
raise an issue against the plugin asking for it to be updated
look for a fork of the plugin that has already been updated
fork the plugin and fix it yourself
If the build still fails after updating all your plugins to remove the references, there may be more implicit references such as that in cordova-plugin-file-transfer so you'll need to search for and resolve those:
grep -r -l 'userAgent' plugins/
The cordova-plugin-wkwebview-engine is deprecated in Cordova iOS#6.x for more details see, from Cordova iOS#6.x onwards it by defaults supports WKWebView not UIWebView. So, you need to remove the Cordova plugin from your project.
cordova plugin rm cordova-plugin-wkwebview-engine
Note : Please backup your project before doing any change for your safety.
For ionic v5 users
I have fixed this by upgrading cordova-plugin-ionic-webview to 4.2.1
hopping this help

Error in Manifest merger - Nativescript 5.1

I am having this gradle error when I try to build my app. I have added the suggestion given by the CLI but its not working.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.FILE_PROVIDER_PATHS#resource value=(#xml/provider_paths) from [:nativescript_camera:] AndroidManifest.xml:19:17-55
is also present at [:MultiTypeFilePicker-release:] AndroidManifest.xml:46:17-51 value=(#xml/file_paths).
Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
Any help with this?
I am using NativeScript 5.1/Angular 7.
Thanks!
I have fixed this issue adding:
xmlns:tools="http://schemas.android.com/tools"
to the manifest header tag and then adding:
<provider android:name="android.support.v4.content.FileProvider" android:authorities="com.*.*.fileprovider" android:exported="false" android:grantUriPermissions="true" tools:replace="android:authorities">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/file_paths" tools:replace="android:resource" />
</provider>
inside the application tag.
Thanks!

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

Cordova WKWebView Plugin with PhoneGap Build Version 6.0.0

From the blog post about PhoneGap 6.0.0 being available on Build my understanding is that we can now use the Cordova WKWebView engine with apps build with PhoneGap Build. See:
http://phonegap.com/blog/2016/02/09/phonegap_6_now_on_build/
https://shazronatadobe.wordpress.com/2015/09/09/apache-cordova-ios-4-0-0-and-wkwebview-support/
https://github.com/apache/cordova-plugin-wkwebview-engine
I've updated my config version to include the following but am still getting the default UIWebView:
<preference name="phonegap-version" value="cli-6.0.0" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
Has anyone been able to get this working that could help?
Thanks to this post I found part of my solution http://community.phonegap.com/nitobi/topics/does-phonegap-build-support-wkwebview-with-the-new-cli-6-0 - I was missing the following line in my config.xml:
<plugin name="cordova-plugin-wkwebview-engine"/>
However, I also found that I needed to turn off Hydration to get the app past the "initialising" screen.

Resources