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

Analysis shows errors but there are none, hot reload fails #4762

Closed
crtl opened this issue Aug 17, 2020 · 19 comments
Closed

Analysis shows errors but there are none, hot reload fails #4762

crtl opened this issue Aug 17, 2020 · 19 comments
Labels
waiting for customer response Auto-close if no response
Milestone

Comments

@crtl
Copy link

crtl commented Aug 17, 2020

Since today the my analyser in AndroidStudio started showing:
"Hot reload failed. Analysis issues".

Clicking "View Issues" shows no issues, only hints.
If I build the app it builds and it also works on hot restart but not hot reload.

Steps to Reproduce

Dont know

Version info

[√] Flutter (Channel master, 1.21.0-7.0.pre, on Microsoft Windows [Version 10.0.18363.1016], locale en-DE)
    • Flutter version 1.21.0-7.0.pre at D:\dev\flutter\sdk
    • Framework revision 7ec2d360bc (3 weeks ago), 2020-07-29 23:25:38 -0700
    • Engine revision a9910e409c
    • Dart version 2.10.0 (build 2.10.0-1.0.dev 24c7666def)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\Marvin\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 48.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
@jacob314 jacob314 added the waiting for customer response Auto-close if no response label Aug 24, 2020
@jacob314
Copy link
Contributor

To help us repro, what hints did you see? If you fix the hints, does hot reload work properly?
It could also be useful to click the refresh button in the analysis server window to make sure the output there isn't stale for some reason.

@crtl
Copy link
Author

crtl commented Aug 25, 2020

The only hint shown is the one above the Analysis tab. "Analysis issues. Hot reload failed". There is no issue anywhere in the code editing window and also no issue shown in the linter results.

@no-response no-response bot removed the waiting for customer response Auto-close if no response label Aug 25, 2020
@stevemessick
Copy link
Member

Does this still happen after doing flutter upgrade?

@stevemessick stevemessick added the waiting for customer response Auto-close if no response label Aug 31, 2020
@no-response
Copy link

no-response bot commented Sep 7, 2020

Without additional information we're unfortunately not sure how to resolve this issue. We're going to close this bug for now, but please don't hesitate to comment on the bug if you have any more information for us; we're happy to reopen. Thanks for your contribution!

@no-response no-response bot closed this as completed Sep 7, 2020
@crtl
Copy link
Author

crtl commented Sep 9, 2020

@stevemessick
I have upgrade flutter multiple times in the lifetime of this bug and switched branches.

Sry I have not many details because there is no reliable method to reproduce it.
Thats an issue for itself.
Where can I find logs of dart analysis or any information? Are there even any?

@no-response no-response bot removed the waiting for customer response Auto-close if no response label Sep 9, 2020
@no-response no-response bot reopened this Sep 9, 2020
@stevemessick
Copy link
Member

Where can I find logs of dart analysis or any information? Are there even any?

As @alexander-doroshko wrote:
To get logs: open Registry (searchable using Find Action(Cmd+Shift+A)), and add the following to the dart.server.additional.arguments property:

--instrumentation-log-file=/some/path/das.log
After that, restart the Analysis Server (a button with red errors in the Dart Analysis tool window), reproduce the issue, and attach das.log file here.

@stevemessick stevemessick added the waiting for customer response Auto-close if no response label Mar 11, 2021
@stevemessick stevemessick added this to the On Deck milestone Mar 11, 2021
@no-response
Copy link

no-response bot commented Mar 18, 2021

Without additional information we're unfortunately not sure how to resolve this issue. We're going to close this bug for now, but please don't hesitate to comment on the bug if you have any more information for us; we're happy to reopen. Thanks for your contribution!

@no-response no-response bot closed this as completed Mar 18, 2021
@Guang1234567
Copy link

Guang1234567 commented Apr 8, 2021

@stevemessick

Analysis Server DiagnosticsDiagnostics Feedback Docs Spec
500 Oops
NoSuchMethodError: The getter 'path' was called on null. Receiver: null Tried calling: path

#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1 ContextsPage.generateContent (package:analysis_server/src/status/diagnostics.dart:486:71)
#2 DiagnosticPageWithNav.generateContainer. (package:analysis_server/src/status/diagnostics.dart:736:13)
#3 DiagnosticPageWithNav.generateContainer. (package:analysis_server/src/status/diagnostics.dart:734:20)
#4 Page.asyncDiv (package:analysis_server/src/status/pages.dart:41:15)
#5 DiagnosticPageWithNav.generateContainer (package:analysis_server/src/status/diagnostics.dart:734:11)
#6 DiagnosticPage.generatePage (package:analysis_server/src/status/diagnostics.dart:690:11)
#7 Page.generate (package:analysis_server/src/status/pages.dart:63:12)
#8 Site.handleGetRequest (package:analysis_server/src/status/pages.dart:165:37)
#9 HttpAnalysisServer._handleGetRequest (package:analysis_server/src/server/http_server.dart:88:23)
#10 HttpAnalysisServer._handleServer. (package:analysis_server/src/server/http_server.dart:96:15)
#11 HttpAnalysisServer._handleServer. (package:analysis_server/src/server/http_server.dart:93:23)
#12 _rootRunUnary (dart:async/zone.dart:1362:47)
#13 _CustomZone.runUnary (dart:async/zone.dart:1265:19)
#14 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
#15 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#16 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#17 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#18 _StreamController._add (dart:async/stream_controller.dart:607:7)
#19 _StreamController.add (dart:async/stream_controller.dart:554:5)
#20 _HttpServer._handleRequest (dart:_http/http_impl.dart:2998:19)
#21 new _HttpConnection. (dart:_http/http_impl.dart:2753:19)
#22 _rootRunUnary (dart:async/zone.dart:1362:47)
#23 _CustomZone.runUnary (dart:async/zone.dart:1265:19)
#24 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
#25 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#26 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#27 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#28 _StreamController._add (dart:async/stream_controller.dart:607:7)
#29 _StreamController.add (dart:async/stream_controller.dart:554:5)
#30 _HttpParser._headersEnd (dart:_http/http_parser.dart:394:19)
#31 _HttpParser._doParse (dart:_http/http_parser.dart:745:15)
#32 _HttpParser._parse (dart:_http/http_parser.dart:324:7)
#33 _HttpParser._onData (dart:_http/http_parser.dart:858:5)
#34 _rootRunUnary (dart:async/zone.dart:1362:47)
#35 _CustomZone.runUnary (dart:async/zone.dart:1265:19)
#36 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
#37 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#38 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#39 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#40 _StreamController._add (dart:async/stream_controller.dart:607:7)
#41 _StreamController.add (dart:async/stream_controller.dart:554:5)
#42 _Socket._onData (dart:io-patch/socket_patch.dart:2144:41)
#43 _rootRunUnary (dart:async/zone.dart:1370:13)
#44 _CustomZone.runUnary (dart:async/zone.dart:1265:19)
#45 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
#46 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#47 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#48 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#49 _StreamController._add (dart:async/stream_controller.dart:607:7)
#50 _StreamController.add (dart:async/stream_controller.dart:554:5)
#51 new _RawSocket. (dart:io-patch/socket_patch.dart:1680:33)
#52 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1192:14)
#53 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#54 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#55 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:120:13)
#56 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)

@Guang1234567
Copy link

  • flutter 2.0.4 stable
  • macOS 10.15.7
  • Android studio 4.1.3

@Guang1234567
Copy link

Guang1234567 commented Apr 8, 2021

In my case,

ABC?  test_Dart_Analysis_Fail_That_Cause_Hot_Reload_Fail_Case_001 (List<ABC?>? items) {
      return item?[0];
}

Above code example will fail to hot reload, because the dart analyer has bug !!!

@vixez
Copy link

vixez commented Apr 23, 2021

I also have this bug. For example I have this ListView

    return ListView.builder(
      itemCount: ratings!.length,
      shrinkWrap: true,
      primary: false,
      itemBuilder: (context, index) {
        return RatingRow(
          text: state.getLabelForDriverRating(ratings?[index]),
          rating: ratings?[index].rating,
        );
      },
    );

Because of ratings?[index] hot reload does not work, even though it is not showing any errors in the Dart Analysis tab.
Force unwrapping fixes the hot reload ratings![index].

@alexander-doroshko
Copy link
Contributor

This will be fixed in the next Dart plugin update.

@fzyzcjy
Copy link

fzyzcjy commented May 3, 2021

I also see this bug. It happens on my >10k lines of flutter code, so I cannot make a reproducible sample.

@alexander-doroshko Thanks sounds wonderful! I wonder when will the next update be released? Before the update, what workaround can I do?

EDIT: I have even uninstall and reinstalled the plugin, but still cannot use hot reload :(

@alexander-doroshko
Copy link
Contributor

The problem related to the foo?[bar] syntax has been fixed and the fix is included in the latest Dart plugin versions.

There might be other problems with hot reload, they should be investigated separately. Please attach the file that fails to be hot-reloaded and provide the versions of the Dart and Flutter plugins.

@Guang1234567
Copy link

Guang1234567 commented May 13, 2021

@alexander-doroshko

thanks. work well in android 4.2 and newest flutter plugin.

@errdeka05
Copy link

I have the same bug with dart version 2.13.4 ....

@Zarainia
Copy link

I also have this issue, specifically in some files in my project. However, pressing save on other files in the same project works...

@Quijx
Copy link

Quijx commented Apr 22, 2022

I am having this issue too. What I found to be the cause is a parameter, which is annotated, required and has type. So for example the following code will cause this bug to happen for me:

void foo({@Deprecated('foo') required int foo}) {
  print('hi');
}

@alexander-doroshko
Copy link
Contributor

@Quijx Thanks, filed as https://youtrack.jetbrains.com/issue/WEB-55630, will fix shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for customer response Auto-close if no response
Projects
None yet
Development

No branches or pull requests

10 participants