Search Issue Tracker

Fixed in 2021.2.X

Fixed in 2020.3.X, 2021.1.X

Votes

14

Found in

2020.2.0a12

2020.2.3f1

2021.1

2021.2

Issue ID

1314472

Regression

Yes

[Android] App installed using APK from app bundle option in Android Studio fails to run

Android

-

How to reproduce:
1. Create and open a new project
2. Open Build Settings and switch to the Android platform
3. Add Open Scenes to build
4. Check the "Export Project" checkbox
5. Click Export and select directory to export project to
6. Open the exported project using Android Studio
7. Click Build > Build Bundles(s) / APK(s) > Build Bundle(s)
8. Open Run > Edit Configurations... > launcher > General > Installation Options
9. Set "Deploy" to "APK from app bundle"
10. Click Run -> Run 'launcher'

Expected Behavior: app launches in the connected device
Actual Behavior: error message appears: "The full error message: Failure to initialize! Your hardware does not support this application. Failed to load 'libmain.so' java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/app/com.DefaultCompany.bugexportproject-9BuOMuJaMXjG4oK6dLN3SQ==/lib/arm/libmain.so" not found Press Ok to quit."

Reproducible with: 2020.2.0a12, 2020.2.7f1, 2021.1.0b11, 2021.2.0a8
Not reproducible with: 2018.4.32f, 2019.4.21f1, 2020.2.0a11

Reproducible devices:
VLNQA00335, Samsung Galaxy S20+ 5G (SM-G986B), Android 10, CPU: Exynos 990, GPU: Mali-G77
Pixel4a (customer information)

Not reproducible devices:
VLNQA00286, Meizu - (PRO 5), Android 7.0, CPU: Exynos 7 Octa 7420, GPU: Mali-T760
VLNQA00313, Huawei Y6 Ⅱ Compact (HUAWEI LYO-L01), Android 5.1, CPU: MediaTek MT6735, GPU: Mali-T720

  1. Response avatar

    Resolution Note (fix version 2021.2):

    Fixed in 2021.2.0a11

  2. Response avatar

    Resolution Note (fix version 2021.1):

    Fixed in 2021.1.2f1

  3. Response avatar

    Resolution Note (fix version 2020.3):

    Fixed in: 2020.3.3f1

Comments (9)

  1. Bf781473fc98ee68914ea9e2c7e19963?d=mm

    gingersdas34

    Apr 16, 2021 07:21

    I don't think using a custom gradle property template would work

  2. F733579f9035bad354e0d296876ad85d?d=mm

    HASSANHR

    Apr 14, 2021 18:54

    it is mentioned the the bug/error is fixed in unity 2021.1.2f1 I'm facing the exact same issue in this exact version !

  3. D4782d06b8857b5cb155c28cd162b5d4?d=mm

    SRG-Team

    Mar 30, 2021 15:18

    Apologies, didnt realize my link wouldnt work. These are the lines I commented to work around the issue:

    // Android Resolver Exclusions Start
    android {
    packagingOptions {
    /*exclude ('/lib/arm64-v8a/*' + '*')
    exclude ('/lib/armeabi/*' + '*')
    exclude ('/lib/mips/*' + '*')
    exclude ('/lib/mips64/*' + '*')
    exclude ('/lib/x86/*' + '*')
    exclude ('/lib/x86_64/*' + '*')*/
    }
    }

  4. D4782d06b8857b5cb155c28cd162b5d4?d=mm

    SRG-Team

    Mar 30, 2021 15:16

    This is also happening on Unity 2019.4.17f1

    Workaround is commenting out the following exclusions on the mainTemplate.gradle file:

    These exclusions uncomment themselves after building, but it works.

  5. 76ac92af3961ccefaa45a8d4287f027c?d=mm

    eVPublishing

    Mar 23, 2021 15:43

    Currently we can't upvote this because it is marked as "fixed", but I'm clearly experiencing this in 2020.3.0f1.

  6. 91e6a7f6c775e3587d29b02aa6b44434?d=mm

    epicoro

    Mar 22, 2021 17:19

    Temp workaround:

    Build APK instead of App Bundle.

  7. B18afe2e966967e316ae5f4fbdb676c1?d=mm

    unity_cwGdSCczCn3Frw

    Mar 15, 2021 10:34

    Repeating what I said here (https://forum.unity.com/threads/app-not-working-on-some-devices-failed-to-load-libmain-so.1031137/?gq=libmain.so), 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

  8. 46668fd31c1de9de98a240ad8c472a62?d=mm

    FlynnMac92

    Mar 11, 2021 21:52

    @NIK_D I've added that, resubmitted a build and had the same issue occur. Have you tested that with a live build in the Play Store and had success?

  9. B9b817f729c135b6acdee08b88d5af54?d=mm

    nik_d

    Mar 11, 2021 17:13

    Workaround:

    Use custom gradle properties template

    Add to its end:
    android.bundle.enableUncompressedNativeLibs=false

    (It's the only difference between Exported Project and the project located in Temp when building from GUI)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.