Open alkaou opened 1 year ago
Can you get a project running without OpenCV or other external libraries? If so we can focus this on OpenCV.
External libraries loaded in Unity often cause a crash because something is missing at runtime in the app. They might get stripped out during the flutter build, or their dll/aar files might not be properly included by gradle.
Below is what I responed on another issue about an external library. It isn;t foolproof to detect if things get stripped out, but it is a first step to diagnose it.
A common reason for 3rd party libraries to break is because some of their code is stripped out.
For example for ARfoundation on android to work, you need to specify -keep class com.unity3d.plugin. { ; } in proguard to avoid missing libraries.
But you would have to figure out the exact name of the inworld libraries to do the same.
As a test to see if it is being stripped you can do these 2 things:
Unity player settings > code stripping > minimal disable shrinking in the flutter build with --no-shrink.
If those 2 fix the crash, you know it is stripping. Otherwise it might be related to missing permissions or files being unreadable because of compression.
Hello everyone. I've been stuck at this for over a week. I'm using Unity 2022.2.1f1 and the latest version of flutter. I created a small OpenCv+Unity project. I installed flutter_unity_widget 2022.2.0 for flutter and fuw 2022.2.1 for unity editor. I exported the project on android platform as it is done in the tutorial and everything went well. but now when the app launches on my android 10 "flutter run", when loading the unity scene it crashes and closes automatically. however if I build the apk with unity editor it works fine. Please I need your help. I've been looking for the solution for over a week. thank you for the good understanding.
Here is some thing i got in console