“I/zygote ( 9164)” in Output, but App Still Runs

I am working on a Flutter course, part of which involves building a weather app. Although I am not showing any errors, when I run the app’s code I get the below output in the console and the app does not function as intended, seemingly freezing on the first screen (which is a loading animation), when it should instead redirect the user to a page containing weather information. Does anyone know what the below output means? I’ve tried searching for “I/zygote ( 9164)” on both Stack Overflow and Google, but have not found anything useful.

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
Debug service listening on ws://127.0.0.1:56358/KCCuiEggJi8=/ws
Syncing files to device Android SDK built for x86...
I/Choreographer( 9164): Skipped 79 frames!  The application may be doing too much work on its main thread.
D/EGL_emulation( 9164): eglMakeCurrent: 0xe3eac760: ver 2 0 (tinfo 0xda6ffda0)
D/EGL_emulation( 9164): eglMakeCurrent: 0xe3eac8e0: ver 2 0 (tinfo 0xda6ffa20)
I/zygote  ( 9164): Do partial code cache collection, code=29KB, data=22KB
I/zygote  ( 9164): After code cache collection, code=29KB, data=22KB
I/zygote  ( 9164): Increasing code cache capacity to 128KB

It looks like you are doing to much stuff at the beginning. Try removing some parts to see what is it that is breaking the app. And from there move forward.

Are you running on an emulator? Sometimes the emulator need more ram to work. I can’t really tell with all the info you have given.

Maybe share some code, your Flutter doctor and pubspec. As well as the course you are following :wink:

Thank you very much for the reply. I am running the app on an AVD emulator and my computer currently has 32 gb of RAM. I am taking Angela Yu’s Flutter course.

Here is my Flutter Doctor:

[√] Flutter (Channel stable, v1.17.4, on Microsoft Windows [Version 10.0.19041.450], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[√] Android Studio (version 4.0)
[√] Connected device (1 available)

• No issues found!

my pupspec:

name: clima
description: A new Flutter application.

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  geolocator: ^5.3.2+2
  http: ^0.12.2
  flutter_spinkit: ^4.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

  assets:
  - images/

  fonts:
  - family: Spartan MB
    fonts:
    - asset: fonts/SpartanMB-Black.otf
      weight: 900

code from loading_screen.dart

import 'package:clima/screens/location_screen.dart';
import 'package:clima/services/networking.dart';
import 'package:flutter/material.dart';
import 'package:clima/services/location.dart';
import 'package:clima/services/networking.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'location_screen.dart';

const apiKey = '<my-api-key>';

class LoadingScreen extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _LoadingScreenState();
  }
}

class _LoadingScreenState extends State<LoadingScreen> {
  double latitude;
  double longitude;

  @override
  void initState() {
    super.initState();
    getLocation();
  }

  void getLocationData() async {
    Location location = Location();
    await location.getCurrentLocation();
    latitude = location.latitude;
    longitude = location.longitude;
    NetworkHelper networkHelper = NetworkHelper(
        'https://api.openweathermap.org/data/2.5/weather?lat=$latitude&lon=$longitude&appid=$apiKey');
    var weatherData = await networkHelper.getData();

    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) {
          return LocationScreen(
            locationWeather: weatherData,
          );
        },
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: SpinKitDoubleBounce(
          color: Colors.white,
          size: 100.0,
        ),
      ),
    );
  }
}

location_screen.dart:

import 'package:flutter/material.dart';
import 'package:clima/utilities/constants.dart';

class LocationScreen extends StatefulWidget {
  LocationScreen({this.locationWeather});
  final locationWeather;
  @override
  _LocationScreenState createState() => _LocationScreenState();
}

class _LocationScreenState extends State<LocationScreen> {
  @override
  void initState() {
    super.initState();
    print(widget.locationWeather);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        decoration: BoxDecoration(
          image: DecorationImage(
            image: AssetImage('images/location_background.jpg'),
            fit: BoxFit.cover,
            colorFilter: ColorFilter.mode(
                Colors.white.withOpacity(0.8), BlendMode.dstATop),
          ),
        ),
        constraints: BoxConstraints.expand(),
        child: SafeArea(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: <Widget>[
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: <Widget>[
                  FlatButton(
                    onPressed: () {},
                    child: Icon(
                      Icons.near_me,
                      size: 50.0,
                    ),
                  ),
                  FlatButton(
                    onPressed: () {},
                    child: Icon(
                      Icons.location_city,
                      size: 50.0,
                    ),
                  ),
                ],
              ),
              Padding(
                padding: EdgeInsets.only(left: 15.0),
                child: Row(
                  children: <Widget>[
                    Text(
                      '32°',
                      style: kTempTextStyle,
                    ),
                    Text(
                      '☀️',
                      style: kConditionTextStyle,
                    ),
                  ],
                ),
              ),
              Padding(
                padding: EdgeInsets.only(right: 15.0),
                child: Text(
                  "It's 🍦 time in San Francisco!",
                  textAlign: TextAlign.right,
                  style: kMessageTextStyle,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
/*

double temperature = decodedData['main']['temp'];
int condition = decodedData['weather'][0]['id'];
String cityName = decodedData['name'];
*/

and networking.dart:

import 'dart:convert';

class NetworkHelper {
  NetworkHelper(this.url);

  final String url;

  Future getData() async {
    http.Response response = await http.get(url);
    if (response.statusCode == 200) {
      String data = response.body;

      return jsonDecode(data);
    } else {
      print(response.statusCode);
    }
  }
}

Thanks again!

Hey is that a generic apiKey?? If not, take it out and write something like “MY API KEY”, never share something like this if it is not an open one.

2 Likes

Thank you for the tip! That key is only being used for this course project, and so I am not too worried about this specifically, but will be more cautious in the future. Would you happen to have nay idea why the app is not working based on the code above?