Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Debug.isDebugBuild is false even with "development build" set to true

Discussion in 'Editor & General Support' started by mattseaton22, Oct 14, 2022.

  1. mattseaton22

    mattseaton22

    Joined:
    Sep 12, 2019
    Posts:
    43
    I'm playing around with the Boss Room demo trying to get a host and client running on the same machine. One in the editor, one in a build. But it always fails to connect due to ConnectStatus.IncompatibleBuildType.

    I checked and Debug.isDebugBuild doesn't match in the build because it is still false even though I checked "Development Build" in the build settings. Is this supposed to be the case? It is definitely in developmer mode. I can see the log console and everything in the build.

    I had this problem in my own project but I forgot how I resolved it.
     
  2. RobAtApex

    RobAtApex

    Joined:
    Jun 19, 2017
    Posts:
    21
    I just found the same thing. "Development Build" is ticked when I build for Android, but when running on the device Debug.isDebugBuild is returning false. No, it's not meant to do that. It worked properly last time I tried.

    I managed to fix it though. Before this I had switched from Full Screen to Windows, and changed the minimum dimensions to 1920x1080 as a test. I then changed back to Full Screen. It was after that that the dev build setting didn't work. I changed these things back and then it worked again. I presume it's not about these settings in particular, but just requires making some change to the platform settings in order to get it to refresh.
     
  3. gulige001

    gulige001

    Joined:
    Dec 10, 2022
    Posts:
    1

    Thanks. I used precompiled directives instead:

    #if DEVELOPMENT_BUILD || UNITY_EDITOR
     
    makaka-org and ALEXWARELLC like this.
  4. Toadwolf

    Toadwolf

    Joined:
    Sep 4, 2014
    Posts:
    10
    Just had the same problem, Debug.isDebugBuild being false although I explicitly set BuildOptions.Development in BuildPlayerOptions.
    I managed to solve the problem with what is usually the first thing I try in such weird and unexplainable cases: I deleted the Library folder of my project. It takes quite a time to rebuild, but the problem is gone, at least for now.
    I've been using Unity 2021.3.10f1, but I am upgrading to 2021.3.27f1 now. Maybe the issue is gone then.
     
  5. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    502
    This works, thanks for the suggestion! So much better than having to rebuild the library!
     
  6. OmarVector

    OmarVector

    Joined:
    Apr 18, 2018
    Posts:
    140
    The solution that worked for me is to make a clean build without need to remove the library folder

    The first reason that caused this issue is I made a release build and then did a dev build after which for some reason caused this issue

    You just need to click on this tiny down arrow on the Build button and choose clean build
    upload_2023-10-11_10-42-48.png
     
  7. JoaCHIP

    JoaCHIP

    Joined:
    Nov 5, 2020
    Posts:
    9
    I can confirm that a full "Clean build" is necessary to make this value update correctly. A normal "Build" will not update theDebug.isDebugBuild value.
     
    rastorguevs likes this.