Logcat android studio flutter

Android Studio не показывает Logcat с Flutter

Я использую Android Studio для Flutter разработки приложений. Кажется, все работает нормально, просто Android Studio не показывает «логи» в Logcat. В разделе Logcat написано «Пожалуйста, настройте Android SDK». Который уже настроен. А в разделе Logcat написано «Нет подключенных устройств». в раскрывающемся меню. Когда он узнал мой телефон Android и показывает его прямо под строкой меню.

Есть ли решение для этого? Есть ли что-то, что мне не хватает?

9 ответов

Флаттер . Используйте вкладку «Выполнить» для отображения журналов в Android Studio. Переключитесь с Logcat на Run, и вы увидите журналы.

Перейдите на вкладку «Выполнить», чтобы просмотреть журналы, и если вы хотите вставить журналы (например, Log.d() в Android), вы можете использовать функцию print() , и любая строка, которую вы передадите в нее, будет напечатана в Окно «Выполнить» .

Я думаю, это проблема АБР. Вы можете перезапустить AS (или, может быть, даже ваш компьютер), или то, что я обычно делаю, это открыть терминал и затем: adb kill-server && adb start-server (я думаю, что вторая часть adb start-server не нужна, потому что кажется, что AS обрабатывает его автоматически ) — в любом случае, именно так у меня каждый раз работают LogCat и Android (и Flutter).

Flutter не имеет logcat flatter show error в консоли внутри вкладки Run. Если вы хотите увидеть отчет об ошибках и сбоях, нажмите на вкладку run.

Когда я впервые пришел во Flutter с Android-фона, я не знал, где можно найти операторы журнала. Меня не очень заботили все системные сообщения. Я просто хотел видеть сообщения журнала из моего приложения во время разработки. Этот ответ предназначен для таких людей, а не для людей, которым конкретно нужен сам LogCat.

В приложениях Flutter вы можете записывать текст с помощью оператора print() .

Как уже говорили другие, вы можете использовать вкладку «Выполнить» в Android Studio для просмотра этих зарегистрированных комментариев.

Вот код для main.dart:

Просто используйте команду ‘flutter logs’, тогда вы сможете увидеть все журналы, которые напечатаны с помощью функции ‘print’ или ‘debugPrint’.

Похоже, все работает, как только вы правильно настроили Android SDK в настройках проекта.

Просто откройте другой проект NATIVE для Android Studio в другом окне, и logcat будет работать, делайте это, пока открыт проект Flutter. Это было решение для меня

Когда вы открываете проект флаттера, IDE предлагает вам настроить проект Android. Просто нажмите на рекомендацию, и она начнет показывать окно logcat.

Источник

Enable logcat and android profiler from flutter projects #16691

Comments

fmatosqg commented Apr 18, 2018

They still contain valuable features that can be used while debugging, allowing for skipping opening android module.

The text was updated successfully, but these errors were encountered:

zoechi commented Apr 18, 2018

Can you elaborate more what the request is about?
Is this about IDE support?
adb logcat works with Flutter apps.
(I don’t know about Android profiler.)

fmatosqg commented Apr 18, 2018

Android Studio support. Those panels are visible for Android projects but not for Flutter ones.

zoechi commented Jul 16, 2018

Is this still missing in AS?
IntelliJ provides that view

ricardobrg commented Jul 27, 2018 •

It’s not woking in AS for me. It says «Configure Android SDK» but it is configured already.

I’m working with AS 3.1.3 in Ubuntu 18.04

When I need logcat I use adb shell in the console.

zoechi commented Jul 27, 2018

@ricardobrg That sounds like a different problem. Please create a new issue with the issue template filled out.

ricardobrg commented Jul 27, 2018

@zoechi I don’t think that it’s different. I just wanted to add some info since it was waiting response from OP. In Android Studio the logcat panel doesn’t work with flutter projects.

It says «Configure Android SDK» but it’s already configured. I’m able to debug Android apps using the debugger but not the logcat.

zoechi commented Jul 27, 2018 •

Works the same in IntelliJ and Android Studio for a simple Flutter project.

Do you have Android SDK configured in

no-response bot commented Aug 15, 2018

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don’t hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.
cc @Hixie

HassanMeer commented Dec 8, 2018

Goto File -> Project structure and choose your platform sdk,
api 27 . ISSUE OF Logcat (Please configure SDK) will resolve INSHAllah .

hjJunior commented Dec 19, 2018

To solve this problem I just opened on Android studio the android folder

mpeng5120 commented Apr 28, 2019

Goto File -> Project structure and choose your platform sdk,
api 27 . ISSUE OF Logcat (Please configure SDK) will resolve INSHAllah .

this solve my problem thanks

mofada commented Oct 17, 2019

I have the same problem

Kav47 commented Jan 11, 2020 •

  1. Go to Project Settings (File -> Project Structure)
  2. Change the Project SDK to API 27 ([Left Tab] Project Settings -> Project)

  1. Change «Build Target» for «Android API 27 Platform» to «Android API 28» ([Left Tab]Platform Settings -> SDKs)

  1. Then Click Apply and OK

asidt commented Mar 25, 2020

This happens still nowadays, with a clean Flutter project started from scratch. What worked for me , like mentioned in #16691 (comment) , was in Studio to Edit -> Open . and point to the android subproject within the Flutter project. Once opened and synced, closed the second window of Studio opened, and the first this time had logcat tab finally working.

jasonflaherty commented Apr 30, 2020

To solve this problem I just opened on Android studio the android folder

This was easy. Thanks. Just open android folder, click record in the logcat area, then go to your device / emulator and begin navigating around.

github-actions bot commented Aug 21, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

Источник

Missing logcat tab in Android Studio #2724

Comments

zoechi commented Oct 25, 2018

Logcat tab does not appear in Flutter project but visible in Android project

The text was updated successfully, but these errors were encountered:

stevemessick commented Oct 26, 2018

@anderscheow: This is what I expect to see. You can open it in a Flutter project but when you do it reports: «Please configure Android SDK», which seems confusing to me.

stevemessick commented Nov 5, 2018

We’re taking no action here since logcat can be opened when needed.

ascmp commented Jul 10, 2019

@stevemessick could you please explain me how to «open it when needed»? I’ve two windows of Android Studio opened, both Flutter projects, and one show me the logcat tab, but the other one doesn’t. In both the Android SDK is configured correctly. The window which doesn’t show the logcat tab doesn’t even list it under View -> Tool Windows (see attachment).
The window which shows it is for a project recently created, while the one which doesn’t show it is for a project created about 6 months ago, not sure if it can makes a difference.


stevemessick commented Jul 10, 2019

What follows is speculation. (I’m not too familiar with Android Studio internals.)

I think the old project doesn’t show it because it was created from a template that did not enable logcat. Recent projects do enable it. It appears to be controlled by the ToolWindowManager section of the workspace config file (.idea/workspace.xml). Try comparing the workspace config files of your two projects and changing the one that does not include logcat to include it like the newer one does. You might get it enabled by deleting the workspace config file, but make a backup in case it doesn’t work.

ascmp commented Jul 11, 2019 •

Thanks, I did, but no luck. I also grep’d into both the folders, and the only references to logcat are in that one line you point out. I guess it’s some higher level that prevents logcat tab to show, like it would be disabled or not supported. Not sure how or why, it was there before and then it disappeared. Any help to get the tab back is appreciated.
Note: if I open the MainActivity, and from there «Open for editing in Android Studio», which opens another window for editing Android native code, in that window I have the logcat tab too.

henkhenken commented Jul 11, 2019

I have the same issue. When I create a project myself (Windows) there is a logcat window in Android Studio. When I open a project from someone else (Mac) the logcat is missing.

ascmp commented Jul 15, 2019 •

If anyone interested, I eventually solved creating a new Flutter project and then overwriting all my ‘data’ into it, in details the folders: android, fonts, images, ios, lib, test, .git and then the files: .gitignore, README.md, pubspec.yaml. Everything else gets generated from Studio. After this trick, I see the logcat tab again.

klaszlo8207 commented Jul 17, 2019 •

My flutter project suddenly can’t see the Logcat tab 😀 I just pulled the new source from github, and voila, Logcat tab is missing. And any View/Tool Windows . LogCat tab.. Any way to show that Logcat again? 😀

vladaman commented Sep 1, 2019

I am having same issue. When I open project in Android Studio it does not show anything in Logcat window and it says to configure Android SDK.

Then I open another project which is properly configured in new window and the logcat begins to work in both windows. This is clearly misconfiguration in particular project.
I also don’t see option in menu «Tools>Flutter>Open Android project» which I think it’s related.

xiehongxin commented Oct 11, 2019

click “Event Log”

it will show
“”“
2019-10-11
10:10 Frameworks Detected
Android framework is detected.
Configure
”“”

click “Configure”, and it will show logcat

ride4sun commented Feb 11, 2020

@xiehongxin It worked like u described but the option in the Event Log did show only when an update in Android was triggered. e.g. a plugin was updated. I still would call this a defect and I am not sure why this was closed. This happen already a few time and I think it should be addressed and not ignored.

And the statement is wrong (by @stevemessick) that Logcat can be openend when needed. Logcat is not visible in the Tool menu. Please reopen @stevemessick

amigax commented Feb 17, 2021

I cant get this to work at all, this is infuriating, need logcat badly.

the-kool-sk commented Apr 23, 2021 •

I too cannot get this working . anyone can help here.
there is no Event like Android Framework detected it only show : The project ‘xyz’ is not a Gradle-based project.
Logcat is the basic need of development. Need to get it working. Also it is not showing emulator in tool window. Need a fix for this.
Reopen this.

amigax commented Jun 28, 2021

still cant find logcat. WTF is going on guys

amigax commented Jun 28, 2021

only solution is to load another instance of AS where it does work.

lsuhov commented Jul 1, 2021

Please reopen ticket. Issue is still happening.

ullasuk commented Jul 2, 2021

I also had the same issue . Android logcat disappeared suddenly . What i did to fix it was remove all .idea/ .gradle folders , .iml files and then tried using Import Project(Gradle ,Eclipse , ADT ) in Android studio startup to load project folder . Well i also did flutter clean , invalid before importing , not sure if that made any difference
After going through few configuration steps , i can see logcat again in the flutter project

MaximilianFrick commented Jul 9, 2021

Had same issue until i did this:

Go to Project Structure -> Facets -> «+» Android -> Select Project -> voilá 🙂

MisterWeeMan commented Jul 14, 2021

Had same issue until i did this:

Go to Project Structure -> Facets -> «+» Android -> Select Project -> voilá 🙂

This worked for me. Thank you @MaximilianFrick

dalriada33 commented Aug 5, 2021 •

I had the same issue on MacOs, and what helped me is: File > Project Structure > Modules > adding new Android module, everything with defaults. Then LogCat showed up.

Источник

Читайте также:  Outlook для android обзор
Оцените статью