- Home /
Why doesn't my scene update when deploying to Android?
Greetings,
I am currently struggling with getting a prototype to deploy to my Nexus 7 (1st generation). I am actually suffering from two problems:
Sprites are not rendering
My scene does not appear to be updating
I observed the latter issue, that the scene is not updating, while attempting to troubleshoot the fact that none of my Sprites are loading.
What could cause my scene to not update properly on my Android device? It's pretty difficult for me to tell that this is happening, as nothing is rendering. However, if I delete GameObjects which play sounds when they are tapped/clicked, they disappear in the Editor but still play sounds when tapped on my Android device after re-deploying the scene.
I've even tried Uninstalling the app from the device between attempts, but for some reason the scene seems to be stuck.
Here's some background on what I'm doing:
I am building a 2D game and I want to have a very specific arrangement of many Sprites that I do not want to replicate by hand. I used Photoshop to cut each of the individual Sprites into their own files, so if I stack all of the Sprites on top of each other (using a Transparent/Cutout/Diffuse texture), they line up perfectly.
Using a script and an Editor plugin, I iterate over all of the Textures (loading them as Texture2D), create a Sprite object with Sprite.Create(), and then assigning the Sprite to the SpriteRenderer of a Prefab that I instantiate.
This all seems to work totally fine in the Editor, but none of the Sprites are actually rendering on my Android device.
As a shot-in-the-dark attempt at fixing the Sprite rendering issue, I deleted 98% of the GameObjects and left only a single Sprite (thinking maybe memory was the issue).
However, I can tell that the version of the app running on my Android device believes that the scene has not changed, and that the other GameObjects are still present. If I tap on parts of the screen where there should no longer be a GameObject, the OnMouseUp() trigger still fires.
How am I supposed to troubleshoot if I don't know if the Scene updated correctly or not :P
Does anyone have a good solution to guaranteeing that what is running in the editor / on your PC is actually what gets deployed to the damned Android device?
Thank you in advance for your help!
WOW there really is something magical about posting on the internet. Solved it INSTANTLY after posting this.
Answer by tigertrussell · Feb 22, 2015 at 05:59 PM
You're an idiot and have an old scene checked in your Build Settings
That's right folks, check your Build Settings and ensure that you're not being an idiot like me. I had saved a copy of a scene to go back to while I tried an experiment, but didn't switch which scene I was exporting to the device.
Hopefully this will save some other chump a couple hours. Apparently I fixed my Texture issue and just didn't know about it.
$$anonymous$$an! Lost a lot of time not being able to figure this one out! Oh man oh man! Thanks :)
laughed quite a bit when I saw it was still you who replied the insult
Hah, I just spent hours wondering why my fix wasn't working, and began to suspect the apk running on my device wasn't being updated. After ruling that out, I was completely out of ideas, until I found your post. Thanks :)
I can't believe, but I also fell into this trap! :D Wasted hours before I found your post and realized that the build included an older scene version. Dunno how and when it changed, but thx to your post I can relax now. :)
O$$anonymous$$G I was going mad trying to figure it out!
Answer by stefanob · Jul 15, 2019 at 10:05 AM
In my case "Script only Build" was selected in the Build Settings. So my scene changes didn't make it to my device :/
Answer by ajeets1978 · Nov 04, 2020 at 04:30 AM
In my case it was just the build number, it was not updating cos I already had the previous version.
Answer by Acoustic125 · Feb 25 at 01:33 AM
Man, 1st, thanks!
Just adding on for anyone coming along (especially since location might have changes since '15.) Look to the top in your build settings screen and you'll see where scenes can be selected. If your new like me, you'll probably only have one available. Uncheck that guy and choose to 'Add Open Scenes'. From there you can save as a new file, or just choose to overwrite the old one.
Your answer
Follow this Question
Related Questions
my android build is of 29mb but when i install it ,size become 50mb in device 0 Answers
Android dev - APK builder failed 0 Answers
Error build android app 1 Answer
Android - Design your app for tablets optimization tip on Google Play 0 Answers
Unity free builds a good APK, Unity Pro Doesn't... why? 0 Answers