LLMUnity icon indicating copy to clipboard operation
LLMUnity copied to clipboard

[Android build] IOException: The file exists

Open siduko opened this issue 1 year ago • 1 comments

Describe the bug

When I build the demo android sample, It's successfully at first time, but I rebuild, it will show the error

image

Steps to reproduce

  1. Build to apk, and installed
  2. Rebuild but it can not because the error

LLMUnity version

2.2.4

Operating System

Windows

siduko avatar Oct 06 '24 05:10 siduko

Hi! This could be due to an interrupted build. Could you try again after deleting this folder? C:\Users\[USER]\AppData\Local\Temp\[COMPANY]\[PROJECT]\LLMUnityBuild The company name will be "DefaultCompany" if you haven't specified it in Unity

amakropoulos avatar Oct 07 '24 09:10 amakropoulos

The above solution should resolve the issue, let me know if you still face it

amakropoulos avatar Oct 18 '24 17:10 amakropoulos

Same happen to me on unity 6000.0.24f1. Need to restart my computer to build (and not clic on play button before). I got the error even if i restart unity, directly whene scene open in editor.

IOException: Le fichier existe System.IO.FileSystem.MoveFile (System.String sourceFullPath, System.String destFullPath) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) System.IO.File.Move (System.String sourceFileName, System.String destFileName) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) LLMUnity.LLMBuilder.HandleActionFileRecursive (System.String source, System.String target, LLMUnity.ActionCallback actionCallback) (at Assets/LLMUnity/Runtime/LLMBuilder.cs:37) LLMUnity.LLMBuilder.HandleActionFileRecursive (System.String source, System.String target, LLMUnity.ActionCallback actionCallback) (at Assets/LLMUnity/Runtime/LLMBuilder.cs:47) LLMUnity.LLMBuilder.MovePath (System.String source, System.String target) (at Assets/LLMUnity/Runtime/LLMBuilder.cs:79) LLMUnity.LLMBuilder.MoveAction (System.String source, System.String target, System.Boolean addEntry) (at Assets/LLMUnity/Runtime/LLMBuilder.cs:118) LLMUnity.LLMBuilder.Reset () (at Assets/LLMUnity/Runtime/LLMBuilder.cs:204) LLMUnity.LLMBuildProcessor.<BuildCompleted>b__5_0 () (at Assets/LLMUnity/Editor/LLMBuildProcessor.cs:58) UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at <5d5fdc1eeb2a4f39b26caadc7b79ec7e>:0)

ate864 avatar Nov 14 '24 17:11 ate864

Hi! This could be due to an interrupted build. Could you try again after deleting this folder? C:\Users\[USER]\AppData\Local\Temp\[COMPANY]\[PROJECT]\LLMUnityBuild The company name will be "DefaultCompany" if you haven't specified it in Unity

if i delete this folder, i have this new error :

UnauthorizedAccessException: Access to the path 'undreamai_windows-avx2.dll' is denied. System.IO.FileSystem.RemoveDirectoryRecursive (System.String fullPath, Interop+Kernel32+WIN32_FIND_DATA& findData, System.Boolean topLevel) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) System.IO.FileSystem.RemoveDirectory (System.String fullPath, System.Boolean recursive) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) System.IO.Directory.Delete (System.String path, System.Boolean recursive) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) LLMUnity.LLMBuilder.DeletePath (System.String path) (at Assets/LLMUnity/Runtime/LLMBuilder.cs:95) LLMUnity.LLMBuilder.MovePath (System.String source, System.String target) (at Assets/LLMUnity/Runtime/LLMBuilder.cs:80) LLMUnity.LLMBuilder.MoveAction (System.String source, System.String target, System.Boolean addEntry) (at Assets/LLMUnity/Runtime/LLMBuilder.cs:118) LLMUnity.LLMBuilder.HideLibraryPlatforms (System.String platform) (at Assets/LLMUnity/Runtime/LLMBuilder.cs:165) LLMUnity.LLMBuilder.Build (System.String platform) (at Assets/LLMUnity/Runtime/LLMBuilder.cs:187) LLMUnity.LLMBuildProcessor.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Assets/LLMUnity/Editor/LLMBuildProcessor.cs:36) UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass16_0.<OnBuildPreProcess>b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at <5d5fdc1eeb2a4f39b26caadc7b79ec7e>:0) UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List1[T] oneInterfaces, System.Action1[T] invocationOne, System.Collections.Generic.List1[T] twoInterfaces, System.Action1[T] invocationTwo, System.Boolean exitOnFailure) (at <5d5fdc1eeb2a4f39b26caadc7b79ec7e>:0) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

ate864 avatar Nov 15 '24 09:11 ate864

can you also delete the Assets/StreamingAssets/undream* folder, restart Unity and wait for it to be downloaded again?

amakropoulos avatar Nov 15 '24 09:11 amakropoulos

ok i deleted temp folder and streamingAssets content folder, restart unity , it start downloading zip file in temp folder, extract it in streamingassets folder, remove the zip file from temp folder, "Download Complete" i click play mode (android demo scene) > all is ok no error. Build on android > UnauthorizedAccessException: Access to the path 'undreamai_windows-avx2.dll' is denied. the temp folder get all the platforms but the streaminasset folder can't be totaly empty, it stay some platforms with windows-avx2. The LLMBuilder.cs script can't remove the undreamai_windows-avx2.dll , need to stop it before .

looklike https://github.com/undreamai/LLMUnity/issues/250

also, in the temp folder stay the windows-avx2 folder, so error "file exist" appear.

ate864 avatar Nov 15 '24 09:11 ate864

Maybe ? https://www.forrestthewoods.com/blog/debugging-a-dynamic-library-that-wouldnt-unload/

ate864 avatar Nov 15 '24 10:11 ate864

Thank you! I free the library here. It needs some investigation..

amakropoulos avatar Nov 15 '24 11:11 amakropoulos

yes :) , that why i think about looking inside the dll.... thank you to look at it !

ate864 avatar Nov 15 '24 11:11 ate864