mapsplugin / cordova-plugin-googlemaps

Google Maps plugin for Cordova
Apache License 2.0
1.66k stars 913 forks source link

Map isnt loading #408

Closed Encanis closed 9 years ago

Encanis commented 9 years ago

Hello, first off all thanks for the Plugin, but sadly the map isnt loading for me. I followed all the steps you had in your toturial to set up the first projekt but sadly the map isnt showing up. Do you know where the problem could be? The buttons and everything else is loading fine. It looks like this: screenshot_2015-02-18-21-45-16

wf9a5m75 commented 9 years ago

I think there is error message in Logcat, or your javascript code is dropped something.

Encanis commented 9 years ago

Hello, if i am trying to run the side in Eclipse LogCat isnt printing out any error messages. If i however start the project in the browser and start debugging it with F12 i am getting like 200000 errors with the content: cant process invalid message "". Then i tried to run your DemoApp and i am getting this errors: errormsg

wf9a5m75 commented 9 years ago

That's just jquery error. Ignore it.

Please show me the whole error log.

On Wed, Feb 18, 2015, 10:39 PM Encanis notifications@github.com wrote:

Hello, if i am trying to run the side in Eclipse LogCat isnt printing out any error messages. If i however start the project in the browser and start debugging it with F12 i am getting like 200000 errors with the content: cant process invalid message "". Then i tried to run your DemoApp and i am getting this errors: [image: errormsg] https://cloud.githubusercontent.com/assets/11065795/6262775/6b3871ba-b80a-11e4-9d7f-f9ceba10da6f.png

— Reply to this email directly or view it on GitHub https://github.com/wf9a5m75/phonegap-googlemaps-plugin/issues/408#issuecomment-75005656 .

Encanis commented 9 years ago

LogCat is dishing out way to many lines so that i could screenshot them all so i decided to save the error log into a textfile and upload it. I hope this is fine for you? Here is the link to the uploaded document you should be able to copy it from there: http://m.uploadedit.com/ba3a/142437578292.txt If you would rather prefer sceenshots tho or any other way how i could provide you the information i would gladly do it as well!

wf9a5m75 commented 9 years ago

@Encanis Thanks for your log. In the log, I found these lines:

D/CordovaLog(13351): file:///android_asset/www/js/example.js: Line 23 : Uncaught TypeError: Cannot read property 'maps' of undefined
E/Web Console(13351): Uncaught TypeError: Cannot read property 'maps' of undefined at file:///android_asset/www/js/example.js:23

This means there is incorrect in your js/example.js at line 23.

I guess you use my js/example.js https://github.com/wf9a5m75/phonegap-googlemaps-plugin/blob/master/example/DemoApp/www/js/example.js#L23

But you use the tutorial HTML. https://github.com/wf9a5m75/phonegap-googlemaps-plugin/wiki/Tutorial-for-Mac#6-change-the-wwwindexhtml

That's the reason.

wf9a5m75 commented 9 years ago

And I think you don't install this plugin correctly. If you install this plugin correctly, the plugin outputs the following message.

This app uses phonegap-googlemaps-plugin version 1.2.4

But I cannot see the message in your log.

wf9a5m75 commented 9 years ago

I also noticed that your screen capture shows chrome on Windows, but this plugin works only Android or iOS.

sangariv commented 9 years ago

HI,.

for me also same error.map not loading in my android device. i have installed the plugin correctly but it does not enters into mapready getmap,isavailble var map; document.addEventListener("deviceready", function() {

plugin.google.maps.Map.isAvailable(function(isAvailable, message) {
alert("avaible");
if (isAvailable) {
  var map = plugin.google.maps.Map.getMap();
  map.addEventListener(plugin.google.maps.event.MAP_READY, onMapInit);
} else {
  alert(message);
}

}); }, false);

Encanis commented 9 years ago

Yeah i couldnt get it to run when only using $> adb install phonegap-googlemaps-plugin-v1.2.4.apk ,it allways told me that i have an invalide apk file. Do you know how to fix this? I just followed the steps from this link to get it running https://github.com/wf9a5m75/phonegap-googlemaps-plugin/wiki/Tutorial-for-Windows. And i would have a last question remaining. As fare as i noticed you are using google maps v2api? is there a way how i could get the v3 api running using your plugin?

sangariv commented 9 years ago

HI,.

for me also same error.map not loading in my android device. i have installed the plugin correctly.

wf9a5m75 commented 9 years ago

Ok, Google Maps Android API v2 works over Android 2.3 though, Google Maps framework is also required.

If your phone doesn't have Google Play Store, this plugin doesn't work.

sangariv commented 9 years ago

HI i am having google play store.i am able to run your sample apk.it works fine.but in my code map is not loading.

wf9a5m75 commented 9 years ago

@sangariv, could you show me the whole error log?

sangariv commented 9 years ago

i am running the app in command line .shall i sent you the pjt

wf9a5m75 commented 9 years ago

Could you show me the logcat log?

On Fri, Feb 20, 2015, 7:19 AM sangariv notifications@github.com wrote:

i am running the app in command line

— Reply to this email directly or view it on GitHub https://github.com/wf9a5m75/phonegap-googlemaps-plugin/issues/408#issuecomment-75254525 .

sangariv commented 9 years ago

I am not able to take the logcat now.My api key is "AIzaSyAipr8g5OBGDe5GuufmFDuMPRtlZpLScI4" can u plesae check and tell.

Encanis commented 9 years ago

How do i install the project using the apk file? I just download it and than i run the console command that i posted earlier?

wf9a5m75 commented 9 years ago

@sangariv Without logcat error log, I can not support you. How to obtain it, please googling.

wf9a5m75 commented 9 years ago

@Encanis did you install this plugin using cordova command?

Encanis commented 9 years ago

Yes i did. I used your tutorial for windows to do it.

wf9a5m75 commented 9 years ago

@Encanis What cordova version do you use? Could you show me the result of $ > cordova plugin list?

On Fri, Feb 20, 2015, 8:25 AM Encanis notifications@github.com wrote:

Yes i did

— Reply to this email directly or view it on GitHub https://github.com/wf9a5m75/phonegap-googlemaps-plugin/issues/408#issuecomment-75266481 .

Encanis commented 9 years ago

Her is a screenshot of my cmd: smd

I am not entirly sure what cordova version i am using(guessing it is 4.0.0). Is there any way i can check to make sure?

Edit: Okey after i run "npm info cordova version" it tells me it is 4.2.0

wf9a5m75 commented 9 years ago

@Encanis It seems you are missing 'com.google.playservices' plugin. In order to install that, type:

$> cordova plugin add https://github.com/wf9a5m75/google-play-services
wf9a5m75 commented 9 years ago

The way to know the version of Cordova, type:

$> cordova --version

Other available commands:

$> cordova --help
Encanis commented 9 years ago

Okey thanks so i am using cordova 4.2. But i still couldnt fix the problem where it loads the wrong .js i still get that error. All i did was copie past the www folder of the DemoApp and replace the original www folder of the project with it. do i have to redirect the links that point to the .js?

wf9a5m75 commented 9 years ago

Did you install the com.google.playservices library?

wf9a5m75 commented 9 years ago

Post again:

It seems you are missing 'com.google.playservices' plugin. In order to install that, type:

$> cordova plugin add https://github.com/wf9a5m75/google-play-services
Encanis commented 9 years ago

Yes i did install it. Edit: Okey w8 a second. I did use your line you posted $> cordova plugin add https://github.com/wf9a5m75/google-play-services but for some reason it wont show up when i look at the installed plugins. So i did try to install it but it didnt work for some reason.

Encanis commented 9 years ago

Okey i looked a bit closer on the console log and it tells me Error: "git" command line tool is not installed: make sure it is accessible on your PATH. How can i fix this error?

wf9a5m75 commented 9 years ago

Please install git command https://www.youtube.com/watch?v=albr1o7Z1nw

wf9a5m75 commented 9 years ago

Or just install github for window. This is the easiest way. https://windows.github.com/

Encanis commented 9 years ago

Okey, thanks. I just installed Github but the Error is still existing do i need to add my folder to Github or do something else to get it running?

wf9a5m75 commented 9 years ago

Open your command prompt, then type $> git --version. Does this work?

Encanis commented 9 years ago

no, it says the git is either written wrong or no existing. Do you think restarting the computer would help?

wf9a5m75 commented 9 years ago

I think so.

Encanis commented 9 years ago

I just restarted my computer, but it didn't change anything. It still says that "git" is either written wrong or none existing

wf9a5m75 commented 9 years ago

Ok, in this case, download the plugin from here. https://github.com/wf9a5m75/google-play-services/archive/master.zip

Extract it, then install from local.

$> cd (your project)
$> cordova plugin add c:/....../google-play-services/
wf9a5m75 commented 9 years ago

For your future, I recommend you study about git.

Encanis commented 9 years ago

Thanks you, i will be looking into it. However if i do it the way you just explained to me i still get an error that looks like this cmd

wf9a5m75 commented 9 years ago

$> dir C:\PluginMaturaprojekt\google-play-services and $> dir C:\PluginMaturaprojekt\google-play-services\google-play-services

Encanis commented 9 years ago

If i run both of the lines it tells me ethat the file couldnt be found.

wf9a5m75 commented 9 years ago

I just want to know where the plugin.xml is located.

Encanis commented 9 years ago

german Okey i screenshotted the cmd, it is german but i think you should still be able to understand what it says: "Datei nicht gefunden" means file not found. And "Das System kann die angegebende Datei nicht finden" means "The system cant find the stated file.

wf9a5m75 commented 9 years ago

ok, forget about it.

try this way:

$> cordova plugin add com.google.playservices
Encanis commented 9 years ago

Okey, thanks it added the plugin now! However it still didnt fix the problem that it cant read the prpoerty 'maps' of undefined in the line 23 of the example.js

wf9a5m75 commented 9 years ago

So do you see the map now?

Encanis commented 9 years ago

No i sadly dont.

wf9a5m75 commented 9 years ago

Before using example.js, use simple javascript.

1) Replace www/index.html with this https://github.com/wf9a5m75/phonegap-googlemaps-plugin/wiki/Tutorial-for-Mac#6-change-the-wwwindexhtml

2) then type following commands:

$> npm -g install ios-sim ios-deploy  // only at once
$> cordova prepare
$> cordova build ios
$> cordova run ios
Encanis commented 9 years ago

Okey i used the index.html code from the link and replaced it with mine. all i did was switching up ios with android since my device is a android device. However the map still wont load up. And if i run the first command like this: npm -g install android-sim android-deploy i get some errors that looks like this: npm

wf9a5m75 commented 9 years ago

Oh, oops, you use Windows. You can not use iOS.