I’m currently developing an augmented reality app for Android and iOS with Unity (Pro 4.2.2f1) and metaio (basic SDK 4.5.2 / http://www.metaio.com/).
The app contains some quite large video files, so that it is larger than 200 MB in size…
In order to upload the android version to the Google Play Store, I need to split the app in an APK file and an expansion OBB file by enabling the “Split Application Binary” option in the Player Settings (Android) in Unity, since it’s larger then 50 MB.
This works fine, and I was already able to put it on the Google Play Store…
Now my problems:
As soon as I enable the “Split Application Binary” option in Unity, the metaio tracking stops working completely on my android devices, also when I test it directly on the device over USB. - Do you have any advice on this issue? Are there similar problems with other plugins? (I’m new to Android development… maybe I have to change something in the provided AndroidManifest.xml?)
If the first problem isn’t solvable (I don’t have much control over how metaio handles this, cross posted already in their forums… :S) I need to download the larger assets from the web after the first scene got loaded, and store them in the StreamingAssets folder manually. - I don’t know if I always have write access to that folder on an android device, since I’m quite new to Android development. - This would be the only workaround I see at the moment… Any hints on that would be appreciated as well
You cannot write files to StreamingAssets during runtime. Android app is an .apk package that you cannot modify in the device after it has been installed.
After many tries I got to the point where I narrowed the issue down to these log messages (adb logcat -s Unity):
I/Unity (13357): DllNotFoundException: metaiosdk
I/Unity (13357): at (wrapper managed-to-native) metaioSDK:getRequiredTextureSize ()
I/Unity (13357): at metaioDeviceCamera.createTexture (UInt32 enforceSize) [0x00000] in <filename unknown>:0
I/Unity (13357): at metaioDeviceCamera.Update () [0x00000] in <filename unknown>:0
I/Unity (13357):
I/Unity (13357): (Filename: Line: -1)
I/Unity (13357):
I/Unity (13357): DllNotFoundException: metaiosdk
I/Unity (13357): at (wrapper managed-to-native) metaioSDK:getTrackingValues (int,single[])
I/Unity (13357): at metaioTracker.Update () [0x00000] in <filename unknown>:0
I/Unity (13357):
I/Unity (13357): (Filename: Line: -1)
I/Unity (13357):
I/Unity (13357): DllNotFoundException: metaiosdk
I/Unity (13357): at (wrapper managed-to-native) metaioSDK:getTrackingValues (int,single[])
I/Unity (13357): at metaioTracker.Update () [0x00000] in <filename unknown>:0
I/Unity (13357):
I/Unity (13357): (Filename: Line: -1)
......
It seems like Unity is not able to find the metaio SDK (AR plugin) after merging the APK/OBB files. - The rest seems to work fine. - The metaio camera and all the tracking isn’t starting… the scene just freezes, but the GUI of the app works like expected.
I use the current ‘Google Play OBB Downloader’ plugin from the Unity Asset Store, and I followed the suggested step here: Unity - Manual: APK expansion files
(Side note 1: I found out that the generated OBB file contains all my streaming assets and a bin/Data folder with binary assets. One of them is names level0, which seems strange to me…)
(Side note 2: I also tried to install the app by hand over adb push/install. Same behavior as above…)
(Side note 3: Considering that I only need to provide some quite large MP4 video files in the OBB, I thought about building it by hand using AssetBundles for every file… - I never worked with AssetBundles though, and I’m not sure who to feed Handheld.PlayFullScreenMovie() with those files, or even how to uncompress them properly in the app…)
We need to deliver our product, and purchased the Unity Pro license for exactly that. A lot of time got already wasted by trying to solve this issue… so if there’s a solution to this, it would be great if the proper way of publishing >50 MB apps to Google Play would be documented somewhere.
Luckily, I’ve finally found a promising workaround right before to get the required video files on my device and play them back. It just downloads the files one by one and stores them to the SD card. Here the code I’ve used to test this:
This is working on my main testing device (SAMSUNG Galaxy Tab 2 10.1). If the app has rights to read/write to the SD card, Handheld.PlayFullScreenMovie() seems to be able to use normal file paths (like ‘/mnt/sdcard/Android/data/…’) which is not documented anywhere in the Unity documentation.
I’m going to try to implement this method now into the app, and hope it works on other devices too… it’s a workaround after all!