Geolocation Cordova plugin causes app to freeze/crash
<p>I'm building an Android app to take a picture and your current location and send it to server. I'm using AngularJs and Apache Cordova to do so. On the back-end, I'm using Web API and Entity Framework.</p>

<p>I managed to take the picture, but when I try to get current location, the app freezes. Android won't return error, and javascript console won't too (debbuging on Chrome DevTools). It simply stops responding, even if I set a timeout for the request.</p>

<p>Here is my code:</p>

<pre><code>$scope.send = function () {
    navigator.geolocation.getCurrentPosition(
        function (success) {
            console.log("success")
        },
        function (error) {
            console.log("error")
        },
        {timeout: 15000}
    )
}
</code></pre>

<p>I used ngCordova to take the picture, and tried to use it for location too, but as it was freezing, tried to use this way (maybe it was a problem on ngCordova). But the result is the same.</p>

<p>I searched for it on the web, but haven't found anything that would solve the problem yet..</p>

<p>I've been here already:</p>

<p><a href="https://stackoverflow.com/questions/9660042/phonegap-geolocalisation-application-crashes">Phonegap Geolocalisation application crashes</a></p>

<p><a href="https://stackoverflow.com/questions/40375069/cordova-geolocation-plugin-doesnt-work-on-android">Cordova geolocation plugin doesn&#39;t work on android</a></p>

<p>If any other piece of code is needed, please let me know.</p>

<p>Thanks in advance!</p>

<p><strong>EDIT</strong>: I tested it on another Android phone, and the result is the same.</p>

<p><strong>EDIT 2</strong>: I created a blank app on visual studio, and GeoLocation worked with that code. Just copied and pasted.</p>