PlayEveryWare / eos_plugin_for_unity

Repository for PlayEveryWare's EOS Plugin for Unity, bringing the functionality of Epic Online Services to the Unity Game Engine.
https://eospluginforunity.playeveryware.com
MIT License
273 stars 49 forks source link

Android: `log_level_config.json` not found. #788

Closed jollypunch closed 1 day ago

jollypunch commented 1 month ago

I'm seeing this error in Android build after updating to latest from 3.1.0:

Error Unity FileNotFoundException: Config file "jar:file:///data/app/~~GlkpSHNC1KZ_kWCHd5yOKw==/*package name*-6PIJZtVpcHpmNAccpkJn_Q==/base.apk!/assets/EOS/log_level_config.json" does not exist.

I see the file in StreamingAssets/EOS, and I'm not seeing the issue in editor and PC, PS5 builds. Not sure about other platforms.

Using Unity 2021.3.35. Is there any special setup needed for the new config file on Android?

arthur740212 commented 1 month ago

Here are some steps to troubleshoot this. First, regenerate a log_level_config.json with the in Tool -> Log Level Configuration Then try unzipping the built apk and check if the log_level_config.json exists.

paulhazen commented 1 month ago

Hi @jollypunch, thanks for reaching out!

~I suspect that this may be a bug with our latest release. I will look into this issue and will either have a hotfix release for tomorrow morning that resolves the issue and will try to provide you with a stop-gap solution.~

Crossed out the comment above because upon closer inspection of the issue filed above you note that you are using the latest, but then state that you are using 3.2.0, which is not the latest.

Can you confirm which version of the plugin you are experiencing the issue with?

From there I can determine how to proceed, whether that be with a new hotfix, or with a suggestion to upgrade to 3.3.0 (another possibility is that we could ship a hotfix for the release you are using, if upgrading is not an option for you for one reason or another).

In lieu of an answer regarding which version exactly you are utilizing, I will investigate the issue in our 3.3.0 release, and if it still exists there will work toward a hotfix.

~@arthur740212, @WispyMouse do y'all have any other thoughts or otherwise have mind me taking ownership of this issue to run with it?~

They don't mind, so I'm taking it 😁

paomeng-game commented 1 month ago

Hey guys,I download and import eos plugin 3.30 version in release page, it seems works well in any other platform, but in Android Build, in my game, doesn't work well.

paomeng-game commented 1 month ago

Here are some steps to troubleshoot this. First, regenerate a log_level_config.json with the in Tool -> Log Level Configuration Then try unzipping the built apk and check if the log_level_config.json exists.

Appreciated to your idea, while it still doesn't work on Android Build, and when I unpack the apk file, I found log_level_config.json in on EOS folder indeed, Ummm... In fact, It make me many days to deal with this error. It was EOS Auth Interface Login not effect at all that I notice this error with a development build in Unity, as I debug it in VS2019. I try to move the file in this git respritory into StreamingAssets in my project, but continue to get this problem, then I try your solution, as before... 屏幕截图 2024-07-15 231623 I used to change EOSManager.cs as this and it works. Screenshot 2024-07-18 182934

arthur740212 commented 1 month ago

We have identified the issue. In Config.Read, File.Exist does not work for android files and will always return false, which then always throws an exception and prevent anything else from happening. We are working on a fix and include it in the next release. In the meantime, if you don't need customize log levels, using your fix should be fine. Thank you for the feedback.

jollypunch commented 1 month ago

Thank you, any ETA on release for this fix?

jollypunch commented 4 weeks ago

Was the fix included in 3.3.1? I updated but I'm still getting the same error message.

Prabesh002 commented 3 weeks ago

Was the fix included in 3.3.1? I updated but I'm still getting the same error message.

Hello, I am encountering the same issue as well but except there is no fix for now image log level config does not exists. I am using 3.3.1

paulhazen commented 2 weeks ago

Since this issue does not appear to have been successfully resolved, I am re-opening it and will follow up shortly.

arthur740212 commented 2 weeks ago

Hello, the fixes are in 3.3.1. Users can regenerate a log_level_config.json with the window in Tool -> Log Level Configuration.

Update : I have mistaken, they are not in 3.3.1 as it was a hotfix for something else related to log configs

theo-rapidfire commented 2 weeks ago

Did a bit of investigation: the fix is not included in the release.

Investigation notes below:

The first launch after updating from 3.2.1 gives this exception during startup:

NullReferenceException: Object reference not set to an instance of an object
PlayEveryWare.EpicOnlineServices.LogLevelUtility.get_LogLevelList () (at ./Library/PackageCache/com.playeveryware.eos@3883db1ade/Runtime/Core/Utility/LogLevelUtility.cs:51)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.InitializeLogLevels () (at ./Library/PackageCache/com.playeveryware.eos@3883db1ade/Runtime/Core/EOSManager.cs:775)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.Init (PlayEveryWare.EpicOnlineServices.IEOSCoroutineOwner coroutineOwner, System.String configFileName) (at ./Library/PackageCache/com.playeveryware.eos@3883db1ade/Runtime/Core/EOSManager.cs:591)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.Init (PlayEveryWare.EpicOnlineServices.IEOSCoroutineOwner coroutineOwner) (at ./Library/PackageCache/com.playeveryware.eos@3883db1ade/Runtime/Core/EOSManager.cs:556)

The entrypoint is a call to EOSManager.Instance.Init(eos).

Subsequent launches gives this exception:

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <b11ba2a8fbf24f219f7cc98532a11304>:0)
PlayEveryWare.EpicOnlineServices.LogLevelUtility.get_LogLevelList () (at ./Library/PackageCache/com.playeveryware.eos@3883db1ade/Runtime/Core/Utility/LogLevelUtility.cs:51)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.InitializeLogLevels () (at ./Library/PackageCache/com.playeveryware.eos@3883db1ade/Runtime/Core/EOSManager.cs:775)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.Init (PlayEveryWare.EpicOnlineServices.IEOSCoroutineOwner coroutineOwner, System.String configFileName) (at ./Library/PackageCache/com.playeveryware.eos@3883db1ade/Runtime/Core/EOSManager.cs:591)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.Init (PlayEveryWare.EpicOnlineServices.IEOSCoroutineOwner coroutineOwner) (at ./Library/PackageCache/com.playeveryware.eos@3883db1ade/Runtime/Core/EOSManager.cs:556)

Debugging shows that the LogCategoryStringArray is out of sync with the logLevelConfig.LogCategoryLevelPairs list.

image image

(an extra small bonus issue, doesn't feel important) Opening the Log Level Configuration tool mentioned above spams import warnings while the log_level_config asset is selected. image

[Worker0] Import Error Code:(4)
Message: Build asset version error: assets/streamingassets/eos/log_level_config.json in SourceAssetDB has modification time of '2024-08-14T21:03:51.7697475Z' while content on disk has modification time of '2024-08-14T21:03:52.1448363Z'

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

After saving the default log states using the tool, the errors appear to have been resolved in the Editor, but it does not work in an Android build, where I get this exception:

Exception: FileNotFoundException: Config file "jar:file:///data/app/~~NI-PtCGRmOdYWrO8YW_GWA==/com.rapidfiregames.backpackbrawl-2G5m7idDwaHqoi8DZm-IEQ==/base.apk!/assets/EOS/log_level_config.json" does not exist.
PlayEveryWare.EpicOnlineServices.Config.Read () (at <00000000000000000000000000000000>:0)
PlayEveryWare.EpicOnlineServices.Config.Get[T] () (at <00000000000000000000000000000000>:0)
PlayEveryWare.EpicOnlineServices.LogLevelUtility.get_LogLevelList () (at <00000000000000000000000000000000>:0)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.InitializeLogLevels () (at <00000000000000000000000000000000>:0)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.Init (PlayEveryWare.EpicOnlineServices.IEOSCoroutineOwner coroutineOwner, System.String configFileName) (at <00000000000000000000000000000000>:0)

Looking at the package content, the changes made in the pull request https://github.com/PlayEveryWare/eos_plugin_for_unity/pull/792/files has not been included in the release.

image

This can also be confirmed by looking at the upm repo - the changes are not present: https://github.com/PlayEveryWare/eos_plugin_for_unity_upm/blob/3883db1ade572305d67299a13af84f664734328c/Runtime/Core/Config.cs#L281

arthur740212 commented 2 weeks ago

Thank you for digging into this. There must be something missing in the hotfix.

Confirmed in the change log. The fix in 3.3.1 in for loading configs from native libs. The android on is not in the package yet. They will be included in the next release.

jollypunch commented 2 weeks ago

Yeah I had to embed the package and manually add the code change, after that the issue is fixed.