好在,Dart 有一个 Zone 的概念,有点类似sandbox的意思。不同的 Zone 代码上下文是不同的互不影响,Zone 还可以创建新的子Zone。Zone 可以重新定义自己的print、timers、microtasks还有最关键的how uncaught errors are handled未捕获异常的处理
Flutter app crashed by java.lang.UnsatisfiedLinkError:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/xxxx/base.apk”],nativeLibraryDirectories=[/data/app/xxxx/lib/arm, /data/app/xxxx/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /product/lib]]] couldn’t find “libflutter.so” at java.lang.Runtime.loadLibrary0(Runtime.java:1011) at java.lang.System.loadLibrary(System.java:1660) at io.flutter.view.FlutterMain.startInitialization(FlutterMain.java:156) at io.flutter.view.FlutterMain.startInitialization(FlutterMain.java:133) at io.flutter.app.FlutterApplication.onCreate(FlutterApplication.java:22)
…
As you can see, flutter run seems like forgot to put “libflutter.so” into apk.
* What went wrong: A problem occurred configuring root project 'MyApp'. > Could not resolve all files for configuration ':classpath'. > Could not download jimfs.jar (com.google.jimfs:jimfs:1.1) > Could not get resource 'https://plugins.gradle.org/m2/com/google/jimfs/jimfs/1.1/jimfs-1.1.jar'. > Could not HEAD 'https://plugins.gradle.org/m2/com/google/jimfs/jimfs/1.1/jimfs-1.1.jar'. > Connect to d29vzk4ow07wi7.cloudfront.net:443 [d29vzk4ow07wi7.cloudfront.net/54.192.84.6, d29vzk4ow07wi7.cloudfront.net/54.192.84.168, d29vzk4ow07wi7.cloudfront.net/54.192.84.128, d29vzk4ow07wi7.cloudfront.net/54.192.84.173] failed: Read timed out