0

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'

CodeChanger
  • 7,953
  • 5
  • 49
  • 80
Emma
  • 101
  • 1
  • 11

2 Answers2

1

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

dherediat
  • 146
  • 13
  • Hi, dherediat, I followed your command, when I run "ionic cordova platform add android", there is another error: Failed to install 'com.synconset.imagepicker': – Emma Apr 10 '18 at 06:15
  • Installing "com.synconset.imagepicker" for android Error during processing of action! Attempting to revert... Failed to install 'com.synconset.imagepicker': Error: Uh oh! ENOENT: no such file or directory, open '/Users/xxx/Desktop/xxx/platforms/android/AndroidManifest.xml' – Emma Apr 10 '18 at 06:16
  • looks like that dont exists android manifest, i'll try open with android studio for another problem with gradle or something... – dherediat Apr 10 '18 at 06:24
  • I work on MAC mini, need use google map in my project, I don't know the android thing. – Emma Apr 10 '18 at 06:28
  • Then it will show me the error "missing variable API_KEY_FOR_ANDROID". I removed Android and add android@6.4.0, now android is OK, while it stuck at ios. The message is as below: "Plugin "cordova-plugin-googlemaps" already installed on android. Installing "cordova-plugin-googlemaps" for ios apple-xcode version check failed ("/Users/xxx/Desktop/xxx/platforms/ios/cordova/apple_xcode_version"), continuing anyways. apple-ios version check failed ("/Users/xxx/Desktop/xxx/platforms/ios/cordova/apple_ios_version"), continuing anyways." – Emma Apr 10 '18 at 06:43
  • XCode Version 9.3 (9E145) – Emma Apr 10 '18 at 06:45
  • https://forum.ionicframework.com/t/add-platform-ios-failed-for-cordova-ios-3-9-2/36164/9, the solution is rm -rf ~/.cordova – dherediat Apr 10 '18 at 06:49
  • no such .cordova file in my home or project directory. – Emma Apr 10 '18 at 06:54
  • try install cocoapods with: sudo gem install cocoapods and try again – dherediat Apr 10 '18 at 06:59
  • It doesn't work, still stuck at "apple-ios version check failed" and "apple-xcode version check failed". – Emma Apr 10 '18 at 07:04
  • 1
    have apple id and dev team for this app? – dherediat Apr 10 '18 at 07:08
  • Hi, dherediat, my teammate told me maybe it is the problem with apple id and dev team, and no need to add platform for this app. At last, I followed this tutorial https://www.joshmorony.com/ionic-2-how-to-use-google-maps-geolocation-video-tutorial/ to integrate google map into my app. And use "ionic serve" to view the result on browser. This is the first time I use ionic, so I don't know the platform thing, thank you so much to teach me patiently. – Emma Apr 11 '18 at 07:51
  • you're welcome, i followed that tutorial and is a good option, if have more problems about ionic email me – dherediat Apr 11 '18 at 08:48
0

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

CodeChanger
  • 7,953
  • 5
  • 49
  • 80
  • 1
    Hi, is this "config.xml" file the one in my project folder? Or where can I find this file? There is no such line in the config.xml file. – Emma Apr 10 '18 at 06:24