Ankur-Khandelwal / Clima---The-Weather-App

A weather detecting app which uses the Open Weather API
0 stars 0 forks source link

The apk file is not working. #2

Closed Ankur-Khandelwal closed 4 years ago

Ankur-Khandelwal commented 4 years ago

On starting the app, it should show a loading animation while fetching local weather data from Open Weather Map API and then navigate to a screen showing the weather details. But thats not happening. Rather it just keeps showing the loading animation only.

The app works perfectly fine, when run on a device through Android Studio over USB. However, when I created an apk file for the same and installed the app on a device through the apk file, its stuck on the loading screen only.

I generated the apk through: flutter build apk --split-per-abi

amitkhairnar44 commented 4 years ago

@Ankur-Khandelwal Add internet permission in the AndroidManifest file and it will work as expected.

<uses-permission android:name="android.permission.INTERNET"/>
Ankur-Khandelwal commented 4 years ago

@amitkhairnar44 I created a new apk and tested the app again after adding the line as mentioned by you, but still it's not working.

amitkhairnar44 commented 4 years ago

Do flutter clean and try again

Ankur-Khandelwal commented 4 years ago

Yes @amitkhairnar44 , I did that as well. Still its not working.

amitkhairnar44 commented 4 years ago

Okay I'm gonna clone and check the code.

amitkhairnar44 commented 4 years ago

@Ankur-Khandelwal Check if you're able to get the user location. In my case the code has hit deadlock.

amitkhairnar44 commented 4 years ago

https://github.com/Ankur-Khandelwal/Clima---The-Weather-App/blob/e3490593500d69335e0d8d7440ac87c446700ee9/lib/services/location.dart#L9-L10

This code is causing the issue. Since it's not able to get user's current location due to some factors, it will wait for infinite time and that's why you're seeing the loading screen for long time.

Ankur-Khandelwal commented 4 years ago

@amitkhairnar44 Why is it not getting the location? Because while trying over Android Studio, it was working perfectly.

Ankur-Khandelwal commented 4 years ago

3 Solves this Issue.

amitkhairnar44 commented 4 years ago

@amitkhairnar44 Why is it not getting the location? Because while trying over Android Studio, it was working perfectly.

Maybe it's not getting GPS lock.