Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to print decodeData(); into the console #22

Open
ahmloutfy opened this issue Jun 20, 2021 · 3 comments
Open

Unable to print decodeData(); into the console #22

ahmloutfy opened this issue Jun 20, 2021 · 3 comments

Comments

@ahmloutfy
Copy link

Hello!

the print lines in the following part of "loading_screen.dart" code unable to be printed:

` void getData() async {
http.Response response = await http.get(
'https://api.openweathermap.org/data/2.5/onecall?lat=$latitude&lon=$longitude&appid=$apiKey');
if (response.statusCode == 200) {
Map decodeData = json.decode(response.body);
double temperature = decodeData['main']['temp'];

  int conditionNumber = decodeData['weather'][0]['id'];

  String cityName = decodeData['name'];
  print(temperature);
  print(conditionNumber);
  print(cityName);
} else {
  print(response.statusCode);
}

}`

Sometimes nothing printed into the console and sometimes the problem appeared.

Also the following lines appeared:

"W/ppbrewery.clim(25370): Accessing hidden method Landroid/content/Context;->getFeatureId()Ljava/lang/String; (greylist, reflection, allowed)"

Hope the problem can be solved

Thanks

@ahmloutfy
Copy link
Author

@angelabauer Hi, Can you take a look at this problem?

@malikdanishalii
Copy link

i have the same problem if any one know the solution let me know.

@malikdanishalii
Copy link

The error resolved by running the application on real / physical devices because emulator or simulator has the problem of getting real time location as per my knowledge and understanding after working for three days on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants