Closed ljmatan closed 3 years ago
I have the same problem here. With different code, different unity project. I tried the app on OnePlus, Xiaomi, Nokia phones, but all of them crashed when I tried to run in in release mode. When it was in debug, or profile, it has no problem to run. As I see the problem only occurs, when I use ARFoundation. If just a simple Unity project is inculded, it runs without any crashes.
ARCore for me, not the whole ARFoundation
@juicycleff do you think you could be providing any help or pointers for this issue? If it's unrelated to your package could you point me in the right direction?
The following does not work:
Switching to 2019.4.x version Updating Google AR services on device - https://github.com/google-ar/arcore-android-sdk/issues/1021 Selecting only ARM64 in build options - https://forum.unity.com/threads/ar-app-crashing-on-my-phone-when-arsession-is-loaded-unity-2019.950843/
https://github.com/google-ar/arcore-unity-sdk/issues/771 for reference
I suggest using asset streaming in unity, reduce the size of your unity app. Should solve the size issue
Although I appreciate your response as well as the effort put into this project I feel that this is something to be noted in the readme. Thanks.
I've put these two lines in the unityLibrary/proguard-unity.txt :
-keep class com.unity3d.plugin.* { *; }
-keep class com.xraph.plugins.flutterunitywidget.UnityUtils { *; }
It solved my problem. I can now build a release version, and it runs perfectly. Don't forget, to put back these two lines after every unity build because it regenerates the proguard-unity.txt and it will miss them.
@phobye perfect! Much appreciated.
When I run "flutter build apk --split-per-abi" the release app always crashes, however it works most of the time when I run "flutter run --release" (although this results in an app 30mbs larger than it should be).
This is happening on Samsung Galaxy A8 2018 API 28 and Samsung Galaxy S10 API 29. I have debug keys set for release mode the same way package's (3.0.1) README describes.
Sometimes the app crashes before the Unity personal licence splash screen, sometimes during the splash screen, and also sometimes nothing is visible in the terminal on crash (I did however manage to get one output shown below).
Code:
New issue created because of added details.