-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor freezes more than usual when hitting play. #378
Comments
Hi @axelbau24 , Thanks for your report! You've done everything right so far, but I've been unable to replicate the issue on my end. Can you tell me if you see any windows, dialogs, &c pop up after the first time you hit play (screenshot them if you like/can)? Do you see anything interesting in your Console window/would you mind sharing your Editor log? (note that if you don't feel comfortable sharing your Editor log publicly, you can file a bug here and link this issue/say you're trying to add information for this bug). Is there anything else of interest that you can think of in your setup? Are you using meta files? A version control system other than Git? Is part of your unity project readonly or stored on a synced volume (ex: Dropbox, iCloud, &c)? I'm checking in with the rest of the team to see if there's anything else we need to verify. Thanks, |
I have similar experiences with Firebase Core and Analytics. If I remove them from the project then everything goes back to normal. I doubt that this would make any difference, but I used External Dependency Manager for Unity (EDM4U) and Unity Package Manager to install the packages. Nothing is synced in the background for my project, it is a fairly straightforward setup. Code generation is set to .NET 4.x and IL2CPP, but changing the setting to Mono makes no difference. A similar delay also happens when I switch from my code IDE (JetBrains Rider) to Unity editor, if there was any change on the source code and it is recompiled in the background Unity editor stops responding for a good 15-20 seconds. I have tried profiling the editor to figure out what is going on. I am no expert on Unity profiling, but as it seems to me when this delay happens then profiler stops capturing anything until the editor starts working again. Please let me know if there was any other information I could provide. |
I have attached the editor log from the moment I press the play button: This line looks rather suspicious to me:
Edit: nevermind, I just realised it is msecs. :) |
Exact same issue mentioned by MateusMP. It takes almost 4-5 seconds to enter play mode in the empty project with just Firebase core installed from package manager. |
I am running Unity on Windows too, maybe this is an important piece of information. |
Thank you for your answer @patm1987 Here's my Editor Log Editor.log Also, noticed some iOS stuff happening, even though i'm just compiling for Android, just like @MateusMP did, In my case i don't see anything related to XCode, just the iOS resolver (which i don't think it should be there and also taking a long time to compile. Is there any way to disable this iOS resolver? EDIT: This was a completely empty project stored on my PC, no version control or cloud were used. |
I'm having a similar symptom (8 second slowdown right after entering playmode). Platform is set to Android. Same Unity and SDK version as original poster. I have also tried disabling all auto-resolve functions in the package, but this seems to get called no matter what. This is a critical issue. Using Google Analytics for Firebase, Firebase Core, and Firebase Cloud Messaging. |
I have the same issue.
|
The majority of this slowdown appears to be due to the Google Play Resolver / External Dependency Manager. When removed, the slowdown goes away. Of course, Firebase won't load so you'll need to add it in again before you build - and this option only works when using the manual install because if you're using Firebase unity packages it will not let you uninstall the EDM because the firebase libraries rely on them. |
@GorillaOne How do I remove that? Thanks! |
I have the same issue. |
I’m having the same issue, but on top of this the editor freezing for 20seconds after each code save. It’s getting unbearable. What would normally take me 2 mins to do, takes 3-4x as long. I also tried a vanilla build using a brand new project and only adding firebase - same issue. Anyone else experiencing delays between code changes and then switching over to the editor (even with out play)? |
I believe this is the same issue as in firebase/quickstart-unity#644 |
I think you are right - I was looking at firebase/quickstart-unity#644 earlier and sounds very similar. |
The issue is still present in 6.14.0, EDM version 1.2.153. As a workaround for those using the Package Manager versions, you can simply delete the Editor folder and Editor.meta file within You'll sometimes get an error message about failing to load Firebase.Editor.dll, but it seems you can safely ignore it. |
What would be the downside of this? Would it be that you can’t add any new firebase packages or does the dependency manager get re-added (and that’s why we need to remove each time?) |
You lose all firebase editor-specific functionality, but you can restore the folder when you actually need the functionality, and keep it removed when you don't. I assume you need it for building, resolving dependencies, probably for installing or removing packages too. Obviously not ideal but I think it's a serviceable workaround for now, until this issue is fixed. |
Same issue here!
|
Deleting this folder: The only workaround I was able to figure out is to remove Firebase from the project while I edit it and put it back when I create a new build. |
@almosr The workaround I posted definitely solves it for me. Maybe it's two different issues, or our environments are different somehow. A reminder just in case, Unity restores the folder when you open the project, so you have to delete it when the project is already open. |
@ideka When I deleted that aforementioned folder while Unity is open then the issue disappears, because Firebase fails to initialize. Unity keeps throwing various errors, I would rather recommend to remove Firebase from the dependencies, that is a cleaner way to workaround the issue. |
I had to switch to OSX to work on project :D |
Hi folks, We just updated EDM4U to 1.2.157. The most relevant changes to this thread is that now it will only initialize iOSResolver/AndroidResolver only if the current active build target is iOS/Android and not in play mode. That is, if your current build target is not iOS, iOSResolver initialization will never happen when you click on the Play button. If your current build target is iOS, iOSResolver initialization will happen after you exit the play mode. At least, it will not try to do the slow searching for You should be able to get the latest However, I can still see a couple of performance improvement for both EDM4U and Firebase SDK.
These searches use standard The tricky thing is AppDomain reloads whenever play mode starts (there is a flag introduced in later version of Unity which prevent this. I feel very skeptical about it.) Still looking into some solutions. And feel free to make some suggestoins. I'll keep this thread open until we have a better solution for the searching. Shawn |
Did anyone profile AssetDatabase.FindAsset()? I don't think it's an issue performance-wise, but if it is you can probably cache its path in EditorPrefs after the first FindAsset? |
I think it will be slower when the Unity project grows. Caching is tricky since those files can be added anytime with or without Unity is opened. Well, only if there is something that can be called only ONCE after the Unity is launched. The closest thing I get so far is using |
BTW, some improvement from the Firebase SDK will be included in the next release. |
Hello! [InitializeOnLoad]
public static class AutomaticCheckingSetting
{
private const string MENU_NAME = "Window/Firebase/Check Configuration Automatically";
private const string PREF_NAME = "firebase_check_config_automatically";
public static bool Enabled
{
get { return EditorPrefs.GetBool(PREF_NAME, true); } // Return true if the pref is not set
set
{
EditorPrefs.SetBool(PREF_NAME, value); // Saving editor state
}
}
// Called on load thanks to the InitializeOnLoad attribute
static AutomaticCheckingSetting() {
// Delaying until first editor tick so that the menu
// will be populated before setting check state, and
// re-apply correct action
EditorApplication.delayCall += () => Menu.SetChecked(MENU_NAME, Enabled); // Set checkmark on menu item
}
[MenuItem(MENU_NAME)]
private static void ToggleSetting()
{
Enabled = !Enabled;
Menu.SetChecked(MENU_NAME, Enabled);
}
} And here’s how the current code would use it: [InitializeOnLoad]
public class GenerateXmlFromGoogleServicesJson
{
static GenerateXmlFromGoogleServicesJson()
{
if (!EditorApplication.isPlayingOrWillChangePlaymode && AutomaticCheckingSetting.Enabled)
{
RunOnMainThread.Run(delegate
{
GenerateXmlFromGoogleServicesJson.CheckConfiguration();
}, false);
}
}
[MenuItem("Window/Firebase/Check Configuration Now")]
public static void CheckConfiguration()
{
// Check configuration logic
}
} |
☝️ Good proposal @JoNax97 ☝️ |
Indeed, checking the configuration is very useful, but It's not necessary on every recompile. Having a toogle to opt-out and a manual check option sounds awesome. @JoNax97's proposal looks great! |
@JoNax97 excellent proposal, we are having the same problem. |
@chkuang-g Have you had time to check the code I posted? :) |
This is great proposal. Thanks for sharing. |
This issue manifested in another way for me. It completely killed my ability to build the game. Due to a separate issue, our build generates a bunch of assets, and it does so by writing them to a folder that is inside the Assets directory. This was causing there to be a refresh in Unity after every file. Thousands of files were being written, so we were incurring this added delay thousands of times. Builds would go for 5 hours before being killed off, and probably would take days if left running. We sort of fixed the original problem by pausing refreshes with StartAssetEditing() and StopAssetEditing() calls before/after the asset generation, and that has alleviated the problem, but there are other aspects of our build that are outside of that, so still incurring overhead from the Firebase issue. |
after adding a real-time database script I cant use the play button anymore, I tracked the problem to this code
Of course, we need this to be able to push and pull values from the DB, anyone found any solution? |
I have similar kind of issue on Unity 2019.4.16f1, Editor permanently freezes after 2nd/3rd Play or 2nd/3rd code compiling in Visual Studio, so I have to restart Unity every time. I have Firebase Database, Storage and Remote Config. I didn't have this issue before, even though I had freezes from time to time, but now I have this problem and don't quite understand where it came from. |
@chkuang-g |
Guys, come on! Is there any update yet on the issue? I am having serious troubles for some times now, can't work for more than 5 minutes in same project without needing to force kill unity! |
Hi, |
I was having the same problem but found out that the cause is the anti-virus protection. |
Still a problem on Windows in 2023, any updates? |
Stumbled on this thread while trying to improve editor performance. Adding our voice here - this is a serious issue that doubles the time it takes for Unity to recompile for us. We started using Firebase last month but we're going to have to abandon it due to this issue. |
@tomkail we ditched the Firebase SDK and I just wrote our own implementation using the REST API endpoints. For us we just needed auth and the existing NuGet package for auth was giving us problems on certain versions of Unity. |
Any fixes? still an issue as of now, unity version: 2021.3.2f1, iOS Target Build in Unity Windows Platform after integrating the firebase messaging plugin, tried it with our current 10.6.0 firebase version with external dependency version of 1.2.175 & also updated it to 11.6.0 version with external dependency version of 1.2.177 still the same freezing on playmode. |
Can anyone suggest an alternative plugin for this? We really want fast
compile times back.
…On Fri, 17 Nov 2023 at 02:10, novi-ranoja ***@***.***> wrote:
[image: image]
<https://user-images.githubusercontent.com/96708166/283647609-b75bc05c-c5c4-4079-8169-eea3c613a0c3.png>
Any fixes? still an issue as of now, unity version: 2021.3.2f1, iOS Target
Build in Unity Windows Platform
after integrating the firebase messaging plugin, tried the 10.6.0 firebase
version with external dependency version of 1.2.175 & also updated to
11.6.0 version with external dependency version of 1.2.177 still the same
freezing on playmode.
—
Reply to this email directly, view it on GitHub
<#378 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJR3UG6FEYBWNHDEDCUSHDYE3BPRAVCNFSM5ZYTSG4KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRGU3DGNJQHA2A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@novi-ranoja editor freezing is generally a problem related to unity 2021, in my experience. Maybe you can try to upgrade to 2022 |
Please fill in the following fields:
Unity editor version: 2019.3.7f1
Firebase Unity SDK version: 6.13.0
Source you installed the SDK (.unitypackage or Unity Package Manager): .unitypackage
Firebase plugins in use (Auth, Database, etc.): FirebaseMessaging.unitypackage
Additional SDKs you are using (Facebook, AdMob, etc.): None
Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows 10
Platform you are targeting (iOS, Android, and/or desktop): Android
Scripting Runtime (Mono, and/or IL2CPP): Tried both
Please describe the issue here:
(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)
Everytime i hit play (even on a empty project), Unity takes too long to build, compared to the usual time, this is not practical for me.
Also, when the game starts (the play button becomes blue), the editor completely freezes for a few seconds as if it was compiling the game once again.
Am i doing something wrong ?
To easily reproduce this issue:
This problem happens even if you don't have any base code running.
Also, tried adding the google-services.json, but it doesn't do anything in this case.
Please answer the following, if applicable:
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
Yes, the exact same thing happens here, and it feels worse.
What's the issue repro rate? (eg 100%, 1/5 etc)
100%
The text was updated successfully, but these errors were encountered: