Software Archive
Read-only legacy content
17061 Discussions

cordova-plugin-googlemaps installation issue

sammoudi_m_
Beginner
1,251 Views

hello , 
i tried many time to install cordova-plugin-googlemaps but always i get this error message
- i get this error with git Repo installation and also local.
- in the installation process i entered both the android key and ios key 

 

0 Kudos
21 Replies
PaulF_IntelCorp
Employee
1,175 Views

The plugin you are trying to install has a dependency on another plugin (look inside the plugin.xml file), which does not get resolved properly during the install. So you need to first install the plugin that satisfies the dependency, then install the plugin that needs the dependency.

The dependency plugin is not published in the Cordova NPM registry, so you have to install it as a git repo, as follows:

Screen Shot 2016-12-15 at 15.04.52 .png

Then you can add the first plugin by ID, since it has been published to the Cordova NPM registry:

Screen Shot 2016-12-15 at 15.01.46 .png

0 Kudos
PaulF_IntelCorp
Employee
1,175 Views

We've uncovered an issue in the plugin manager that may result in that error message persisting, when you try to add a plugin as a git repo, it doesn't affect all plugins, but it does seem to have an effect on the dependency plugin. To get around that problem, you can add the dependency plugin locally by first downloading a ZIP of the plugin repo and then using the "Import local plugin" button to locate the top-level folder of that unzipped plugin on your local hard disk.

0 Kudos
sammoudi_m_
Beginner
1,175 Views

i getting the same error when using the local install for the plugin and also the the dependecy

0 Kudos
PaulF_IntelCorp
Employee
1,175 Views

Do it as I have done, above. First install the "dependency" plugin by downloading a ZIP of the repo, unzipping it, and using the "import local" option to add it to your project. Then use the NPM import option. Both are shown in the images in the order you should do them.

0 Kudos
sammoudi_m_
Beginner
1,175 Views

i have created an new project

i have downloaded the dependency plugin , unzip it and i have choosen the folder for local instalaltion , 

oppp it is the same error :(

0 Kudos
PaulF_IntelCorp
Employee
1,175 Views

Try using the local import technique for both. Remember to import the dependency plugin first.

0 Kudos
sammoudi_m_
Beginner
1,175 Views

i already tried this method . are you working on mac os system ?

0 Kudos
Paul_C_
Beginner
1,175 Views

I'm also having the same issue and error them installing the dependency via local install and Git Repo. Are there any other thoughts?

0 Kudos
sammoudi_m_
Beginner
1,175 Views

the issue is fixed

 

replace plugin.xml with

 

<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-googlemaps" version="1.4.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
    <name>phonegap-googlemaps-plugin</name>
    <js-module name="cordova-plugin-googlemaps" src="www/googlemaps-cdv-plugin.js">
        <clobbers target="cordova-plugin-googlemaps" />
    </js-module>


    <description>Google Maps native SDK for Android and iOS</description>
    <repo>https://github.com/mapsplugin/cordova-plugin-googlemaps</repo>
    <issue>https://github.com/mapsplugin/cordova-plugin-googlemaps/issues</issue>

    <license>Apache 2.0</license>

    <keywords>google,maps,geo</keywords>

    <engines>
      <engine name="cordova-android" version=">=5.1.0" />
      <engine name="cordova-ios" version=">=4.0.0" />
    </engines>

    <!-- android -->
    <platform name="android">
        <preference name="API_KEY_FOR_ANDROID" />

        <info>
             In order to run this plugin, you need to obtain Google Maps API key for Android.
             Visit https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/Installation

             Check our release notes.
             https://github.com/wf9a5m75/phonegap-googlemaps-plugin/wiki/Release-Notes
        </info>

        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="GoogleMaps">
                <param name="android-package" value="plugin.google.maps.GoogleMaps" />
                <param name="onload" value="true" />
                <param name="onreset" value="true" />
            </feature>
            <feature name="External">
                <param name="android-package" value="plugin.google.maps.External" />
            </feature>
            <feature name="Geocoder">
                <param name="android-package" value="plugin.google.maps.MyGeocoder" />
            </feature>
        </config-file>

        <framework src="com.google.android.gms:play-services-maps:9.8.0" />
        <framework src="com.google.android.gms:play-services-location:9.8.0" />

        <!-- plugin src files -->
        <source-file src="src/android/plugin/google/maps/AsyncLicenseInfo.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/AsyncKmlParser.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/AsyncLoadImage.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/AsyncLoadImageInterface.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/GoogleMaps.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/MyPlugin.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/MyPluginLayout.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/MyPluginInterface.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginCircle.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/External.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/MyGeocoder.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginGroundOverlay.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginKmlOverlay.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginMap.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginMarker.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginPolygon.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginPolyline.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginTileOverlay.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginTileProvider.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginUtil.java" target-dir="src/plugin/google/maps" />
        <source-file src="src/android/plugin/google/maps/PluginAsyncInterface.java" target-dir="src/plugin/google/maps" />

        <config-file target="AndroidManifest.xml" parent="/manifest/application">
            <meta-data
              android:name="com.google.android.geo.API_KEY"
              android:value="$API_KEY_FOR_ANDROID" />
            <!-- Google Play Services SDK -->
            <meta-data android:name="com.google.android.gms.version"
                       android:value="@integer/google_play_services_version" />
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/manifest">
            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
            <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
            <!-- The following two permissions are not required to use
                 Google Maps Android API v2, but are recommended. -->
            <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
            <!-- OpenGL ES version 2 -->
            <uses-feature android:glEsVersion="0x00020000" android:required="true" />
            <!-- GPS -->
            <uses-feature android:name="android.hardware.location" />
            <uses-feature android:name="android.hardware.location.gps" />
        </config-file>
    </platform>

    </plugin>

 

 

add a variable and try to import the local plugin again

it works

0 Kudos
Paul_C_
Beginner
1,175 Views

It just looks like you've removed the iOS section so the plugin will only work for Android. This won't get things working for iOS... am I correct?

0 Kudos
sammoudi_m_
Beginner
1,175 Views

yeah , you can now develop your android application , then install mac os on virtual machine and re-install the plugin and then generate the ios application

0 Kudos
Paul_C_
Beginner
1,175 Views

Thanks, I get the Android part... works perfectly.

I think the iOS version needs to work better than that in XDK...

But as you say development can at least be carried out.

 

Any thought to get the iOS plugin working on Windows PC development?

0 Kudos
PaulF_IntelCorp
Employee
1,175 Views

We have been able to install these plugins on both Windows and Mac machines using the "import local" method. Not sure why the workaround is not working for you guys. We'll try again, but if we are unable to reproduce we will have difficulty coming up with a fix.

0 Kudos
Paul_C_
Beginner
1,175 Views

That's fair enough Paul. Thanks for looking in to this or us.

0 Kudos
Paul_C_
Beginner
1,175 Views

I've created a new project and downloaded the dependancy plugin from https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk

Extracted and tried to install the plugin locally. I get the error below...

xdk error_0.jpg

0 Kudos
sammoudi_m_
Beginner
1,175 Views

Paul C, 
could you please help me how to add multiple markers on the map , from an array ?

0 Kudos
Paul_C_
Beginner
1,175 Views

 

0 Kudos
Paul_C_
Beginner
1,175 Views

When you look are plugin file structure there is no Resources folder within the 'Versions\A' folder

Paul C. wrote:

I've created a new project and downloaded the dependancy plugin from https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk

Extracted and tried to install the plugin locally. I get the error below...

0 Kudos
Ricardo__Perez
Beginner
1,175 Views

I have the same problem :( 

Adding the Repo URL with the Git repo option, adding my variables and Uh ! , the same error :,c

error_1.PNG

error_2.PNG

 

0 Kudos
PaulF_IntelCorp
Employee
910 Views

It looks like that plugin is using a symbolic link, which is failing on Windows (I tried this on a Windows 8.1 system). This is not something I believe the XDK can detect and automatically fix for you, it is a problem with the way that plugin is configured. Using symbolic links is not guaranteed to be transportable between multiple filesystems and operating systems.

If you modify the copy of the plugin.xml file to be similar to this:

<?xml version='1.0' encoding='UTF-8'?>
<plugin id="com.googlemaps.ios" version="2.1.1" xmlns="http://apache.org/cordova/ns/plugins/1.0">
  <name>Google Maps SDK for iOS</name>
  <description>Install the Google Maps SDK for iOS without CocoaPods</description>
  <keywords>cordova, ios, googlemaps</keywords>
  <license>MIT</license>
  <engines>
    <engine name="cordova-ios" version=">=3.0.0" />
  </engines>

  <platform name="ios">
    <!-- system frameworks -->
    <framework src="Accelerate.framework" />
    <framework src="CoreData.framework" />
    <framework src="CoreGraphics.framework" />
    <framework src="CoreLocation.framework" />
    <framework src="CoreText.framework" />
    <framework src="GLKit.framework" />
    <framework src="ImageIO.framework" />
    <framework src="libc++.tbd" />
    <framework src="libz.tbd" />
    <framework src="OpenGLES.framework" />
    <framework src="QuartzCore.framework" />
    <framework src="SystemConfiguration.framework" />
    <framework src="UIKit.framework" />
    <framework src="Base/Frameworks/GoogleMapsBase.framework" custom="true"/>
    <framework src="Maps/Frameworks/GoogleMaps.framework" custom="true"/>
    <framework src="Maps/Frameworks/GoogleMapsCore.framework" custom="true"/>
    <!-- <resource-file src="Maps/Frameworks/GoogleMaps.framework/Versions/A/Resources/GoogleMaps.bundle"/> -->
    <resource-file src="Maps/Frameworks/GoogleMaps.framework/Resources/GoogleMaps.bundle"/>
  </platform>
</plugin>

it will work.

Following are the steps I went through. On the last image you can see that it is a Windows machine the XDK is running on. It's only necessary to download and modify the dependency plugin (as I have changed it above) and then you can use NPM to install the other plugin.

705862-1_censored.jpg

705862-2_censored.jpg

705862-3.png

705862-4_censored.jpg

705862-5.png

705862-6.png

705862-7.png

705862-8.png

705862-9.png

 

0 Kudos
Reply