Repository navigation
Exception when hot loading CodeLab #13030
Copy link
Copy link
Closed
Description
Steps to Reproduce
Working through the codelab, after the step Add a SizeTransition widget, I attempted a hot reload and received the below exception.
flutter run ran fine afterwards, without code changes.
I/flutter ( 6857): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 6857): The following assertion was thrown building ChatMessage(dirty):
I/flutter ( 6857): 'package:flutter/src/animation/animations.dart': Failed assertion: line 334 pos 15: 'parent !=
I/flutter ( 6857): null': is not true.
I/flutter ( 6857):
I/flutter ( 6857): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 6857): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 6857): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 6857): https://github.com/flutter/flutter/issues/new
I/flutter ( 6857):
I/flutter ( 6857): When the exception was thrown, this was the stack:
I/flutter ( 6857): #2 new CurvedAnimation (package:flutter/src/animation/animations.dart:334:15)
I/flutter ( 6857): #3 ChatMessage.build (/data/user/0/flutter.marshalla.google.com.codelab/cache/codelabTUMAVO/codelab/lib/main.dart:106:23)
I/flutter ( 6857): #4 StatelessElement.build (package:flutter/src/widgets/framework.dart:3605:28)
I/flutter ( 6857): #5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3550:15)
I/flutter ( 6857): #6 Element.rebuild (package:flutter/src/widgets/framework.dart:3451:5)
I/flutter ( 6857): #7 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2251:33)
I/flutter ( 6857): #8 BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:580:20)
I/flutter ( 6857): #9 BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:200:5)
I/flutter ( 6857): #10 BindingBase&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:713:15)
I/flutter ( 6857): #11 BindingBase&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:649:9)
I/flutter ( 6857): #12 BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/rendering/binding.dart:286:20)
I/flutter ( 6857): #14 _Timer._runTimers (dart:isolate-patch/dart:isolate/timer_impl.dart:367)
I/flutter ( 6857): #15 _Timer._handleMessage (dart:isolate-patch/dart:isolate/timer_impl.dart:401)
I/flutter ( 6857): #16 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:163)
I/flutter ( 6857): (elided 3 frames from class _AssertionError and package dart:async-patch)
I/flutter ( 6857): ════════════════════════════════════════════════════════════════════════════════════════════════════
My revised ChatMessage now looks like this...
class ChatMessage extends StatelessWidget {
ChatMessage({this.text, this.animationController});
final String text;
final AnimationController animationController;
@override
Widget build(BuildContext context) {
return new SizeTransition(
sizeFactor: new CurvedAnimation(
parent: animationController,
curve: Curves.easeOut,
),
axisAlignment: 0.0,
child: new Container( ...And I'm passing in the AnimationController that should be assigned to parent:
ChatMessage message = new ChatMessage(
text: text,
animationController: new AnimationController(
duration: new Duration(milliseconds: ANIM_DURATION),
vsync: this,
),
);Flutter Doctor
$ flutter doctor
[✓] Flutter (on Mac OS X 10.12.6 16G1036, locale en-US, channel alpha)
• Flutter at /Users/marshalla/bin/flutter
• Framework revision e8aa40eddd (4 weeks ago), 2017-10-17 15:42:40 -0700
• Engine revision 7c4142808c
• Tools Dart version 1.25.0-dev.11.0
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.0)
• Android SDK at /Users/marshalla/Library/Android/sdk
• Platform android-27, build-tools 27.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[-] iOS toolchain - develop for iOS devices (Xcode 9.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.1, Build version 9B55
✗ ideviceinstaller not available; this is used to discover connected iOS devices.
To install, run:
brew install --HEAD libimobiledevice
brew install ideviceinstaller
✗ ios-deploy not installed. To install:
brew install ios-deploy
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.io/platform-plugins
To install:
brew install cocoapods
pod setup
[✓] Android Studio (version 2.3)
• Android Studio at /Applications/Android Studio 2.3.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
Error executing simctl: -6
dyld: Library not loaded: /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator
Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl
Reason: image not found
[✓] Connected devices
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
Hixie commentedon May 21, 2018
This is working as expected. As it says in the codelab:
github-actions commentedon Sep 3, 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 -vand a minimal reproduction of the issue.