Closed
Description
init flutter
FlutterViewController *flutter = FlutterViewController.new;
[flutter setInitialRoute:router];
[nav pushViewController:flutter animated:YES];
scene
native1->flutter1->native2->flutter2
then pop
when flutter1 poped [flutterViewController dealloc] crashed
flutter git:(stable) flutter doctor -v
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale zh-Hans-CN)
• Flutter version 1.7.8+hotfix.4 at xxx
• Framework revision 20e59316b8 (11 天前), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at xxx
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• 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-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.3, Build version 10G8
• CocoaPods version 1.6.1
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] Connected device (2 available)
xx
• iPhone X • 2456ECF0-BB8E-4633-B3E7-140A1939CA0A • ios •
com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)
• No issues found!
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
xujunquan commentedon Jul 30, 2019
i use /Users/name/flutter/dev/integration_tests/ios_add2app this project to test
i only edit this file
`implementation FullScreenViewController
(void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
self.navigationController.navigationBarHidden = NO;
self.navigationController.hidesBarsOnSwipe = NO;
if (self.isMovingFromParentViewController) {
// Note that if we were doing things that might cause the VC
// to disappear (like using the image_picker plugin)
// we shouldn't do this. But in this case we know we're
// just going back to the navigation controller.
// If we needed Flutter to tell us when we could actually go away,
// we'd need to communicate over a method channel with it.
[self.engine setViewController:nil];
}
}
(void)viewDidLoad {
[super viewDidLoad];
UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"next" style:UIBarButtonItemStylePlain target:self action:@selector(next)];
self.navigationItem.rightBarButtonItem = rightBarItem;
}
(void)next {
FullScreenViewController *flutterViewController = [[FullScreenViewController alloc] init];
[flutterViewController setInitialRoute:@"full"];
// [[self reloadMessageChannel] sendMessage:@"full"];
[self.navigationController
pushViewController:flutterViewController animated:NO];
}
(void)dealloc {
NSLog(@"dealloc");
}
end`
run in simulateor will not crash but crashed in many real devices
[-]Multiple Entry flutterVC and pop [flutterViewController dealloc] crashed[/-][+]flutterViewController Multiple Entry and pop, [flutterViewController dealloc] crashed[/+]blasten commentedon Jul 30, 2019
cc @jmagman @xster
xster commentedon Jul 30, 2019
What is the crash trace and error?
xujunquan commentedon Jul 31, 2019
xster commentedon Jul 31, 2019
Seems related to flutter/engine#7919. Perhaps @chinmaygarde has insights.
guangmingzizai commentedon Jul 31, 2019
I also run into the same problem, any solution?
mekhi commentedon Aug 2, 2019
Overriding the dealloc method in a subclass of FlutterViewController, calling
[EAGLContext setCurrentContext:nil]
can solve this problem.xujunquan commentedon Aug 5, 2019
非常感谢,测试真机有效,不会闪退了
xster commentedon Aug 6, 2019
We'd still like to find and solve the root issue. Leaving this bug open.
10 remaining items