-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unity 2020.2 and AssetDelivery: Failed to load 'libmain.so' #80
Comments
Seeing he same issue. Just building using the normal Unity build pipeline is fine. Was in the process of adding Play Asset Delivery, so switched build tool to Google, and now seeing this issue. |
Were you able to look into this issue ? Thank you. |
Sadly, no. Still waiting on a reply from Google. We are luckily under 150mb right now so we are just bundling everything, but we will need this fixed in the next few months... |
On modern versions of Android, it's possible to load native libraries directly from an APK (e.g. split_config.armeabi_v7a.apk) if the libraries are stored uncompressed. This worked on Unity 2020.1 and prior versions, but seems not to work on 2020.2. Next I'll check to see if this has something to do with the versions of Android Gradle Plugin or bundletool that are used by Unity's built-in AAB export vs this plugin's AAB export that supports asset packs. |
Thank you for the explanation @thanwah . |
In my investigations I noticed that with the Google build system, the binary folders were incorrectly named. I think it was |
Hello, thks for your issue, that help me a lot. I confirme: Working great on:
Same issue on:
I'm using Unity as a library (via project export and Error reproduced only via app bundle: working great with apk. The app trying to load |
OK, I've narrowed this down. The issue has nothing to do with Play Asset Delivery specifically, but rather Android's extractNativeLibs feature. This is configured in bundletool as When this feature is enabled and working on a modern Android device, you should not to see any .so files inside of I tested both Unity 2020.1 and 2020.2 with both the "Export Project" feature followed by building an AAB, and Unity's built-in AAB build. This is 4 possible cases. Note: I installed each test app via:
Case 1: Unity 2020.1 + build AAB within Unity:
Result: .so files were extracted within /data/app 👎, and app runs fine 👍 Case 2: Unity 2020.1 + Export Project +
Result: .so files were NOT extracted within /data/app 👍, and app runs fine 👍 Case 3: Unity 2020.2 + build AAB within Unity:
Result: .so files were extracted within /data/app 👎, and app runs fine 👍 Case 4: Unity 2020.2 + Export Project +
Result: .so files were NOT extracted within /data/app 👍, and app crashes 👎 To be clear the above testing was done without any plugins in this GitHub project. These were just empty Unity projects and then we either built the AAB within Unity or ran "Export Project" and then build the AAB from the command line with gradle. Collectively, this implies that Unity 2020.2 stopped supporting Android's Note: as a workaround for someone who urgently needs to use Play Asset Delivery with Unity 2020.2, they could modify this plugin's code to always set |
Reproduced in pure empty project in Unity 2020.2.3f1. Workaround:
(It's the only difference between Exported Project and the project located in Temp when building from GUI) |
Any news from Unity about this ? I don't find any bug with this case number. |
I'm also waiting to hear more on this - is there a bug open with Unity's issue tracker we can upvote? Have they got back to you at all? |
I reported this issue to Unity as Case 1312344 on February 5. No feedback since then. I just asked QA to tag this case as public so you'll be able to upvote it. |
The official issue on the IssueTracker: https://issuetracker.unity3d.com/product/unity/issues/guid/1314472 |
@aplusm have you tested 2020.2.5f1? |
Repeating what I said here, in case it's useful for some people: This is still an issue with 2020.3.0f1 (also the gradle.properties workaround is not working in my Flutter project either). EDIT: Actually adding android:extractNativeLibs="true" to the element in AndroidManifest.xml as a temporary workaround does work with 2020.3.0f1. This might be specific to my version of Gradle (per | Android Developers, this is set to false by default in Android Gradle plugin 3.6.0). This isn't a long-term solution as Unity should be able to handle loading native libraries without extracting to the filesystem first. I also confirm this is still present in 2021.1.0b11 |
@nmfisher Thanks! Works for 2020.3.0f1. |
This works for Android bundles. Thanks @nick-dodonov |
Hi, |
When you update the project there is an error |
According to issue 1314472 this is fixed in
Note that some of these versions aren't yet live in Unity Hub. |
In 2021.2.0a11: |
I just tested Export Gradle Project, build AAB, and install APKs on two versions of 2020.3:
|
Unity 2020.2 and early versions of 2020.3 and 2021.1 had an issue that prevented native libraries from being loaded directly from an APK at runtime. Rather than work around the issue on these versions of Unity, we display an error message to encourage updating to a newer version. See issue #80 and https://issuetracker.unity3d.com/issues/android-app-installed-using-apk-from-app-bundle-option-in-android-studio-fails-to-run PiperOrigin-RevId: 366800462
Added a check for versions of Unity that will crash. Better that developers know of this issue at build time than encounter a potentially mysterious crash at runtime. |
Jump botton |
The same problem in version 2021.3.5f1. |
The same problem in version 2021.3.15f1 too. |
The same problem is still present in version 2022.3.5f1. |
@nick-dodonov Thanks. Your solution worked for me. |
Unity: 2020.2.1f1
play-unity-plugins: 1.3.0
Device: Samsung Galaxy A51
Android 10
I have 3 assets bundles, configured with Asset Delivery, with a delivery mode of Install Time.
When using Google > Build and run, the following error messages is displayed on my device:
Further information
The text was updated successfully, but these errors were encountered: