Google Maps API v2 used to work on Android, now getMyLocation returns always null - google-maps-android-api-2

I believe I did everything correct because my app used to work before. Then suddenly stop working. I am not able to get current location from Google Map object, it returns always null.
I checked if my api key works on api console, request can be seen so I think it works
I tried uninstalling app, then installing again, it did not help
I tried to create a new key but this did not help neither.
I didn't post my code because I think it is correct, otherwise it wouldn't work at the beginning.​
Logcat-Errors
09-05 19:28:30.222: E/dalvikvm(5179): Could not find class 'gpq', referenced from method gpr.a
09-05 19:28:30.222: E/dalvikvm(5179): Could not find class 'gpq', referenced from method gpr.a
09-05 19:28:30.222: E/dalvikvm(5179): Could not find class 'gpq', referenced from method gpr.a
09-05 19:28:30.342: E/dalvikvm(5179): Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method gls.a
Logcat: http://pastebin.com/RPJLr6F2
EDIT: I found out that cause of the problem is my device (nexus 5,Kitkat 4.4.4), it worked properly on another device(Jelly Bean 4.1)

Looking at your logcat it is clear that your app is using a lot of memory. getMyLocation() is depreciated so use LocationClient instead.
From the documentation of getMyLocation():
Returns the currently displayed user location, or null if there is no location data available.
Null is valid data returned by getMyLocation so you will need to handle it. Just check if the value returned is null.

Related

Flutter Geolocator.isLocationServiceEnabled() isn't working as intended

I'm trying to access a location in Flutter via the Geolocator package.
This works well but the location permission check has some sort of bug.
I check if the location service is enabled. Once it's accessed i check the users permission and then return location. This works quite as intended, but there is a problem with the first step.
I use
Geolocator.isLocationServiceEnabled()
to check if the location service is enabled. Unfortunately, this function just returns in some cases which leads to the whole function not returning, even though the location service is activated.
I already searched in different forums for answers and it seems to be a known problem although i didn't find a solution yet.
Attemps i tried to get access to GPS but failed:
turning GPS off and on again
closing and opening the app again
inserted
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
in AndroidManifest
hot restart in IDE
I could just access the location if i re-run debugging, but not each time...
Does anybody have a clue how to get this built-in function to work as intended?
Thanks in advance!
I found a workaround.
I used the permission_handler package and replaced
Geolocator.isLocationServiceEnabled()
with
final hasPermission = await Permission.locationWhenInUse.serviceStatus.isEnabled;

Error: Unexpected null value while implementing flutter_google_places [flutter web]

I am using the https://pub.dev/packages/flutter_google_places package in flutter web to pick the location from google place API
but it throws an error as
Error: XMLHttpRequest error.
or sometimes
Error: Unexpected null value.
I tried to find out a solution and got one temporary solution,
i added one argument in PlacesAutocomplete.show() method as
proxyBaseUrl: kIsWeb
? 'https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api'
: null,
this link provides me temporary access to google places but after some hours it expires and needs to request again manually from this link, so it is not a workable solution at all.
so, anyone who knows how to implement flutter_google_places in flutter web then kindly helps!!
Try using this version flutter_google_places_hoc081098: ^1.1.0. it seems that one has problems.

Do PayPal smart buttons require an intent?

I recently created some buttons and copied the code directly from their website. I copied and pasted exactly what they gave me. However, when I checked this morning I noticed that there was a warning in the console. When I checked their documentation I saw that leaving the "intent" parameter empty defaulted to "capture". Now, the buttons give me the following warning: "Expected intent=subscription to be passed to SDK, but got intent=capture". I don't see "subscription" as an intent value mentioned in their documentation. Has anyone experienced this problem?
Below is the warning given in the console:
smart_button_validation_error_expected_intent_subscription
Expected intent=subscription to be passed to SDK, but got intent=capture
The warning was added recently; that intent=subscription query string parameter will be required in some future time.
The future requirement hasn't made its way into the documentation yet, but I expect you'll see it there soon.
Basically, add intent=subscription to your SDK line now when using subscriptions for them to be future-proof.
This hardly seems like a future proofing... What about if I want to use both createOrder and createSubscription with the same sdk? Adding intent=subscription breaks createOrder. What would be a proper solution in this case?

Invalid or missing URL scheme hackbook

I am trying to use facebook ios sdk but when I run the Hackbook example it gives me the error message "Invalid or missing URL scheme. You cannot run the app unti you set up a valid URL scheme in your .plist" Where do I make the changes for this?
Since one of the answers mentioned it, I will say that I have already modified the plist to have fb[my_app_id] in the URLSchemes.
This tutorial walks you through the process step by step, search for "Modify the app property list file".
I figured it out. There was another instance in the code where the ID needed to be replaced. What's odd is that it's not specifically called out as far as I can tell. I did a search for it.
you have to add like this
100% works and solved crash

Invalid product identifier

I have tried numerous ways to fix this error, but they haven't fix my problems.
I used NSLog and found out that the method productRequest:didReceiveResponse wasn't called.
But I don't know what could cause this.
Here are the things that I have tried:
Upload the binary
Delete app from the device and reinstall it from xcode
waited for a day after i submit the product in iTunes connect
checked 'clear for sale'
doubled checked that i use the full product ID when making the request
Basically i tried everything from Troy Brant's post
http://troybrant.net/blog/2010/01/invalid-product-ids/
But I'm still getting this error.
Please answer if you have any suggestion.
Ensure that you have an SKProductsRequestDelegate and that the SKProductsRequest delegate object is being set, otherwise no messages will get passed around appropriately.