Notification plugin not working phonegap 3.0 for iphone - iphone

I am developing an app with phonegap 3.0.0. I need to show the confirm dialog so I added the Notification plugin from phonegap CLI with the following command (as described in CLI Documentation):
$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
But now I can't build the project. When I try to build it fails with following error:
** BUILD FAILED **
The following build commands failed:
CompileC build/CamTest.build/Debug-iphonesimulator/CamTest.build/Objects-normal/i386/CDVNotification.o CamTest/Plugins/org.apache.cordova.dialogs/CDVNotification.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
When I remove the Notification plugin everything works fine. I've also tried to add the following in my config.xml (CamTest/www/config.xml) to no effect:
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>
Please someone tell me how to work with plugins in Phonegap 3.0.0. I am trying it on iphone simulator. Thanks.

We were facing the same problem, but before we added the required lines in config.xml. So, the following two step process also mentioned in this and this link solved the problem.
On the command line
$ cordova plugin add
https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
In project's config.xml
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>

Related

ionic base64togallery plugin not working in android-targetSdkVersion 29

I'm using base64-to-gallery to save images for android devices in my ionic app.
Previously it was working fine but now after added <preference name="android-targetSdkVersion" value="29" />to config.xml file, under android platform, it's not working.
Please kindly help me with it.
Finally solved the issue. To anyone who is struggling, I will explain as below.
As mentioned in the git, https://github.com/Nexxa/cordova-base64-to-gallery , ionic Cordova base64togallery plugin has been discontinued.
And also when trying to submit the ionic mobile app for Android production, it's saying that the target SDK version should be more than 29.
But as usual, if we add <preference name="android-targetSdkVersion" value="29" /> to the config.xml file under the Android platform, it will not work the base64togallery plugin (not saving images to your device)
So you have to do like below,
In your ionic project, go to build.gradle file (platforms\android\build.gradle) and change defaultTargetSdkVersion and defaultCompileSdkVersion to 29. (as below)
defaultTargetSdkVersion=29
defaultCompileSdkVersion=29
And then go to AndroidManifest.xml file
(platforms\android\app\src\main\AndroidManifest.xml) and add android:requestLegacyExternalStorage="true" to the application tag, as showing below.
<application android:hardwareAccelerated="true" android:icon="#mipmap/ic_launcher" android:label="#string/app_name" android:networkSecurityConfig="#xml/network_security_config" android:requestLegacyExternalStorage="true" android:supportsRtl="true">
Then try to build your app for debug or release versions.

Android Build Error when using the barcodescanner and qrscanner at the same time

When I use the phonegap-plugin-barcodescanner plugin and the cordova-plugin-qrscanner plugin at the same time in a project, it won't compile for the android plattform. The error it outputs is duplicate permission element in the manifest. Upon checking I saw that this is indeed the case. However manual correction doesn't work as it will be regenerated automatically.
I documented the reproduction scenario further down. It is very simple. Maybe someone has an idea how to solve this issue? Or do you think this is a bug? But where should I open the issue in such a case?
Used version:
Ionic: 3.20.0
cordova: 8.0.0
Steps to reproduce:
Start a new project ionic start permissionissue blank (when it asks if it should integrate with the iOS and Android platform say yes, when it asks to install the ProSDK say no
Change into the project folder: cd permissionissue
Build it: ionic cordova build --release android -> Still everything is fine
Install the first plugin: ionic cordova plugin add phonegap-plugin-barcodescanner
Build it: ionic cordova build --release android -> Still everything is fine
Install the second plugin: ionic cordova plugin add cordova-plugin-qrscanner
Try to build it: ionic cordova build --release android -> Now it breaks
It will show the following error:
> Manifest merger failed with multiple errors, see logs
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug
option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
23 actionable tasks: 3 executed, 20 up-to-date
(node:12659) UnhandledPromiseRejectionWarning: Error: .../permissionissue/platforms/android/gradlew: Command failed with exit code 1 Error output:
.../permissionissue/platforms/android/app/src/main/AndroidManifest.xml:19:5-90 Error:
Element uses-permission#android.permission.CAMERA at AndroidManifest.xml:19:5-90 duplicated with element declared at AndroidManifest.xml:16:5-65
.../permissionissue/platforms/android/app/src/main/AndroidManifest.xml:20:5-85 Error:
Element uses-feature#android.hardware.camera at AndroidManifest.xml:20:5-85 duplicated with element declared at AndroidManifest.xml:18:5-84
.../permissionissue/platforms/android/app/src/main/AndroidManifest.xml Error:
Validation failed, exiting
FAILURE: Build failed with an exception.
The generated Manifest looks like this:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-permission android:name="android.permission.CAMERA" android:required="false" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.front" android:required="false" />
As you can see the CAMERA is once requested by itself and once with required false.
I had similar issue using cordova-plugin-camera-preview & cordova-plugin-qrscanner
What helped me was:
1. Go to plugins/cordova-plugin-qrscanner/plugin.xml
remove entries within
<config-file target="AndroidManifest.xml" parent="/*">
...
</config-file>
run
ionic cordova platform remove android
run
ionic cordova platform add android
This is how my <platform> section look like, from plugin.xml of cordova-plugin-qrscanner
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="QRScanner">
<param name="android-package" value="com.bitpay.cordova.qrscanner.QRScanner"/>
</feature>
</config-file>
<config-file target="AndroidManifest.xml" parent="/*">
<!-- <uses-permission android:name="android.permission.CAMERA" android:required="false" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.front" android:required="false" /> -->
</config-file>
<source-file src="src/android/QRScanner.java" target-dir="src/com/bitpay/cordova/qrscanner"/>
<framework src="src/android/qrscanner.gradle" custom="true" type="gradleReference"/>
</platform>
Worked for me, hope it help you as well.

Push plugin - Found item String/google_app_id more than one time

I'm using Ionic2 and I just installed Push plugin into the App, and now its createing a duplicate of #string/google_app_id
Even if i delete one of them, when i run the project, ionic creates another one and I can't compile the app due to this error.
So this is what i get in the strings.xml
<string name="google_app_id">#string/google_app_id</string>
<string name="google_app_id" translatable="false">XXXXXXXXXX</string>
I tried removing the platform and the plugin and add it again to the proyect, but the error keeps showing.
Thank you all!!
You can see here that the firebase plugin does not handle the app id and api key.
In your case you can do this after installing the firebase plugin. Go to plugins folder and open cordova-plugin-firebase\plugin.xml and remove these lines,
<config-file parent="/resources" target="res/values/strings.xml">
<string name="google_app_id">#string/google_app_id</string>
</config-file>
Then add the android platform. Now you can build/run your android app.
This seems to be an issue introduced with version 0.1.24
replaced:
<plugin name="cordova-plugin-firebase" spec="^0.1.24" />
for:
<plugin name="cordova-plugin-firebase" spec="0.1.22" />
removed and readded the platform and is working fine!
No need to touch the plugin code
I used this command bellow:
$ cordova clean android

Unable to find unity activity in manifest. UnityEditor.HostView:OnGUI()?

i had a problem when build an run Google CardBoard SDK for Unity.
some one can solve it?
I used:
Unity 4.2
Device: Lg - p925 ( android 4.04)
the Console in Unity Edit show:
Unable to find unity activity in manifest. You need to make sure orientation attribute is set to landscape manually.
UnityEditor.HostView:OnGUI()
Installation failed with the following output:
pkg: /data/local/tmp/Package.apk
Failure [INSTALL_FAILED_OLDER_SDK]
rm failed for -f, No such file or directory
2127 KB/s (9391146 bytes in 4.311s)
UnityEditor.HostView:OnGUI()
Error building Player: UnityException: Unable to install APK!
Installation failed. See the Console for details.
please!
About the message Unable to find unity activity in manifest., try adding the following line inside the <activity> tag in AndroidManifest.xml (found in Assets/Plugins/Android):
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
Look at the Manifest
<uses-sdk android:minSdkVersion="16" />
Your Device is 15.

phonegap facebook connect fail on iphone 4 and iphone 5

I'm developing an ios app with PhoneGap 3.4 which connects to facebook
I used this plugin to connect to facebook: https://github.com/phonegap/phonegap-facebook-plugin
everything works in emulators provided by xcode 5.1.
I tested the app on iphone 3gs and the connection to Facebook still works.
tested also with iphone 4s and facebook connection does not work: FB.login is not called.
the same happens on the iphone 5s.
no error in the xcode console and even in the safari console under developer mode.
the plugin is out of date
Make sure set your config.xml correctly
<access origin="https://m.facebook.com" />
<access origin="https://graph.facebook.com" />
<access origin="https://api.facebook.com" />
<access origin="https://*.fbcdn.net" />
<access origin="https://*.akamaihd.net" />
<feature name="org.apache.cordova.facebook.Connect">
<param name="ios-package" value="FacebookConnectPlugin" />
</feature>
OR
Use this command to install your facebook phonegap plugin
cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="XXXXXXXXXXXXXX" --variable APP_NAME=“YOUR_APP_NAME
Don't ever use plugman to install cordova plugin.