0

I use ionic2 for developing a hybrid app and want to use googleAPI of ionic-native in my app... now given that My PC OS is Windows10! can i use native ionic APIs which are for ios???

this question comes to head when i ran this command:

     ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="API-Key" --variable API_KEY_FOR_IOS="API-Key"

seems the google map for ios were install but for i got error when it run to install googlem map for ios!

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk',
1 verbose cli   '--production',
1 verbose cli   '--save' ]
2 info using npm@3.10.10
3 info using node@v6.10.3
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk
8 silly fetchOtherPackageData https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk
9 silly cache add args [ 'https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk',
9 silly cache add   null ]
10 verbose cache add spec https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk
11 silly cache add parsed spec Result {
11 silly cache add   raw: 'https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk',
11 silly cache add   scope: null,
11 silly cache add   escapedName: null,
11 silly cache add   name: null,
11 silly cache add   rawSpec: 'https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk',
11 silly cache add   spec: 'git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git',
11 silly cache add   type: 'hosted',
11 silly cache add   hosted:
11 silly cache add    { type: 'github',
11 silly cache add      ssh: 'git@github.com:mapsplugin/cordova-plugin-googlemaps-sdk.git',
11 silly cache add      sshUrl: 'git+ssh://git@github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git',
11 silly cache add      httpsUrl: 'git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git',
11 silly cache add      gitUrl: 'git://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git',
11 silly cache add      shortcut: 'github:mapsplugin/cordova-plugin-googlemaps-sdk',
11 silly cache add      directUrl: 'https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps-sdk/master/package.json' } }
12 verbose addRemoteGit caching https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk
13 verbose addRemoteGit git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git is a repository hosted by github
14 silly tryClone cloning git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git via git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git
15 verbose tryClone git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 not in flight; caching
16 verbose correctMkdir C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes correctMkdir not in flight; initializing
17 info git [ 'config', '--get', 'remote.origin.url' ]
18 silly validateExistingRemote git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git remote.origin.url: https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git
19 verbose validateExistingRemote git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git is updating existing cached remote C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43
20 info git [ 'fetch', '-a', 'origin' ]
21 verbose updateRemote git fetch -a origin (https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git)
22 verbose setPermissions git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git skipping chownr on Windows
23 verbose resolveHead git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git original treeish: master
24 info git [ 'rev-list', '-n1', 'master' ]
25 silly resolveHead git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git resolved treeish: 0addb071b77be74cc1813cedea0797a207522628
26 verbose resolveHead git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git resolved Git URL: git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git#0addb071b77be74cc1813cedea0797a207522628
27 silly resolveHead Git working directory: C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628
28 info git [ 'clone',
28 info git   'C:\\Users\\asus\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43',
28 info git   'C:\\Users\\asus\\AppData\\Local\\Temp\\npm-7544-cbb63627\\git-cache-2b5ce209\\0addb071b77be74cc1813cedea0797a207522628' ]
29 error git clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628: Cloning into 'C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628'...
29 error git clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628: error: cannot spawn sh: No such file or directory
29 error git clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628: fatal: unable to fork
30 silly fetchPackageMetaData Error: Command failed: git -c core.longpaths=true clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628
30 silly fetchPackageMetaData Cloning into 'C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628'...
30 silly fetchPackageMetaData error: cannot spawn sh: No such file or directory
30 silly fetchPackageMetaData fatal: unable to fork
30 silly fetchPackageMetaData
30 silly fetchPackageMetaData     at ChildProcess.exithandler (child_process.js:204:12)
30 silly fetchPackageMetaData     at emitTwo (events.js:106:13)
30 silly fetchPackageMetaData     at ChildProcess.emit (events.js:191:7)
30 silly fetchPackageMetaData     at maybeClose (internal/child_process.js:886:16)
30 silly fetchPackageMetaData     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
30 silly fetchPackageMetaData  error for https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk { Error: Command failed: git -c core.longpaths=true clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628
30 silly fetchPackageMetaData Cloning into 'C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628'...
30 silly fetchPackageMetaData error: cannot spawn sh: No such file or directory
30 silly fetchPackageMetaData fatal: unable to fork
30 silly fetchPackageMetaData
30 silly fetchPackageMetaData     at ChildProcess.exithandler (child_process.js:204:12)
30 silly fetchPackageMetaData     at emitTwo (events.js:106:13)
30 silly fetchPackageMetaData     at ChildProcess.emit (events.js:191:7)
30 silly fetchPackageMetaData     at maybeClose (internal/child_process.js:886:16)
30 silly fetchPackageMetaData     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
30 silly fetchPackageMetaData   killed: false,
30 silly fetchPackageMetaData   code: 128,
30 silly fetchPackageMetaData   signal: null,
30 silly fetchPackageMetaData   cmd: 'git -c core.longpaths=true clone C:\\Users\\asus\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\\Users\\asus\\AppData\\Local\\Temp\\npm-7544-cbb63627\\git-cache-2b5ce209\\0addb071b77be74cc1813cedea0797a207522628' }
31 silly rollbackFailedOptional Starting
32 silly rollbackFailedOptional Finishing
33 silly runTopLevelLifecycles Finishing
34 silly install printInstalled
35 verbose stack Error: Command failed: git -c core.longpaths=true clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628
35 verbose stack Cloning into 'C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628'...
35 verbose stack error: cannot spawn sh: No such file or directory
35 verbose stack fatal: unable to fork
35 verbose stack
35 verbose stack     at ChildProcess.exithandler (child_process.js:204:12)
35 verbose stack     at emitTwo (events.js:106:13)
35 verbose stack     at ChildProcess.emit (events.js:191:7)
35 verbose stack     at maybeClose (internal/child_process.js:886:16)
35 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
36 verbose cwd D:\imanSal\apachemobile\Hellow\hell
37 error Windows_NT 10.0.10586
38 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk" "--production" "--save"
39 error node v6.10.3
40 error npm  v3.10.10
41 error code 128
42 error Command failed: git -c core.longpaths=true clone C:\Users\asus\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-mapsplugin-cordova-plugin-googlemaps-sdk-git-324aac43 C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628
42 error Cloning into 'C:\Users\asus\AppData\Local\Temp\npm-7544-cbb63627\git-cache-2b5ce209\0addb071b77be74cc1813cedea0797a207522628'...
42 error error: cannot spawn sh: No such file or directory
42 error fatal: unable to fork
43 error If you need help, you may report this error at:
43 error     <https://github.com/npm/npm/issues>
44 verbose exit [ 1, true ]

this is the log of Error. when i repeat this commend i get this first :

plugin "cordova-plugin-googlemaps" already installed for android!!!
Iman Salehi
  • 908
  • 2
  • 14
  • 34

1 Answers1

1
$> cordova platform rm android ios
$> cordova plugin rm cordova-plugin-googlemaps
$> cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="API-Key" --variable API_KEY_FOR_IOS="API-Key" --no-fetch
$> cordova platform add android ios
wf9a5m75
  • 6,100
  • 3
  • 25
  • 59
  • plz say more description about it :( – Iman Salehi Nov 01 '17 at 08:29
  • Cordova causes conflict if you did not remove the plugin completely before installing. In that case, removing platform is the easiest way to solve the problem. Did you try my suggestion? At least you should try. If you worry about this way, you just copy the project folder to another. – wf9a5m75 Nov 01 '17 at 16:25