flutter / flutter/flutter-intellij
can't stop at breakpoint in Android code
- Dominant language
- Java
- Stars
- 2k
- Forks
- 356
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 27
Description
Setting a breakpoint in Java code and running the Flutter app in debug mode will not stop at the breakpoint.
To reproduce:
- create a new Flutter app
- Add code to _MyHomePageState in main.dart to call a platform method when you click:
```
static const platform = const PlatformMethodChannel('click/hello');
```
```
_counter++;
platform.invokeMethod("hello");
```
- Add code to Java that logs the method:
In MainActivity:
```
private static final String CHANNEL = "click2/hello";
```
At the end of onCreate:
```
new FlutterMethodChannel(getFlutterView(), CHANNEL).setMethodCallHandler(
new FlutterMethodChannel.MethodCallHandler() {
@Override
public void onMethodCall(MethodCall call, FlutterMethodChannel.Response response) {
Log.i("click", "method called: " + call.method);
}
});
```
Start the app in the debugger. You can set a breakpoint in Dart code but not in Java code. (But, if you log a message, it does show up in the console.)
Contributor guide
Assessment
This issue has not been assessed yet.