Unity3d Android app does not install properly when application binary is split - c#

The app runs fine in the editor, but when I run it on a device I get two errors:
java.io.FileNotFoundException : assets/build_info.txt
and then a error from my loading method that says the scene main_menu could not be loaded because its not in the build settings(it is);
What is this build_info.txt that I have never heard of before and why did it suddenly go missing after I imported the google OBB downloader plugin?
UPDATE : The problem seems to be connected to the split application binary option, since without it the app builds fine. Problem is I have to use it since its bigger than 50 mb.
UPDATE 2 : The problem magically fixes itslef after the device is restarted. This happens on multiple devices, even if the game is downloaded from the google play store.

For some reason removing the maxSdkVersion attribute from the <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> tag in the manifest solved the issue.

this might help
maybe you didn't add the scene into the build settings . thats why current scene is running on the editor but the build game is not running !
goto file-> buildSettings -> add the scene on the top box
or click the add current button.
the scene at 0 position will be loaded first !

Related

All my Unity projects contain blank compilation errors (only the timestamps), preventing any projects from working or importing correctly

I really need some help. I was rearranging file locations and trying to clear up some space and somehow broke the ability for Unity to operate on my laptop. The pictures of the errors are below.
This all started when I was moving a completely functional unity project from an external SSD to my internal laptop SSD. I had to clear space for the size of the project and I must have deleted something important, but I have no clue how to tell what it is.
Error seen when opening project
Editor view after opening
Error when trying to attach a script to a GameObject
Error in editor log
Steps I've taken:
I've restarted my computer several times.
I've completely uninstalled all editor versions and the unity hub (twice), including deleting all local app data for unity, emptying the temp bin, and clearing the keys in the registry.
I've started completely new projects, checked
old ones that used to work, downloaded sample ones from unity learn
just to make doubly sure that it's not me being dumb.
My current theory is that this has to do with me clearing some data from a National Instruments folder. I'm new to programming and just read online that these drivers are needed for .NET communication, but would this be why Unity keeps failing then?
This has all taken more than a few hours and I'm struggling to fix this if anyone has any suggestions, please. I'd really appreciate any insight.
Update: I'm able to make new scripts, objects, scenes, etc. but I can't attach any script components to game objects because "the script class can't be found"
Update #2: Checking the Editor logs shows that the Tundra build is failing, and the "93 items updated" matches the 93 errors that are shown. No idea what Tundra is, but that's something to look at now!
Update #3: fairly more certain it's something to do with the .NET interactions, but I'm completely unknowledgeable about this and worried about breaking this further
Answering my own question in case another person finds this and has the same issue, but the problem wasn't .net related or anything I mentioned. I uninstalled anaconda which caused some issues with the Command Prompt, where it would close immediately after opening. Unity uses this for a number of processes, so that's what caused all the blank errors.
The solution is to delete the Microsoft Command Processor AutoRun key in the registry editor.
https://forum.unity.com/threads/unity-empty-errors-on-every-project-unity-2021-3-2f1.1279124/
Cmd crashes with exit code 1 after uninstalling anaconda

Integrating unity and android

I'm developing an android-app that is supposed to open a Unity scene on a button click in android.
Let me explain it further:
I have developed a 4 scenes Unity project. Each scene has a model to be shown in AR. I have performed all the work I need to. I exported this project to android-studio. Integrated unity project with my android app. Now on different button clicks in android, I want to open different scenes in unity. I am not getting how to do it. I have 4 scenes, but when the unity opens, it opens scene 1.How can I open other scenes? I have written C# script to open different scenes but I don't understand where to attach it.
Can anyone please help me?
The buttons should call:
https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.LoadScene.html
to load a scene.
This does not work in the editor, only in the build itself.
To get it to work you also need to add all the scenes to the build.
You do that by opening a scene, then go to "File->Build Settings->Add open Scenes". Then you should see the scene and scene index in "Scenes in Build"

SceneManager.LoadScene is crashing for Android Devices

Ok, I've been testing a game with several scenes. In Unity and iOS devices, everything works perfect. In Android, always crash (or freeze if you prefer).
I'm using Unity 2017.2.0f3. and the line of code that crash is the next one (nextScene is a string with the value of the next scene):
SceneManager.LoadScene (nextScene);
I've been trying other options like:
SceneManager.LoadScene (nextScene, LoadSceneMode.Single);
But this is not working neither. The last one I tried was:
SceneManager.UnloadSceneAsync(UIManager.Instance.currentScene);
SceneManager.LoadScene (nextScene, LoadSceneMode.Single);
Again without success. Please I really need help with this. I've dealing with this problem for 24 hours. It's driving me crazy.
After more than 24 hours I solve the problem. I hope that my solution help other people because there isn't enough references on the web.
When I created the APK file it was splitter with a second one of type OBB. This kind of files is required when the Android App is too big. In my case was set by default.
The solution was to force the creation of the APK without the OBB. To do that you must get to Player Settings in Android, go to Publishing Settings and uncheck Split Application Binary (located at the bottom).
Everything's working now and life is good again.

Unity Game Not working even after building

My game is not working even after successfully building in the PC, Mac standalone.
I tried to build it both in 32 bit and 64 bit but the .exe is still not opening. The game is running in unity but not after building it. I've also tried to change the compatibility settings in the properties but nothing works.
Here's the Game link:
https://drive.google.com/open?id=0B7LawZAwfUJUUXNyU3hXS3ByQTQ
Here's My output_log.txt:
Mono path[0] = 'H:/Projects/Unity/FirstOne/Final/Roll A Ball ;)_Data/Managed'
Mono path[1] = 'H:/Projects/Unity/FirstOne/Final/Roll A Ball ;)_Data/Mono'
Mono config path = 'H:/Projects/Unity/FirstOne/Final/Roll A Ball ;)_Data/Mono/etc'
PlayerConnection initialized from H:/Projects/Unity/FirstOne/Final/Roll A Ball ;)_Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55357
Multi-casting "[IP] 192.168.1.110 [Port] 55357 [Flags] 3 [Guid] 3232448567 [EditorId] 4073115951 [Version] 1048832 [Id] WindowsPlayer(Aashish-PC) [Debug] 1" to [225.0.0.222:54997]...
Waiting for connection from host on [0.0.0.0:55357]...
PlayerConnection accepted from [192.168.1.110] handle:0x344
Started listening to [0.0.0.0:55357]
Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56567
When you build your game you get a folder called YourGame_Data, inside there's an output_log.txt. Look for logs or errors there to debug your build.
Edit: It seems in the end, the problem was the ;) in the game name.
When you build the .exe , it comes with a data folder for .exe to use. They need to be in the same folder.
Also someone says here looks like the same problem
So i fixed the problem. Now the Built game started immediatly.
I Unticked "Display Resolution Dialog".
And after, built the game two times to make sure it was the problem. And it was
Also can you add more details like;
-Does it give an error code?
-Does it stuck in loading screen?

Unity WebGL crashing on loadscene

Just finished a small game project and have uploaded the complete project via WebGL, however currently the game loads the first scene and crashes trying to load the main scene, there are no errors in the compiler and it works perfectly in the editor.
I'm not sure if this is just for me, so could someone try the game, it freezes(audio still playing) when you click play in the main menu.
http://www.willcardoso.co.uk/UnityGameBuilds/Mario/Completed/index.html
I believe that maybe it could be because the file size may be too big for google? Maximum Used Total Memory = 190mb. If this is the issue, any help on slimming down the file?

Categories