Hello Unity developers,
I want to setup Android native project, that has new Dynamic delivery module, which contains Unity project.
I do export Unity project as Android Gradle poject and use the outputs within a separate Android module. When I do a single APK build, everything works fine. When I change module containing Unity to be Dynamic delivery module, Unity Activity fails to load with this error:
E/mono: The assembly mscorlib.dll was not found or could not be loaded.
E/mono: It should have been installed in the `/data/app/[app-package]-7C8S67iKRfjcl60CtXjYaw==/base.apk/assets/bin/Data/Managed/mono/4.5/mscorlib.dll' directory.
Is it possible to setup project this way? Are there hardcoded references to assets to base.apk?
Note: mscorlib.dll is not generated in “mono/4.5/” subdir, it is generated directly in “bin/Data”
What is recommended way to have unity module loaded on demand (not containing it in main APK)?
Thanks for hints
We are also trying to achieve the same thing. You can check out the latest discussion on this thread: https://forum.unity.com/threads/integration-unity-as-a-library-in-native-android-app-version-2.751712/page-2
Have you been able to succeed in any way?
I exported the project in 2019.3.11b as the structure for exporting a Gradle project is more android Studio compatible, you can read about it here:
https://forum.unity.com/threads/using-unity-as-a-library-in-native-ios-android-apps.685195/
We haven’t been able to get it to work yet, the android developers have a conflict saying the asset path are the same even though 2 different unity library module has been imported. I have asked this question in the thread mention earlier.
unityLibrary\src\main\assets\bin\Data\Managed\Metadata\global-metadata.dat this is the path that gets a conflict. They have changed and modified the path but still, when they try downloading the game and play, the app crashes. Locally in android studio IDE using the virtual Device it works.