android / android/tuningfork

ReleaseAllScriptCaches error when launching Unity

Open
#23 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
62
Forks
33
PR merge metrics
No merged PRs in 30d

Description

Hi,

Plugin version 1.5
Unity version 2020.3.20

Within our main project, when launching Unity, the console shows the following error: `ReleaseAllScriptCaches did not release all script caches!`

Here is the relevant part of Editor.log:
```
Application.AssetDatabase Initial Script Refresh Start
Registering precompiled user dll's ...
Registered in 0.027311 seconds.
AssetDatabase: script compilation time: 0.070671s
Begin MonoManager ReloadAssembly
ReleaseAllScriptCaches did not release all script caches!
Remaining caches:
Native extension for LinuxStandalone target not found
Native extension for WindowsStandalone target not found
Native extension for iOS target not found
Native extension for Android target not found
Refreshing native plugins compatible for Editor in 224.66 ms, found 12 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
Refresh completed in 0.000001 seconds.
Refresh completed in 0.000000 seconds.
Refreshing native plugins compatible for Editor in 10.73 ms, found 12 plugins.
Mono: successfully reloaded assembly
Refresh completed in 0.000001 seconds.
Android Performance Tuner RefreshAssetsCompleted
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
Google.Android.PerformanceTuner.Editor.Initializer:RefreshAssetsCompleted () (at Library/PackageCache/com.google.android.performancetuner@1460780ffff9-1651255749193/Editor/Scripts/Initializer.cs:166)

(Filename: Library/PackageCache/com.google.android.performancetuner@1460780ffff9-1651255749193/Editor/Scripts/Initializer.cs Line: 166)
```

I can't reproduce the problem in an empty project. I can confirm that when I completely remove the AndroidPerformanceTuner plugin from the project, the error disappears. Also note that on subsequent script auto refresh within Unity, there is no such error in the console, the tuner generates properly.

```
Android Performance Tuner Initializer
UnityEngine.Debug:Log (object)
Google.Android.PerformanceTuner.Editor.Initializer:Init () (at Library/PackageCache/com.google.android.performancetuner@1460780ffff9-1651255749193/Editor/Scripts/Initializer.cs:113)
Google.Android.PerformanceTuner.Editor.Initializer:.cctor () (at Library/PackageCache/com.google.android.performancetuner@1460780ffff9-1651255749193/Editor/Scripts/Initializer.cs:108)
UnityEditor.AssetPostprocessingInternal:GetMeshProcessorsHashString ()

Android Performance Tuner RefreshAssetsCompleted
UnityEngine.Debug:Log (object)
Google.Android.PerformanceTuner.Editor.Initializer:RefreshAssetsCompleted () (at Library/PackageCache/com.google.android.performancetuner@1460780ffff9-1651255749193/Editor/Scripts/Initializer.cs:166)
```

As far as we can tell, the error doesn't seem to affect our project other than the plugin doesn't work after Unity starts (plugin setup window is completely empty with a big yellow warning icon top left, no text whatsoever). But after script refresh, setup window is fixed.

Our project is managed with Perforce so I had to mark all the files under /AndroidPerformanceTuner_gen to writable since the plugin regenerates or touches most of the files and we had tons of access denied errors. Not sure how that helps other than I'm wondering if there could be some permissions I missed that only affects Unity' start.

Would anyone have any insights on what could be causing this problem?

I'm also wondering if there is any ETA on the next release as I was checking some of the other issues (like #18) and would be interested in getting those fixes.

Thanks!

Contributor guide

Open the contributing guide

Research direction

Start with the Google.Android.PerformanceTuner.Editor.Initializer entry points in Library/PackageCache/.../Editor/Scripts/Initializer.cs at lines 108, 113, and 166, then compare startup with a later script refresh. Reproduce in Unity 2020.3.20 using the Perforce-managed project and inspect Editor.log for the cache and permission messages. Done means Unity starts without the error and the Performance Tuner setup window is populated immediately.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
game-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.