Solution 1 :
You can process like that :
Comment the line with getlocationdata();
Then run with flutter run
If it work, look in debug mode why that doesn’t work.
If it still not work, so try to replace the SpinKitChasingDots
by Text("test")
.
Good luck
Problem :
I’ve created a simple flutter app to tell me the weather using a weather API and the HTTP package. The app runs as intended on my emulated device and for testing, on a physical device, I built a fat apk using `flutter build ask. Unfortunately, the app doesn’t go past the loading screen on physical devices(I’ve tested it on multiple devices).
android manifest
<manifest xmlns_android="http://schemas.android.com/apk/res/android"
package="co.appbrewery.clima">
<uses-permission android_name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android_name="android.permission.INTERNET"/>
</manifest>
loading screen
import 'package:clima/services/weather.dart';
import 'package:flutter/material.dart';
import 'location_screen.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
class LoadingScreen extends StatefulWidget {
@override
_LoadingScreenState createState() => _LoadingScreenState();
}
class _LoadingScreenState extends State<LoadingScreen> {
@override
void initState() {
super.initState();
getlocationdata();
}
void getlocationdata() async {
WeatherModel weatherModel = WeatherModel();
var weatherdata = await weatherModel.getlocationweather();
Navigator.push(context, MaterialPageRoute(builder: (context) {
return LocationScreen(
locationweather: weatherdata,
);
}));
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SpinKitChasingDots(
color: Colors.white,
size: 50,
),
),
);
}
}
What’s going wrong? I’m stuck. Any help would be appreciated!
Comments
Comment posted by Yoav Genish
Do you run it in debug mode on the physical device?
Comment posted by graywartz doomski
Yes I did and it works there. Doesn’t work when I install apk on device.
Comment posted by graywartz doomski
@YoavGenish …
Comment posted by Yoav Genish
Maybe it’s just a permission problem
Comment posted by Yoav Genish
Try to delete the apk on the device abd completely re-install