0

I'm facing a rather odd problem, I'm using unity 2017.3.1f1 Personal.

When I build the APK and I copy that file to the phone and install it from the phone's file manager, I can't switch from the main menu to the first scene, the game crashes at the load scene or just freezes after selection, thought it was due to the Async code so I tried without it and have no result at all.

When I select Build and Run this doesn't happen at all and the application runs normally, what I'm I missing here or how can I fix this? Already restarted unity and the computer many times.

Here's the code I'm using to switch in between scenes including the code without the Async mode:

 public void Car1()
 {
 selectedCar = 0;
 canvasManagerGO.GetComponent<CanvasManager>().Close();
 SceneManager.LoadScene("W" + selectedWorld + "-L1", LoadSceneMode.Single);
 }

 public void Car2()
 {
 selectedCar = 1;
 canvasManagerGO.GetComponent<CanvasManager>().Close();
 SceneManager.LoadScene(1, LoadSceneMode.Single);
 }

 public void Car3()
 {
 selectedCar = 2;
 canvasManagerGO.GetComponent<CanvasManager>().Close();
 StartCoroutine(ChangeScene("W" + selectedWorld + "-L1"));

 public IEnumerator ChangeScene(string sceneName)
 {     
 loadingCanvas.SetActive(true);

 AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Single);     

 while (!asyncOperation.isDone)        
 {
     float progress = Mathf.Clamp01(asyncOperation.progress / .9f);
     //Debug.Log(asyncOperation.progress);
     slider.value = progress;
     yield return null;
 }

 yield return null;
 }

Car 1 and 2 have a direct mode without using the coroutine to change the scene and none of them work, the code has no errors at all or at least the console is not reporting anything, I also tried with different build settings and compressions, also with or without development build to check the profiler and nothing, thanks you all :)

6
  • 1
    What is the device you are building on? Also what is your scripting runtime version? (Edit > Project settings > player > Other settings). If this is the experimental 4.6 version try switching back to 3.5 equivalent. This has been an issue for me before when building on a oneplus and certain samsung phones, with something similair happening. Also have you tried using adb debugging developer.android.com/studio/command-line/adb to see if there are any runtime errors?
    – Remy
    Commented Oct 8, 2018 at 14:36
  • Well, the phone where I'm installing is an Alcatel model 5054s (Pop3) with android 5.1.1, scripting runtime is Stable(.NET 3.5 Equivalent) and no I haven't tried the adb debugging don't know how to use it yet :( in your experience what should I be looking for in this debugger?
    – Herb
    Commented Oct 8, 2018 at 22:25
  • 1
    You can use it to read any error Unity spits (very much like with Connected players inside unity) But on top of that you can use it to also read any error happening outside of Unity (e.g caused by the OS)
    – Remy
    Commented Oct 9, 2018 at 6:33
  • if it is an OS error is it repairable? I'm thinking ahead here but if it isn't a problem or error with unity what would be an easier fix? perhaps switching unity version? I didn't realize these builds were uncompatible with some phones or such so I can't imagine if it's hard to modify them outside unity.
    – Herb
    Commented Oct 9, 2018 at 11:39
  • 1
    cross check that you have added all the scenes in the build Commented Oct 9, 2018 at 12:18

1 Answer 1

-1

I ran the ADB debugger and found nothing, the app just shows a blank line and that's it goes dead, I even put Lunar console on my project and it was a great help to see errors unity doesn't show but was not of much help either.

enter image description here

The solution I found was at this video https://www.youtube.com/watch?v=OxLa2uPW0dI I followed the exact settings for "player settings -> other settings" he used and apparently it solved the problem at least for now but can't point at which setting was causing this behaviour

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.