XianyuTech / hybrid_stack_manager

Used for stack management in hybrid scenarios.
MIT License
163 stars 17 forks source link

真机会黑屏和无法点击 #2

Open wang-yaoqing opened 5 years ago

wang-yaoqing commented 5 years ago

iOS端:真机 iPhone 8 plus 系统版本12.0.1,点击点击一次 Click to open FlutterPage 或者 Click to jump Flutter , 就无法继续点击,过30秒后进入页面 ,然后闪退。 模拟器正常。

Android端:真机 华为 M2 系统版本6.0 点击一次黑屏。 闪退。Android 模拟器未测试。

kangwang1988 commented 5 years ago

闪退日志+使用的Flutter版本贴一下。 @wang-yaoqing

wang-yaoqing commented 5 years ago

FLutter 版本

Flutter 0.11.11 • channel beta • https://github.com/flutter/flutter.git Framework • revision e7680128af (25 hours ago) • 2018-11-27 21:33:50 -0500 Engine • revision be973ea196 Tools • Dart 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

直接运行Flutter 安卓真机日志

Built build/app/outputs/apk/debug/app-debug.apk. Installing build/app/outputs/apk/app.apk... Syncing files to device HUAWEI M2 801W... W/System.err(10956): java.lang.NoSuchFieldException: No field mDiscoveryReceiver in class Lio/flutter/view/FlutterView; (declaration of 'io.flutter.view.FlutterView' appears in /data/app/com.example.hybridstackmanagerexample-1/base.apk) W/System.err(10956): at java.lang.Class.getDeclaredField(Native Method) W/System.err(10956): at com.taobao.hybridstackmanager.XFlutterView.registerReceiver(XFlutterView.java:33) W/System.err(10956): at com.taobao.hybridstackmanager.FlutterWrapperActivity.onCreate(FlutterWrapperActivity.java:130) W/System.err(10956): at android.app.Activity.performCreate(Activity.java:6367) W/System.err(10956): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110) W/System.err(10956): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2397) W/System.err(10956): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504) W/System.err(10956): at android.app.ActivityThread.access$900(ActivityThread.java:165) W/System.err(10956): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368) W/System.err(10956): at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err(10956): at android.os.Looper.loop(Looper.java:150) W/System.err(10956): at android.app.ActivityThread.main(ActivityThread.java:5546) W/System.err(10956): at java.lang.reflect.Method.invoke(Native Method) W/System.err(10956): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) W/System.err(10956): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:682) I/System.out(10956): In new implementation for FlutterPluginRegistry,AssertionError is thrown when try to attach twice, it doesn't matter even we ignore it. W/System.err(10956): java.lang.NoSuchFieldException: No field mDiscoveryReceiver in class Lio/flutter/view/FlutterView; (declaration of 'io.flutter.view.FlutterView' appears in /data/app/com.example.hybridstackmanagerexample-1/base.apk) W/System.err(10956): at java.lang.Class.getDeclaredField(Native Method) W/System.err(10956): at com.taobao.hybridstackmanager.XFlutterView.registerReceiver(XFlutterView.java:33) W/System.err(10956): at com.taobao.hybridstackmanager.FlutterWrapperActivity.onCreate(FlutterWrapperActivity.java:130) W/System.err(10956): at android.app.Activity.performCreate(Activity.java:6367) W/System.err(10956): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110) W/System.err(10956): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2397) W/System.err(10956): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504) W/System.err(10956): at android.app.ActivityThread.access$900(ActivityThread.java:165) W/System.err(10956): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368) W/System.err(10956): at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err(10956): at android.os.Looper.loop(Looper.java:150) W/System.err(10956): at android.app.ActivityThread.main(ActivityThread.java:5546) W/System.err(10956): at java.lang.reflect.Method.invoke(Native Method) W/System.err(10956): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) W/System.err(10956): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:682) I/System.out(10956): In new implementation for FlutterPluginRegistry,AssertionError is thrown when try to attach twice, it doesn't matter even we ignore it.

iOS平台真机, Xcode 编译

控制台日志: 2018-11-29 13:44:07.040241+0800 Runner[9433:3344129] [VERBOSE-1:callback_cache.cc(132)] Could not parse callback cache, aborting restore 2018-11-29 13:44:07.460602+0800 Runner[9433:3344176] flutter: Observatory listening on http://127.0.0.1:50622/ 2018-11-29 13:45:39.464502+0800 Runner[9433:3344129] -[FlutterError getFileSystemRepresentation:maxLength:]: unrecognized selector sent to instance 0x280d501a0 2018-11-29 13:45:39.467862+0800 Runner[9433:3344129] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FlutterError getFileSystemRepresentation:maxLength:]: unrecognized selector sent to instance 0x280d501a0' First throw call stack: (0x1e3483ef8 0x1e2651a40 0x1e339b154 0x1e3489810 0x1e348b4bc 0x1e3f1613c 0x1e3e32de8 0x1e3e32d84 0x100b30348 0x100f49170 0x100f592c8 0x100f5c77c 0x1e3412bf0 0x1e3412920 0x1e3412154 0x1e340d030 0x1e340c5b8 0x1e5680584 0x210288bc8 0x100b2df9c 0x1e2eccb94) libc++abi.dylib: terminating with uncaught exception of type NSException warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available. image Xcode 引入 #import <Flutter/Flutter.h> 需要改这样才能运行 #import <Flutter/Flutter/Flutter.h> @kangwang1988