[ +783 ms] Crash report sent (report ID: bbed038d6c5d852a) [ ] Oops; flutter has exited unexpectedly: "NoSuchMethodError: The method 'matchAsPrefix' was called on null. Receiver: null Tried calling: matchAsPrefix("ERROR: FormatException: Could not find an option named \"bytecode-options\".", 0)".
同上 `the engine path should be “ FLUTTER_ROOT/engine/src “ because the compile script would compare the engine path with “FLUTTER_ROOT/engine/src” .
engine 版本要和 flutter sdk 版本相对应,The building engine version may not same as FLUTTER_ROOT version. Try to change the engine src version. // 也就是 “Flutter SDK依赖的Engine的commit id的值”
II. 如果终端运行失败的话,那就用 Android Studio 运行,然后查看 /Users/joakim.liu/Documents/Demo/my_app/ios/Flutter 下的 Generated.xcconfig 内容
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// This is a generated file; do not edit or check into version control. FLUTTER_ROOT=/Users/joakim.liu/development/flutter-1.22.2 FLUTTER_APPLICATION_PATH=/Users/joakim.liu/Documents/Demo/my_app FLUTTER_TARGET=/Users/joakim.liu/Documents/Demo/my_app/lib/main.dart FLUTTER_BUILD_DIR=build SYMROOT=${SOURCE_ROOT}/../build/ios OTHER_LDFLAGS=$(inherited) -framework Flutter FLUTTER_FRAMEWORK_DIR=/Users/joakim.liu/Documents/engine/src/out/ios_debug_sim_unopt FLUTTER_BUILD_NAME=1.0.0 FLUTTER_BUILD_NUMBER=1 FLUTTER_ENGINE=/Users/joakim.liu/Documents/engine/src LOCAL_ENGINE=ios_debug_sim_unopt ARCHS=arm64 DART_OBFUSCATION=false TRACK_WIDGET_CREATION=true TREE_SHAKE_ICONS=false PACKAGE_CONFIG=.packages
但用 Xcode12 打开工程后,不会出现模拟器选项,用 Android Studio 才能运行后就会出现模拟器选项,很怪异,可是 Android Studio 运行后 Generated.xcconfig 会发生变化。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// This is a generated file; do not edit or check into version control. FLUTTER_ROOT=/Users/joakim.liu/development/flutter-1.22.2 FLUTTER_APPLICATION_PATH=/Users/joakim.liu/Documents/Demo/my_app FLUTTER_TARGET=/Users/joakim.liu/Documents/Demo/my_app/lib/main.dart FLUTTER_BUILD_DIR=build SYMROOT=${SOURCE_ROOT}/../build/ios OTHER_LDFLAGS=$(inherited) -framework Flutter FLUTTER_FRAMEWORK_DIR=/Users/joakim.liu/development/flutter-1.22.2/bin/cache/artifacts/engine/ios FLUTTER_BUILD_NAME=1.0.0 FLUTTER_BUILD_NUMBER=1 DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue DART_OBFUSCATION=false TRACK_WIDGET_CREATION=true TREE_SHAKE_ICONS=false PACKAGE_CONFIG=.packages
如果将 Generated.xcconfig 改成终端运行后的内容,会报错
1 2
Package generate_package_config is currently active at path "/Users/joakim.liu/Documents/engine/src/flutter/tools/generate_package_config". Activated generate_package_config 0.0.0 at path "/Users/joakim.liu/Documents/engine/src/flutter/tools/generate_package_config".
// This is a generated file; do not edit or check into version control. FLUTTER_ROOT=/Users/joakim.liu/development/flutter-1.22.2 FLUTTER_APPLICATION_PATH=/Users/joakim.liu/Documents/Demo/my_app FLUTTER_TARGET=/Users/joakim.liu/Documents/Demo/my_app/lib/main.dart FLUTTER_BUILD_DIR=build SYMROOT=${SOURCE_ROOT}/../build/ios OTHER_LDFLAGS=$(inherited) -framework Flutter FLUTTER_FRAMEWORK_DIR=/Users/joakim.liu/development/flutter-1.22.2/bin/cache/artifacts/engine/ios FLUTTER_BUILD_NAME=1.0.0 FLUTTER_BUILD_NUMBER=1 DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue DART_OBFUSCATION=false TRACK_WIDGET_CREATION=true TREE_SHAKE_ICONS=false PACKAGE_CONFIG=.packages FLUTTER_ENGINE=/Users/joakim.liu/Documents/engine/src LOCAL_ENGINE=ios_debug_sim_unopt