ionic cordova plugin add ERROR - google-maps

When run this command:
ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="google-api-key" --variable API_KEY_FOR_IOS="google-api-key"
The ERROR occurs:
Installing "cordova-plugin-googlemaps" for android
Failed to install 'cordova-plugin-googlemaps': Error: ENOENT: no such
file or directory, open
'/Users/xxx/Desktop/xxx/platforms/android/AndroidManifest.xml'

i have sometimes the same problem, have open sublime or something like notepad?
if you have opened some notepad, check if exists the android directory and click inside of him(sometimes dont remove this directory with the notepad opened)
if dont exists the directory, the problem is easy you dont have the directory. You must to do these commands inside ionic proyect.
For ionic:
ionic platflorm remove android
ionic platform add android
For cordova cli:
ionic cordova platflorm remove android
ionic cordova platform add android
For check ionic version inside proyect:
ionic info
Greetings dherediat

As per Cordova Android CLI version 7.0.0 release note you need to change your AndroidManifest.xml path as mention below
This may affect plugin.xml files and config.xml files that use
edit-config, and make it so plugins that use edit-config will not be
able to be compatible with both Android 6.x and Android 7.x. To fix
this issue, please do the following in your XML files:
<!-- An existing config.xml -->
<edit-config file="AndroidManifest.xml" target="/manifest/application" mode="merge">
<!-- needs to change to -->
<edit-config file="app/src/main/AndroidManifest.xml" target="/manifest/application" mode="merge">
Check this official release note for Cordova Android CLI 7.0.0 Release Note.
Hope this will helps to solve your problem

Related

How to fix 'Google services version conflict (Maps / FCM)'

the problem happens after add google map plugin in this link
https://github.com/mapsplugin/ionic-googlemaps-quickdemo-v4
this google map work fine in ios but when I try to run it on android
get this error
[cordova] * What went wrong:
[cordova] Execution failed for task
':app:processDebugGoogleServices'.
[cordova] > Please fix the version conflict either by updating the
version of the google-services plugin (information about the latest
version is available at https://bintray.com/android/android-
tools/com.google.gms.google-services/) or updating the version of
com.google.android.gms to 10.+.
[cordova]
[cordova] * Try:
[cordova] Run with --stacktrace option to get the stack trace. Run
with --info or --debug option to get more log output. Run with --
scan to get full insights.
[cordova]
[cordova] * Get more help at https://help.gradle.org
[cordova]
[cordova] BUILD FAILED in 38s
[ERROR] An error occurred while running subprocess cordova.
cordova build android exited with exit code 1.
I try all these solutions but not work for me but work for someone
1- https://forum.ionicframework.com/t/ionic-processdebuggoogleservices-version-conflict/132560
2- https://github.com/arnesson/cordova-plugin-firebase/issues/1093
3- https://forum.ionicframework.com/t/execution-failed-for-task-app-processdebuggoogleservices-please-fix-the-version-conflict-either-by-updating-the-version-of-the-google-services-plugin-version-of-com-google-android-gms-to-11-8-0/125610
4- https://forum.ionicframework.com/t/google-services-version-conflict-maps-fcm/93695/51
5- https://forum.ionicframework.com/t/google-services-version-conflict-maps-fcm/93695
The problem happens because I am using the old version from FCM plugin it works fine before adding google map plugin the conflict happens because of the 10.+ and 15.0.1 not the same and not compatible.
cordova.system.library.2=com.google.firebase:firebase-core:10.+
cordova.system.library.3=com.google.firebase:firebase-messaging:10.+.
and
cordova.system.library.4=com.google.android.gms:play-services-maps:15.0.1
cordova.system.library.5=com.google.android.gms:play-services-location:15.0.1
the solution is very simple and funny for me on these steps
1- uninstall fcm plugin using this command.
ionic cordova plugin rm cordova-plugin-fcm-with-dependecy-updated
2- install fcm plugin
ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated
3- remove the android platform
ionic cordova platform rm android
4- add android platform
ionic cordova platform add android
now everything is ok
go to android platform and open project.properties
you found the changes
like that
cordova.system.library.2=com.google.firebase:firebase-core:16.0.9
cordova.system.library.3=com.google.firebase:firebase-messaging:18.0.0
now run
ionic cordova run android
I hope that helpfull anyone thanks.

Is it possible to integrate an external website into ionic app?

I want to create a Ionic app which only shows a external website.
How can I do this?
Thanks for help.
I feel you can use cordova plugin to opening a link with your app, Also you can use the custom-url-scheme (cordova-plugin) So you can open external link on your app as on this way testapp://path?foo=bar.
Refer to this : Here the Link
================================================================================
So install InAppBrowser:
ionic cordova plugin add cordova-plugin-inappbrowser
npm install --save #ionic-native/in-app-browser
you can call as like:
window.open(url, '_system');
As described here : Refer the Link and also document

Ionic 2 - Google Maps working in browser, but not device

I have the following implementation of Google Maps api (see link below). It works perfectly when I run ionic serve and test it in a browser. However, when I do cordova build and deploy the apk to my android 6.0.1 phone, it fails. The map does not load and it hangs on the loading spinner.
If anyone has any ideas, I would appreciate the help.
Thanks
https://forum.ionicframework.com/t/google-maps-working-in-browser-but-not-device/58819
SOLVED:
I ran the following, and low the map loads on the device too:
cordova plugin add cordova-plugin-geolocation
Run the following commands:
ionic plugin add cordova-plugin-geolocation
and
npm install --save #ionic-native/geolocation`
This link would be helpful.

What does this Cordova registry warning mean in the github facebook login plugin documentation?

After navigating to the github documentation for facebook from intel xdk plugin management section the second most prominent thing you see on the page is this.
<< --- Cordova Registry Warning [iOS]
Installing this plugin directly from Cordova Registry results in Xcode using a broken FacebookSDK.framework, this is because the current publish procedure to NPM breaks symlinks CB-6092. Please install the plugin through a locally cloned copy or re-add the FacebookSDK.framework to Xcode after installation.
------------------------------------------ >>
The link the the github page is here
https://github.com/Wizcorp/phonegap-facebook-plugin.
Can someone explain what this really means? It's already terribly confusing to get the basic fb login up and running on my mobile app, this warning is confusing the process for me even more as it assumes I know more than I do.
Can someone break this down in beginner terms? Thank you.
Problem
The FacebookSDK.framework will be delivered broken if you fetch it from NPM, because the publish procedure to NPM breaks symlinks. I can't tell you more then that.
Workaround
The workaround is cloning the repository of the plugin 'phonegap-facebook-plugin' with GIT and adding the plugin to your PhoneGap/Cordova project.
Enter the following command in your CMD or Terminal to clone the repository:
git clone https://github.com/Wizcorp/phonegap-facebook-plugin
Enter the following command in your CMD or Terminal to add the plugin to your PhoneGap/Cordova project:
cordova -d plugin add /path/to/cloned/phonegap-facebook-plugin --variable APP_ID="123456789" --variable APP_NAME="myApplication"
Solution
The developers of the plugin 'phonegap-facebook-plugin' have a solution for cordova > 4.0.0 in the develop branche of the plugin's repository.
More info for installing the plugin:
Android
iOS

How to change config settings on local ios phonegap build from the new Phonegap CLI?

FYI; Phonegap CLI: http://log.michaelbrooks.ca/post/phonegap-cli-preview
So, after making a build with the new Phonegap CLI, getting a project with the new Phonegap 3.0, I wanted to run my application on an ios simulator:
> phonegap local run ios
This successfully install the phonegap application onto the IOS 6.1 simulator and runs it- all good so far. Problem is that all REST-functionality is not working. I dig around and find out that the phonegap local run ios automatically creates a ios xcode project at /platforms/ios/. Inside this folder I can locate a config.xml-file with access origin set to only allow http://127.0.0.1*. Now, I want to change this, so I do. Problem is that when I run phonegap local run ios again the old config file is back.
So basically, the questions end out in:
How do I change the Phonegap configuration settings when using Phonegap CLI?
Ah, I feel very embarrassed now, but I think its better to share then to delete :)
If you have a config.xml file in your www-folder (which shipped originally, but I have removed) you can change the values from there. This file will be copied over.
So in my config.xml-file inside my apps www-folder I found:
<access origin="http://127.0.0.1*"/>
Just before the last tag, . I changed this to:
<access origin="*"/>
And then everything worked :)