Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] Flutter app runs perfectly on android studio emulator but doesn’t go past the loading screen on physical device

Posted on November 14, 2022

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

READ  [ANSWERED] How to detect a home button press in Android?
Powered by Inline Related Posts

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress