一路坑。
05-02 17:46:49.594 16758 16758 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.your.fucking.appname-SWsiigYqHJtT2CXLc3kqpQ==/base.apk”],nativeLibraryDirectories=[/data/app/com.your.fucking.appname-SWsiigYqHJtT2CXLc3kqpQ==/lib/arm, /system/fake-libs, /data/app/com.your.fucking.appname-SWsiigYqHJtT2CXLc3kqpQ==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /product/lib]]] couldn’t find “libflutter.so”
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1660)
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at io.flutter.view.FlutterMain.startInitialization(FlutterMain.java:163)
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at io.flutter.view.FlutterMain.startInitialization(FlutterMain.java:148)
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at com.your.fucking.appname.FuckingApplication.onCreate(FuckingApplication.java:88)
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1122)
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6517)
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at android.app.ActivityThread.-wrap2(Unknown Source:0)
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1963)
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:108)
05-02 17:46:49.594 16758 16758 E AndroidRuntime: at android.os.Looper.loop(Looper.java:166)
解决问题过程很长。
- 首先你需要了解abi(NDK/jni 无论你叫什么也好)在工程中的原理、配置、优先级相关的知识。否则你将一直停留在这一步,无法前进。
- 你需要了解目前Flutter仍然是Beta版本(最新的是Beta2),并不完美,还会有一些问题。遇到问题需要深入研究解决。但这不影响你青睐Flutter的初衷。
3.反复调试、试错。最终可以完美解决问题。
如果你不想开启全新的Flutter项目,而希望把Flutter融入/加入/合并已有Android工程。那么下面讲讲Flutter如何和一个已有的Android项目融合。(未完·待续)