Open arrterian opened 2 years ago
It usually happens when the flutter CLI itself crash. Can you copy all the output? Thanks!
π with @cgrand . To be sure :
clj -M -m cljd.build watch
flutter run
print the output
I'm seeing this issue as well...
Following @dupuchba's instructions the following occurs:
git clone https://github.com/Tensegritics/ClojureDart.git
cd ClojureDart/samples/counter
clj -M -m cljd.build init sample.counter
clj -M -m cljd.build watch
...
Compiling to Dart... @10:14
sample.counter
Easy peasy! π
flutter run
...
πͺ Running with sound null safety πͺ
...
<shift-r>
hot restart OK
Performing hot restart...
Restarted application in 465ms.
<r>
hot reload OK
Performing hot reload...
Reloaded 0 libraries in 104ms.
code src/sample/counter.cljd
<cmd-s>
save with or without code changes
<r>
hot reload fails
βββ‘ EXCEPTION CAUGHT BY WIDGETS LIBRARY ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The following _CompileTimeError was thrown building Reify$51(dirty, state: Reify$52#fe0eb):
Unimplemented handling of missing static target
The relevant error-causing widget was:
Reify$51
Reify$51:file:///Users/user/dev/ClojureDart/samples/counter/lib/cljd-out/sample/counter.dart:61:56
When the exception was thrown, this was the stack:
#0 StatefulElement.build (package:flutter/src/widgets/framework.dart:4870:27)
#1 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4754:15)
#2 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4928:11)
#3 Element.rebuild (package:flutter/src/widgets/framework.dart:4477:5)
#4 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2659:19)
#5 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:882:21)
#6 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:363:5)
#7 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
#8 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1081:9)
#9 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure>
(package:flutter/src/scheduler/binding.dart:862:7)
(elided 4 frames from class _RawReceivePortImpl, class _Timer, and dart:async-patch)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Performing hot reload...
Reloaded 2 of 587 libraries in 307ms.
Can you paste your cljd
code ?
Also it's a "good" idea to use hot-restart
@dupuchba
Terminal 1
clj -M -m cljd.build flutter
Lauching flutter run
More than one device connected; please specify a device with the '-d <deviceId>' flag, or use '-d all' to act on all devices.
Romanβs iPhone (mobile) β’ <device_id> β’ ios β’ iOS 15.4.1 19E258
iPhone SE (2nd generation) (mobile) β’ <device_id> β’ ios β’ com.apple.CoreSimulator.SimRuntime.iOS-15-2
(simulator)
macOS (desktop) β’ macos β’ darwin-x64 β’ macOS 11.6 20G165 darwin-x64
BTW: It's good to have the possibility to pass parameters for flutter run
Since I have multiple targets I run in Terminal 2 following command:
flutter run -d <divice-id>
Then any changes to file lead to the error mentioned in this issue.
Sorry for the delay @arrterian , can you update your compiler sha
and tell me if it is still bugging ? I cannot reproduce your error that's why it take so long to correct this bug :(
Still appears on the master branch :(
Gif last frame:
Actually, this is not a critical problem anymore. I just get that I did it wrong. And I could just pass options to cljd.build flutter
rather than run flutter run
manually in another terminal.
It bugs me that you have this, I am wondering if it is because you're using VS Code terminal.
I have this too. With the project that @lambdina sets up here: https://www.youtube.com/watch?v=dfmRNTmfYVg
I am also using the VS Code internal terminal, so will try without that now.
Same when I use terminal outside VS Code:
~/Projects/tests/clojuredart/form(:|β) % clj -M -m cljd.build flutter -d macos
Warming up `.clojuredart/libs-info.edn` (helps us emit better code)
Compiling cljd.core to Dart
Compiling to Dart... @11:55
tutorial.form
Bravissimo! π
Lauching flutter run -d macos
Launching lib/main.dart on macOS in debug mode...
Building macOS application...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:x86_64, id:F942E853-FF71-5E10-8871-D1A2E6B69E9A }
{ platform:macOS, arch:arm64, id:F942E853-FF71-5E10-8871-D1A2E6B69E9A }
Syncing files to device macOS... 97ms
Flutter run key commands.
r Hot reload. π₯π₯π₯
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
πͺ Running with sound null safety πͺ
An Observatory debugger and profiler on macOS is available at: http://127.0.0.1:55208/SzyO_rtR3FA=/
The Flutter DevTools debugger and profiler on macOS is available at:
http://127.0.0.1:9100?uri=http://127.0.0.1:55208/SzyO_rtR3FA=/
Compiling to Dart... @11:55
tutorial.form
You rock! π€
Performing hot reload...
βββ‘ EXCEPTION CAUGHT BY WIDGETS LIBRARY ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The following _CompileTimeError was thrown building Reify$51(dirty, dependencies:
[_LocalizationsScope-[GlobalKey#30b2f]], state: Reify$52#dc40f):
Unimplemented handling of missing static target
The relevant error-causing widget was:
Reify$51
Reify$51:file:///Users/pez/Projects/tests/clojuredart/form/lib/cljd-out/tutorial/form.dart:90:18
When the exception was thrown, this was the stack:
#0 StatefulElement.build (package:flutter/src/widgets/framework.dart:4919:27)
#1 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4806:15)
#2 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#3 Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#4 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2659:19)
#5 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:891:21)
#6 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:370:5)
#7 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1146:15)
#8 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1083:9)
#9 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:864:7)
(elided 4 frames from class _RawReceivePortImpl, class _Timer, and dart:async-patch)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Reloaded 2 of 589 libraries in 477ms.
form.cljd
:
(ns tutorial.form
"Form tutorial"
(:require ["package:flutter/material.dart" :as m]
[cljd.flutter.alpha :as f]))
(def my-custom-form
(f/widget
:with [my-controller (m/TextEditingController)]
:context ctx
(m/Scaffold
:appBar (m/AppBar :title (m/Text "Retrieve Text Input"))
:body (m/Padding :padding (m.EdgeInsets/all 16.0)
:child (m/TextField :controller my-controller))
:floatingActionButton (m/FloatingActionButton
:onPressed
(fn []
(m/showDialog
:context ctx
:builder (fn [_]
(m/AlertDialog :content
(m/Text (.text my-controller)))))
nil)
:tooltip "Show me the stuff"
:child (m/Icon (m.Icons/text_fields))))))
(defn main []
(m/runApp
(m/MaterialApp :title "Retrieve text field content"
:home my-custom-form)))
deps.edn
{:paths ["src"] ; where your cljd files are
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
tensegritics/clojuredart
{:git/url "git@github.com:tensegritics/ClojureDart.git"
:sha "885a3797ccc756d8eb91a08223d3a52817646612"}}}
MacOS Monterey 12.3.1 on an Macbook Pro M1 Max. Using Apple Silicon Flutter, but it seems like XCode is choosing the x64 destination anyway.
Let me know what more info I can provide, or other things I can test.
i have the same on macos m1 max
clj -M -m cljd.build flutter -d 'iPhone 11 Pro'
Warming up `.clojuredart/libs-info.edn` (helps us emit better code)
Compiling cljd.core to Dart
Compiling to Dart... @02:44
app.main
Easy peasy! π
Lauching flutter run -d iPhone 11 Pro
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Running Xcode build...
Xcode build done. 10.1s
Syncing files to device iPhone 11 Pro... 33ms
Flutter run key commands.
r Hot reload. π₯π₯π₯
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
πͺ Running with sound null safety πͺ
An Observatory debugger and profiler on iPhone 11 Pro is available at:
http://127.0.0.1:51704/wmCCpkkFZhA=/
The Flutter DevTools debugger and profiler on iPhone 11 Pro is available at:
http://127.0.0.1:9100?uri=http://127.0.0.1:51704/wmCCpkkFZhA=/
Compiling to Dart... @02:45
app.main
You rock! π€
Performing hot reload...
βββ‘ EXCEPTION CAUGHT BY SCHEDULER LIBRARY
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The following _CompileTimeError was thrown during a scheduler callback:
Unimplemented handling of missing static target
When the exception was thrown, this was the stack:
#0 Element.debugFillProperties (package:flutter/src/widgets/framework.dart:4400:14)
#1 StatefulElement.debugFillProperties
(package:flutter/src/widgets/framework.dart:5132:11)
#2 DiagnosticableNode.builder.<anonymous closure>
(package:flutter/src/foundation/diagnostics.dart:2992:17)
#3 DiagnosticableNode.builder (package:flutter/src/foundation/diagnostics.dart:2995:8)
#4 DiagnosticableNode.getProperties
(package:flutter/src/foundation/diagnostics.dart:3009:105)
#5 DiagnosticsProperty.toJsonMap
(package:flutter/src/foundation/diagnostics.dart:2726:57)
#6 DiagnosticsNode.toJsonList.<anonymous closure>
(package:flutter/src/foundation/diagnostics.dart:1665:19)
#7 MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#8 ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
#9 new _GrowableList._ofEfficientLengthIterable
(dart:core-patch/growable_array.dart:189:27)
#10 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#11 new List.of (dart:core-patch/array_patch.dart:51:28)
#12 ListIterable.toList (dart:_internal/iterable.dart:213:44)
#13 DiagnosticsNode.toJsonList (package:flutter/src/foundation/diagnostics.dart:1666:8)
#14 DiagnosticsNode.toJsonMap.<anonymous closure>
(package:flutter/src/foundation/diagnostics.dart:1628:25)
#15 DiagnosticsNode.toJsonMap (package:flutter/src/foundation/diagnostics.dart:1641:6)
#16 WidgetInspectorService._nodeToJson
(package:flutter/src/widgets/widget_inspector.dart:1517:18)
#17 WidgetInspectorService._reportStructuredError
(package:flutter/src/widgets/widget_inspector.dart:925:44)
#18 FlutterError.reportError (package:flutter/src/foundation/assertions.dart:1177:14)
#19 _debugReportException (package:flutter/src/widgets/framework.dart:6408:16)
#20 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2661:11)
#21 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:891:21)
#22 RendererBinding._handlePersistentFrameCallback
(package:flutter/src/rendering/binding.dart:370:5)
#23 SchedulerBinding._invokeFrameCallback
(package:flutter/src/scheduler/binding.dart:1146:15)
#24 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1083:9)
#25 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure>
(package:flutter/src/scheduler/binding.dart:864:7)
(elided 4 frames from class _RawReceivePortImpl, class _Timer, and dart:async-patch)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββ
Reloaded 2 of 589 libraries in 134ms.
my main.cljd
(ns app.main
;; pure dart package are imported using string
(:require ["package:flutter/material.dart" :as m]
[cljd.flutter.alpha :as f]))
(defn main []
(m/runApp
(m/MaterialApp
:title "Cljd Demo"
:theme (m/ThemeData :primarySwatch m.Colors/blue)
:home (f/widget
:state [counter 0]
:inherit [m/Theme]
(m/Scaffold
:appBar (m/AppBar :title (m/Text "ClojureDart Home Page vinurs"))
:body
(f/nest
m/Center
(m/Column
:mainAxisAlignment m.MainAxisAlignment/center
:children
[(m/Text "You have pushed the button this many times:")
(m/Text (str @counter)
:style (-> theme .textTheme .displayLarge))]))
:floatingActionButton
(m/FloatingActionButton
:onPressed #(swap! counter inc)
:tooltip "Increment"
:child (m/Icon m.Icons/add)))))))
I run the watch command from the tutorial:
Platform: MacOS 11.6 Java: openjdk 17.0.1 2021-10-19 LTS Clojure CLI version: 1.11.1.1107
Then after any changes to
.cljd
file I got the process crash: