Ressource.Load returns null on "build" but work on "build and run"
Hello,
I have a problems with my android application generated with unity.
When i do "build and run" it works perfectly but when i do "build" and then install my apk on my phone the ressouce.Load return null for my json files (I have the same result even if i install manually the apk generated by the build and run task).
Here is my code :
TextAsset localeData = Resources.Load<TextAsset>("Datas/locale");
I tried this to see how many files I have in my resources folder :
Debug.Log (Resources.LoadAll("").Length);
When i do "build and run" it log 127 but when i install the app with build it log only 49. Like if some files where missing in the apk...
Am I do something wrong ?
Thank you for your help !
Answer by yoann8 · Feb 23, 2016 at 02:06 PM
Ok I accidentaly checked the split application binary in Publishing settings and Unity created two files (apk + obb)
Answer by yoann8 · Feb 23, 2016 at 11:13 AM
After some investingations i discover that the resources.assets was missing in my apk, there is only the sharedassets0.assets. But I still don't know why it's missing, if someone have an idea ?.. I'm using the last version of Unity (5.3.2).
Your answer
Follow this Question
Related Questions
Problem with Resources.Load in Android 0 Answers
Error building Player: CommandInvokationFailure: Failed to re-package resources. 0 Answers
Deserialize JSON data for android via WWW (JsonUtility / JsonFX) 2 Answers
Json doesnt work in android (unity) 0 Answers
Cannot write data into JSON file on Android's external memory 1 Answer