Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

App Bundle and external storage

Discussion in 'Android' started by seven_, Feb 21, 2019.

  1. seven_

    seven_

    Joined:
    Sep 30, 2014
    Posts:
    42
    Hi,

    we have an app built with 2018.3.4f1. We are getting some hard crashes at startup when our app was moved to external storage (SD card). This is reported by users and we can also see this behaviour on our test devices.

    The app is distributed using Android App Bundles (built ourselves in Android Studio). We have all three architectures (armv7, v8 and x86) in the bundle. When we build the apk ourselves (it does not matter if we include all abis or just one), the problem does not occur.

    Important logs when running from SD card are here. It seems the native libraries are not found and the native implementation of nativeRestartActivityIndicator is thus missing:

    Unity : Unable to find main
    Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator() (tried Java_com_unity3d_player_UnityPlayer_nativeRestartActivityIndicator and Java_com_unity3d_player_UnityPlayer_nativeRestartActivityIndicator__)

    A user claims it was working in our previous release using 2018.2. I cannot verify this though.

    Does anyone know if something has changed in this respect in 2018.3? How does Unity load native libraries? The Android docs states that native libs are not moved to external storage but kept in internal device memory.
     
  2. seven_

    seven_

    Joined:
    Sep 30, 2014
    Posts:
    42
    I just did some more research on this. This bug is not related to Unity but to Android Studio. We have been using the Android Gradle plugin version 3.3.1 with the latest build. Using this version leads to a problem when moving to SD card (see Google issue tracker 123070510). We have now placed an updated app version with plugin version 3.2.1, which is working fine.
     
  3. par128

    par128

    Joined:
    Aug 13, 2013
    Posts:
    2
    We are experiencing the same issue with App Bundle. Our native library is not able to load when the app is moved to SD card.

    Our app doesn't use Unity.

    We are using gradle 3.4

    Turning abi split off doesn't help.
    bundle {
    abi {
    enableSplit = false
    }
    }

    Thank you for reporting the workaround!
     
  4. par128

    par128

    Joined:
    Aug 13, 2013
    Posts:
    2
    Another workaround proposed by Google
    "As a temporary workaround, you can also use android.bundle.enableUncompressedNativeLibs=false in your gradle.properties until we address this more permanently."
    https://issuetracker.google.com/issues/127691101