HERE SDK: LocationManager requestLocationUpdates() RuntimeException












0














I'm using HERE Maps SDK and after calling navigationManager.startNavigation() I'm getting this exception in logs, SOMETIMES:



LocationManager: [LocationManager] requestLocationUpdates(), 
java.lang.RuntimeException
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:1013)
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:595)
at com.nokia.maps.ef.i(PlatformLocation.java:435)
at com.nokia.maps.ef.start(PlatformLocation.java:112)
at com.nokia.maps.PositioningManagerImpl.a(PositioningManagerImpl.java:192)
at com.here.android.mpa.common.PositioningManager.start(PositioningManager.java:212)
at com.nokia.maps.NavigationManagerImpl.a(NavigationManagerImpl.java:1785)
at com.nokia.maps.NavigationManagerImpl.a(NavigationManagerImpl.java:1063)
at com.here.android.mpa.guidance.NavigationManager.startNavigation(NavigationManager.java:1272)
...


Looks like the SDK is catching it because try/catch doesn't get it and nothing crashes, response is still NavigationManager.Error.NONE but navigation doesn't start.



Not sure what triggers it but the app may work fine for days and then this shows up and for few minutes or hours I can't get the navigation to work.



This exception occurs only sometimes, when the app tries to get a location from the SDK, but then it's for every single request for a certain time.



Has anybody encountered this ? I have no idea how to handle this other than setting a timer to check whether I'm getting any location updates.










share|improve this question






















  • Please provide us your device version ad sdk version details for us to help you better.
    – HERE Developer Support
    Nov 15 '18 at 7:40












  • @HEREDeveloperSupport this was on Android SDK 3.9.0 but the same happens on 3.8.0 and 3.7.0. Sometimes pause()/resume() helps, not always.
    – jab11
    Nov 16 '18 at 1:40










  • Please provide us the code or steps to reproduce (sample app). Is there only a specified exception in the log, or does it contain something else?
    – HERE Developer Support
    Nov 20 '18 at 15:35










  • @HEREDeveloperSupport I'll try to put together a sample but it's quite a bit of code to get to the navigationManager.startNavigation() call. It's only in logs, contains only stacktrace, what I pasted is everything that happens from .startNavigation(). sometimes the app continues with some location after few seconds sometimes it just sits there without any updates after this appearing in the log
    – jab11
    Nov 21 '18 at 16:42
















0














I'm using HERE Maps SDK and after calling navigationManager.startNavigation() I'm getting this exception in logs, SOMETIMES:



LocationManager: [LocationManager] requestLocationUpdates(), 
java.lang.RuntimeException
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:1013)
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:595)
at com.nokia.maps.ef.i(PlatformLocation.java:435)
at com.nokia.maps.ef.start(PlatformLocation.java:112)
at com.nokia.maps.PositioningManagerImpl.a(PositioningManagerImpl.java:192)
at com.here.android.mpa.common.PositioningManager.start(PositioningManager.java:212)
at com.nokia.maps.NavigationManagerImpl.a(NavigationManagerImpl.java:1785)
at com.nokia.maps.NavigationManagerImpl.a(NavigationManagerImpl.java:1063)
at com.here.android.mpa.guidance.NavigationManager.startNavigation(NavigationManager.java:1272)
...


Looks like the SDK is catching it because try/catch doesn't get it and nothing crashes, response is still NavigationManager.Error.NONE but navigation doesn't start.



Not sure what triggers it but the app may work fine for days and then this shows up and for few minutes or hours I can't get the navigation to work.



This exception occurs only sometimes, when the app tries to get a location from the SDK, but then it's for every single request for a certain time.



Has anybody encountered this ? I have no idea how to handle this other than setting a timer to check whether I'm getting any location updates.










share|improve this question






















  • Please provide us your device version ad sdk version details for us to help you better.
    – HERE Developer Support
    Nov 15 '18 at 7:40












  • @HEREDeveloperSupport this was on Android SDK 3.9.0 but the same happens on 3.8.0 and 3.7.0. Sometimes pause()/resume() helps, not always.
    – jab11
    Nov 16 '18 at 1:40










  • Please provide us the code or steps to reproduce (sample app). Is there only a specified exception in the log, or does it contain something else?
    – HERE Developer Support
    Nov 20 '18 at 15:35










  • @HEREDeveloperSupport I'll try to put together a sample but it's quite a bit of code to get to the navigationManager.startNavigation() call. It's only in logs, contains only stacktrace, what I pasted is everything that happens from .startNavigation(). sometimes the app continues with some location after few seconds sometimes it just sits there without any updates after this appearing in the log
    – jab11
    Nov 21 '18 at 16:42














0












0








0







I'm using HERE Maps SDK and after calling navigationManager.startNavigation() I'm getting this exception in logs, SOMETIMES:



LocationManager: [LocationManager] requestLocationUpdates(), 
java.lang.RuntimeException
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:1013)
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:595)
at com.nokia.maps.ef.i(PlatformLocation.java:435)
at com.nokia.maps.ef.start(PlatformLocation.java:112)
at com.nokia.maps.PositioningManagerImpl.a(PositioningManagerImpl.java:192)
at com.here.android.mpa.common.PositioningManager.start(PositioningManager.java:212)
at com.nokia.maps.NavigationManagerImpl.a(NavigationManagerImpl.java:1785)
at com.nokia.maps.NavigationManagerImpl.a(NavigationManagerImpl.java:1063)
at com.here.android.mpa.guidance.NavigationManager.startNavigation(NavigationManager.java:1272)
...


Looks like the SDK is catching it because try/catch doesn't get it and nothing crashes, response is still NavigationManager.Error.NONE but navigation doesn't start.



Not sure what triggers it but the app may work fine for days and then this shows up and for few minutes or hours I can't get the navigation to work.



This exception occurs only sometimes, when the app tries to get a location from the SDK, but then it's for every single request for a certain time.



Has anybody encountered this ? I have no idea how to handle this other than setting a timer to check whether I'm getting any location updates.










share|improve this question













I'm using HERE Maps SDK and after calling navigationManager.startNavigation() I'm getting this exception in logs, SOMETIMES:



LocationManager: [LocationManager] requestLocationUpdates(), 
java.lang.RuntimeException
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:1013)
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:595)
at com.nokia.maps.ef.i(PlatformLocation.java:435)
at com.nokia.maps.ef.start(PlatformLocation.java:112)
at com.nokia.maps.PositioningManagerImpl.a(PositioningManagerImpl.java:192)
at com.here.android.mpa.common.PositioningManager.start(PositioningManager.java:212)
at com.nokia.maps.NavigationManagerImpl.a(NavigationManagerImpl.java:1785)
at com.nokia.maps.NavigationManagerImpl.a(NavigationManagerImpl.java:1063)
at com.here.android.mpa.guidance.NavigationManager.startNavigation(NavigationManager.java:1272)
...


Looks like the SDK is catching it because try/catch doesn't get it and nothing crashes, response is still NavigationManager.Error.NONE but navigation doesn't start.



Not sure what triggers it but the app may work fine for days and then this shows up and for few minutes or hours I can't get the navigation to work.



This exception occurs only sometimes, when the app tries to get a location from the SDK, but then it's for every single request for a certain time.



Has anybody encountered this ? I have no idea how to handle this other than setting a timer to check whether I'm getting any location updates.







android here-api locationmanager






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 '18 at 22:30









jab11

741612




741612












  • Please provide us your device version ad sdk version details for us to help you better.
    – HERE Developer Support
    Nov 15 '18 at 7:40












  • @HEREDeveloperSupport this was on Android SDK 3.9.0 but the same happens on 3.8.0 and 3.7.0. Sometimes pause()/resume() helps, not always.
    – jab11
    Nov 16 '18 at 1:40










  • Please provide us the code or steps to reproduce (sample app). Is there only a specified exception in the log, or does it contain something else?
    – HERE Developer Support
    Nov 20 '18 at 15:35










  • @HEREDeveloperSupport I'll try to put together a sample but it's quite a bit of code to get to the navigationManager.startNavigation() call. It's only in logs, contains only stacktrace, what I pasted is everything that happens from .startNavigation(). sometimes the app continues with some location after few seconds sometimes it just sits there without any updates after this appearing in the log
    – jab11
    Nov 21 '18 at 16:42


















  • Please provide us your device version ad sdk version details for us to help you better.
    – HERE Developer Support
    Nov 15 '18 at 7:40












  • @HEREDeveloperSupport this was on Android SDK 3.9.0 but the same happens on 3.8.0 and 3.7.0. Sometimes pause()/resume() helps, not always.
    – jab11
    Nov 16 '18 at 1:40










  • Please provide us the code or steps to reproduce (sample app). Is there only a specified exception in the log, or does it contain something else?
    – HERE Developer Support
    Nov 20 '18 at 15:35










  • @HEREDeveloperSupport I'll try to put together a sample but it's quite a bit of code to get to the navigationManager.startNavigation() call. It's only in logs, contains only stacktrace, what I pasted is everything that happens from .startNavigation(). sometimes the app continues with some location after few seconds sometimes it just sits there without any updates after this appearing in the log
    – jab11
    Nov 21 '18 at 16:42
















Please provide us your device version ad sdk version details for us to help you better.
– HERE Developer Support
Nov 15 '18 at 7:40






Please provide us your device version ad sdk version details for us to help you better.
– HERE Developer Support
Nov 15 '18 at 7:40














@HEREDeveloperSupport this was on Android SDK 3.9.0 but the same happens on 3.8.0 and 3.7.0. Sometimes pause()/resume() helps, not always.
– jab11
Nov 16 '18 at 1:40




@HEREDeveloperSupport this was on Android SDK 3.9.0 but the same happens on 3.8.0 and 3.7.0. Sometimes pause()/resume() helps, not always.
– jab11
Nov 16 '18 at 1:40












Please provide us the code or steps to reproduce (sample app). Is there only a specified exception in the log, or does it contain something else?
– HERE Developer Support
Nov 20 '18 at 15:35




Please provide us the code or steps to reproduce (sample app). Is there only a specified exception in the log, or does it contain something else?
– HERE Developer Support
Nov 20 '18 at 15:35












@HEREDeveloperSupport I'll try to put together a sample but it's quite a bit of code to get to the navigationManager.startNavigation() call. It's only in logs, contains only stacktrace, what I pasted is everything that happens from .startNavigation(). sometimes the app continues with some location after few seconds sometimes it just sits there without any updates after this appearing in the log
– jab11
Nov 21 '18 at 16:42




@HEREDeveloperSupport I'll try to put together a sample but it's quite a bit of code to get to the navigationManager.startNavigation() call. It's only in logs, contains only stacktrace, what I pasted is everything that happens from .startNavigation(). sometimes the app continues with some location after few seconds sometimes it just sits there without any updates after this appearing in the log
– jab11
Nov 21 '18 at 16:42












1 Answer
1






active

oldest

votes


















0














Documentation for LocationManager describes that requestLocationUpdates throws two types of exceptions - IllegalArgumentException and SecurityException.
Maybe some vendor added its own undocumented logic that throws RuntimeException.



As a dirty fix, you could try stop/start requestLocationUpdates like that:



PositioningManager.start(LocationMethod.NETWORK); // will stop updates for LocationManager.GPS_PROVIDER
PositioningManager.start(LocationMethod.GPS); // will stop updates for LocationManager.NETWORK_PROVIDER
PositioningManager.start(LocationMethod.GPS_NETWORK); // will start updates for both


Secondly, if you have appropriate permission, you can try setting HERE location data source, like that:



//SDK will use custom algorithm to calculate device location
//and Android's LocationManager will not be used
PositioningManager.setDataSource(LocationDataSourceHERE.getInstance());


If you provide more info, like device, preconditions when it is happening, do other apps like Google Map can detect your location etc, maybe then it can be fixed.






share|improve this answer





















  • thanks, I'll try this. It's on Nokia 6 with android 9 right now. That exception is not thrown, just logged. try/catch doesn't catch anything and error response is still NONE. Google Maps shows my location perfectly.
    – jab11
    Nov 21 '18 at 16:45











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271039%2fhere-sdk-locationmanager-requestlocationupdates-runtimeexception%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Documentation for LocationManager describes that requestLocationUpdates throws two types of exceptions - IllegalArgumentException and SecurityException.
Maybe some vendor added its own undocumented logic that throws RuntimeException.



As a dirty fix, you could try stop/start requestLocationUpdates like that:



PositioningManager.start(LocationMethod.NETWORK); // will stop updates for LocationManager.GPS_PROVIDER
PositioningManager.start(LocationMethod.GPS); // will stop updates for LocationManager.NETWORK_PROVIDER
PositioningManager.start(LocationMethod.GPS_NETWORK); // will start updates for both


Secondly, if you have appropriate permission, you can try setting HERE location data source, like that:



//SDK will use custom algorithm to calculate device location
//and Android's LocationManager will not be used
PositioningManager.setDataSource(LocationDataSourceHERE.getInstance());


If you provide more info, like device, preconditions when it is happening, do other apps like Google Map can detect your location etc, maybe then it can be fixed.






share|improve this answer





















  • thanks, I'll try this. It's on Nokia 6 with android 9 right now. That exception is not thrown, just logged. try/catch doesn't catch anything and error response is still NONE. Google Maps shows my location perfectly.
    – jab11
    Nov 21 '18 at 16:45
















0














Documentation for LocationManager describes that requestLocationUpdates throws two types of exceptions - IllegalArgumentException and SecurityException.
Maybe some vendor added its own undocumented logic that throws RuntimeException.



As a dirty fix, you could try stop/start requestLocationUpdates like that:



PositioningManager.start(LocationMethod.NETWORK); // will stop updates for LocationManager.GPS_PROVIDER
PositioningManager.start(LocationMethod.GPS); // will stop updates for LocationManager.NETWORK_PROVIDER
PositioningManager.start(LocationMethod.GPS_NETWORK); // will start updates for both


Secondly, if you have appropriate permission, you can try setting HERE location data source, like that:



//SDK will use custom algorithm to calculate device location
//and Android's LocationManager will not be used
PositioningManager.setDataSource(LocationDataSourceHERE.getInstance());


If you provide more info, like device, preconditions when it is happening, do other apps like Google Map can detect your location etc, maybe then it can be fixed.






share|improve this answer





















  • thanks, I'll try this. It's on Nokia 6 with android 9 right now. That exception is not thrown, just logged. try/catch doesn't catch anything and error response is still NONE. Google Maps shows my location perfectly.
    – jab11
    Nov 21 '18 at 16:45














0












0








0






Documentation for LocationManager describes that requestLocationUpdates throws two types of exceptions - IllegalArgumentException and SecurityException.
Maybe some vendor added its own undocumented logic that throws RuntimeException.



As a dirty fix, you could try stop/start requestLocationUpdates like that:



PositioningManager.start(LocationMethod.NETWORK); // will stop updates for LocationManager.GPS_PROVIDER
PositioningManager.start(LocationMethod.GPS); // will stop updates for LocationManager.NETWORK_PROVIDER
PositioningManager.start(LocationMethod.GPS_NETWORK); // will start updates for both


Secondly, if you have appropriate permission, you can try setting HERE location data source, like that:



//SDK will use custom algorithm to calculate device location
//and Android's LocationManager will not be used
PositioningManager.setDataSource(LocationDataSourceHERE.getInstance());


If you provide more info, like device, preconditions when it is happening, do other apps like Google Map can detect your location etc, maybe then it can be fixed.






share|improve this answer












Documentation for LocationManager describes that requestLocationUpdates throws two types of exceptions - IllegalArgumentException and SecurityException.
Maybe some vendor added its own undocumented logic that throws RuntimeException.



As a dirty fix, you could try stop/start requestLocationUpdates like that:



PositioningManager.start(LocationMethod.NETWORK); // will stop updates for LocationManager.GPS_PROVIDER
PositioningManager.start(LocationMethod.GPS); // will stop updates for LocationManager.NETWORK_PROVIDER
PositioningManager.start(LocationMethod.GPS_NETWORK); // will start updates for both


Secondly, if you have appropriate permission, you can try setting HERE location data source, like that:



//SDK will use custom algorithm to calculate device location
//and Android's LocationManager will not be used
PositioningManager.setDataSource(LocationDataSourceHERE.getInstance());


If you provide more info, like device, preconditions when it is happening, do other apps like Google Map can detect your location etc, maybe then it can be fixed.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 '18 at 13:04









NazarK

63621116




63621116












  • thanks, I'll try this. It's on Nokia 6 with android 9 right now. That exception is not thrown, just logged. try/catch doesn't catch anything and error response is still NONE. Google Maps shows my location perfectly.
    – jab11
    Nov 21 '18 at 16:45


















  • thanks, I'll try this. It's on Nokia 6 with android 9 right now. That exception is not thrown, just logged. try/catch doesn't catch anything and error response is still NONE. Google Maps shows my location perfectly.
    – jab11
    Nov 21 '18 at 16:45
















thanks, I'll try this. It's on Nokia 6 with android 9 right now. That exception is not thrown, just logged. try/catch doesn't catch anything and error response is still NONE. Google Maps shows my location perfectly.
– jab11
Nov 21 '18 at 16:45




thanks, I'll try this. It's on Nokia 6 with android 9 right now. That exception is not thrown, just logged. try/catch doesn't catch anything and error response is still NONE. Google Maps shows my location perfectly.
– jab11
Nov 21 '18 at 16:45


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271039%2fhere-sdk-locationmanager-requestlocationupdates-runtimeexception%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python