Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@capacitor/geolocation doesn't error if google services are not installed #700

Closed
linhaihero opened this issue Nov 23, 2021 · 9 comments
Closed

Comments

@linhaihero
Copy link

Discussed in ionic-team/capacitor#5251

Originally posted by linhaihero November 18, 2021
Hello everyone, I am using capacitor for the first time. I follow the steps of https://capacitorjs.com/solution/vue and want to try to make a Hello world. I have added permission in AndroidManifest.xml and allowed it in my phone. Then it didn't work properly, and I couldn't understand the error displayed on the console. Please help, Tell me why, what happened ? thanks thanks thanks thanks~~

image
image
image
image

@jcesarmobile
Copy link
Member

Are you testing on a real device or an emulator?
That error doesn’t come from Capacitor, but from the GPU.
If you are testing on an emulator, try creating a new one.
You should pick one that includes google services since geolocation plugin uses google’s location services.

@linhaihero
Copy link
Author

Are you testing on a real device or an emulator? That error doesn’t come from Capacitor, but from the GPU. If you are testing on an emulator, try creating a new one. You should pick one that includes google services since geolocation plugin uses google’s location services.

Oh, I tested it on a real device. Where is "Google Location Service" introduced? Are there any links to related materials? I thought it was enough to increase the permissions. . Thank you~~

@jcesarmobile
Copy link
Member

It’s not something you need to configure in your app, the plugin uses google services under the hood, nothing you should worry about, but it doesn’t work in some emulators.
It can also happen in some real devices in countries where google services are not allowed, such as China, but I think it should return an error saying that the location is not available. Isn’t there any more messages after that?
Can you check in google chrome instead of logcat?
put this in your desktop chrome and you should see your app and you can then inspect web errors
chrome://inspect

@linhaihero
Copy link
Author

It’s not something you need to configure in your app, the plugin uses google services under the hood, nothing you should worry about, but it doesn’t work in some emulators. It can also happen in some real devices in countries where google services are not allowed, such as China, but I think it should return an error saying that the location is not available. Isn’t there any more messages after that? Can you check in google chrome instead of logcat? put this in your desktop chrome and you should see your app and you can then inspect web errors chrome://inspect

Thank you very much for your reply. I am here in China, but I used VPN, and the problem still exists on the phone. .
image
image

It is normal on my pc chrome..
image

@jcesarmobile
Copy link
Member

A VPN won't help you in this case, the plugin needs this "app" to be installed (google play services)
https://play.google.com/store/apps/details?id=com.google.android.gms

I thought it would error if it wasn't installed, but looks like it doesn't will look into it.

@jcesarmobile jcesarmobile transferred this issue from ionic-team/capacitor Nov 23, 2021
@jcesarmobile jcesarmobile changed the title [vue] about '@capacitor/geolocation' ,Hello world not work @capacitor/geolocation doesn't error if google services are not installed Nov 23, 2021
@linhaihero
Copy link
Author

A VPN won't help you in this case, the plugin needs this "app" to be installed (google play services) https://play.google.com/store/apps/details?id=com.google.android.gms

I thought it would error if it wasn't installed, but looks like it doesn't will look into it.

Probably not. The test phone already has a full Google service👇

Screenshot_2021-11-23-21-26-31-255_com miui securitycenter

When I click on the link in your reply 👇

Screenshot_2021-11-23-21-26-40-420_com android vending

@jcesarmobile
Copy link
Member

can you update the plugin to the latest version and see if it returns an error or still hangs?

@jcesarmobile
Copy link
Member

closing due to the lack of response, the plugin should error now if google Play Services are not available

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants