Andorid Package failed because of wrong lib path

when i try to package android i get error like this:

UATHelper: Packaging (Android (ASTC)): ld.lld: error: cannot open G:/repo/TUE/Engine/Source/ThirdParty/MSOC/lib: Is a directory
UATHelper: Packaging (Android (ASTC)): clang++: error: linker command failed with exit code 1 (use -v to see invocation)
PackagingResults: Error: cannot open G:/repo/TUE/Engine/Source/ThirdParty/MSOC/lib: Is a directory
PackagingResults: Error: linker command failed with exit code 1 (use -v to see invocation)

photo show my build.cs file

if i add some random string to path like
PublicAdditionalLibraries.Add(SoftWareOcclusionPath+ “lib/”+ libname+"/aaaaa");
it will success

seems that unreal will delete last string when link lib

I have encountered the same problem as you, but there will be other issues when I add “/aaaaa” at the end of the path

Did anyone ever solve this? Having the same issue.

I had the same issue. The problem was with the library, not because of Unreal build system.
In my case mylibrary.a was compiled to Arm64 on Mac and somehow it didn’t work. When I configured Windows machine to compile mylibrary.a, then everything worked as expected.

The solution mentioned above with adding anything to path won’t work, you will get errors if you actually use anything from the library. Otherwise you don’t get errors, because the library is not even included in the build.