Alessandro, thank you for clarifying the direction the team is taking to support Split Application Binary for Android builds.
But having followed your steps, I am still getting a crash in the application when trying to load the Dataset.
So this are the steps that I've followed:
1. created a first scene to extract and copy the Datasets to the suggested path “/<external storage>/Android/data/your.package.name/files/QCAR/”:
void Start () {
StartCoroutine(GetDatasets ());
}
protected IEnumerator GetDatasets () {
string[] filesInOBB = {"QCAR/BM.dat", "QCAR/BM.xml", "QCAR/british_museum.dat", "QCAR/british_museum.xml", "QCAR/Hebe.dat", "QCAR/Hebe.xml", "QCAR/Hebe5Ang.dat", "QCAR/Hebe5Ang.xml", "QCAR/HOC_TARGET.dat", "QCAR/HOC_TARGET.xml", "QCAR/hoc2_2Wheel.dat", "QCAR/hoc2_2Wheel.xml", "QCAR/HocNew.dat", "QCAR/HocNew.xml", "QCAR/LAYER_GAME.dat", "QCAR/LAYER_GAME.xml", "QCAR/PedimentAng.dat", "QCAR/PedimentAng.xml"} ;
foreach (var filename in filesInOBB) {
Debug.Log("Will load: " + filename);
string uri = Application.streamingAssetsPath + "/" + filename;
string targetFilePath = Application.persistentDataPath + "/" +filename;
if(!Directory.Exists(Path.GetDirectoryName(targetFilePath)))
Directory.CreateDirectory(Path.GetDirectoryName(targetFilePath));
Debug.Log("WWW: " + uri);
var www = new WWW(uri);
yield return www;
if (www.error != null) {
Debug.Log("WWW Error!!!!!: " + www.error);
yield break;
}
Debug.Log("Success!!!!! "+ Application.persistentDataPath + "/" + filename);
File.WriteAllBytes(Application.persistentDataPath + "/" + filename, www.bytes);
yield return new WaitForEndOfFrame();
}
StartGame();
}
private void StartGame() {
Application.LoadLevel("BMStartScene");
}
2. Load the scene with all my augmentation as normal
Of course the project works perfectly without the split of the application binary, but when spplication is splitted, I am getting this error:
I/Unity (22274): SetHint
I/Unity (22274):
I/Unity (22274): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity (22274):
D/dalvikvm(22274): Trying to load lib /data/data/com.gamar.bmgame/lib/libQCARWrapper.so 0x41818aa0
D/dalvikvm(22274): Shared lib '/data/data/com.gamar.bmgame/lib/libQCARWrapper.so' already loaded in same CL 0x41818aa0
D/dalvikvm(22274): Trying to load lib /data/data/com.gamar.bmgame/lib/libQCARWrapper.so 0x41818aa0
D/dalvikvm(22274): Shared lib '/data/data/com.gamar.bmgame/lib/libQCARWrapper.so' already loaded in same CL 0x41818aa0
D/QCAR (22274): Setting Unity version 4.5.0
D/dalvikvm(22274): Trying to load lib /data/data/com.gamar.bmgame/lib/libQCARWrapper.so 0x41818aa0
D/dalvikvm(22274): Shared lib '/data/data/com.gamar.bmgame/lib/libQCARWrapper.so' already loaded in same CL 0x41818aa0
D/dalvikvm(22274): Trying to load lib /data/data/com.gamar.bmgame/lib/libQCARWrapper.so 0x41818aa0
D/dalvikvm(22274): Shared lib '/data/data/com.gamar.bmgame/lib/libQCARWrapper.so' already loaded in same CL 0x41818aa0
D/QCAR (22274): dataSetExists
I/Unity (22274): Data set HOC_TARGET not present in application package, checking extended root locations
I/Unity (22274):
I/Unity (22274): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity (22274):
I/ActivityManager( 2139): Process com.gamar.bmgame (pid 22274) (adj 0) has died.
D/SensorService( 2139): SensorDevice::activating sensor handle=0 ns=66667000
V/LvOutput( 1832): initCheck: 0
D/iNemoSensor( 2139): setDelay(): handle(0), en(66667000)
Any further help will be aprreciated...
Hey,
You're right, application.version returns the unity version, not the bundle version. Sorry, my bad.
Here is a version that uses the created date of the original instead.
Best,
Mattijs