4

I'm building a Unity project for Android on a Windows VM and, when I run Azure DevOps pipelines, I get the following error message:

* What went wrong:
Execution failed for task ':unityLibrary:BuildIl2CppTask'.
> Warning: Could not find file [Path here]\jniLibs\arm64-v8a\libil2cpp.dbg.so to copy.

It happens when I run a task:

  - bash: |
      chmod +x '$(System.ArtifactsDirectory)\...path...\il2CppOutputProject\IL2CPP\build\deploy\netcoreapp3.1'
      chmod +x gradlew
      ./gradlew assembleRelease --stacktrace --info
      ./gradlew generateAPIDoc

At first, it seemed to me that /libil2cpp.dbg.so won't be found as it is moved to /libil2cpp.so. On the VM, in unityLibrary/build.gradle, the following piece of code is present (it is not a part of code on repo):

def BuildIl2Cpp(String workingDir, String configuration, String architecture, String abi, String[] staticLibraries) {
    def commandLineArgs = []
    commandLineArgs.add("--compile-cpp")
    commandLineArgs.add("--platform=Android")
    commandLineArgs.add("--architecture=" + architecture)
    commandLineArgs.add("--outputpath=" + workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.so")
    commandLineArgs.add("--libil2cpp-static")
    commandLineArgs.add("--baselib-directory=" + workingDir + "/src/main/jniStaticLibs/" + abi)
    commandLineArgs.add("--configuration=" + configuration)
    commandLineArgs.add("--dotnetprofile=unityaot-linux")
    commandLineArgs.add("--profiler-report")
    commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "_" + configuration + "/il2cpp_conv.traceevents")
    commandLineArgs.add("--print-command-line")
    commandLineArgs.add("--generatedcppdir=" + workingDir + "/src/main/Il2CppOutputProject/Source/il2cppOutput")
    commandLineArgs.add("--cachedirectory=" + workingDir + "/build/il2cpp_"+ abi + "_" + configuration + "/il2cpp_cache")
    commandLineArgs.add("--tool-chain-path=" + android.ndkDirectory)
    staticLibraries.eachWithIndex {fileName, i->
        commandLineArgs.add("--additional-libraries=" + workingDir + "/src/main/jniStaticLibs/" + abi + "/" + fileName)
    }
    def executableExtension = ""
    if (org.gradle.internal.os.OperatingSystem.current().isWindows())
        executableExtension = ".exe"
    exec {
        executable workingDir + "/src/main/Il2CppOutputProject/IL2CPP/build/deploy/il2cpp" + executableExtension
        args commandLineArgs
        environment "ANDROID_SDK_ROOT", getSdkDir()
    }
    delete workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.sym.so"
    ant.move(file: workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.dbg.so", tofile: workingDir + "/symbols/" + abi + "/libil2cpp.so")
}

However, I also see that the pipeline cannot find a directory /src/main/Il2CppOutputProject/IL2CPP/build/deploy/il2cpp and it's true - the directory does not exist in unityLibrary.

I wonder what I can do to create the directory that is not found, or at least stop the task from looking for the file, or look for /libil2cpp.so. <- I want to achieve at least one of the milestones of the issue.

I build the project with the following versions:

  • Android Studio Arctic Fox: 2020.3.1
  • Unity version: 2021.3.14f1
  • Gradle version: 7.4

Pre-error messages printed in Azure DevOps:

> Transform artifact localbroadcastmanager-1.0.0.aar (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0) with AarTransform
Transforming artifact localbroadcastmanager-1.0.0.aar (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0) with AarTransform
Caching disabled for AarTransform: C:\Users\___\.gradle\caches\transforms-2\...\localbroadcastmanager-1.0.0 because:
  Build cache is disabled
Skipping AarTransform: C:\Users\___\.gradle\caches\...\localbroadcastmanager-1.0.0 as it is up-to-date.
AarTransform (Thread[Execution worker for ':' Thread 2,5,main]) completed. Took 0.007 secs.

> Task :unityLibrary:BuildIl2CppTask
Task :unityLibrary:BuildIl2CppTask in launcher Starting
Task :unityLibrary:BuildIl2CppTask in unityLibrary Starting
Caching disabled for task ':unityLibrary:BuildIl2CppTask' because:
  Build cache is disabled
Task ':unityLibrary:BuildIl2CppTask' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
android.ndkVersion from module build.gradle is not set
ndk.dir in local.properties is C:/Program Files/Unity/Hub/Editor/2021.3.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK
ANDROID_NDK_HOME environment variable is not set
sdkFolder is C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK
NDK side-by-side folder from sdkFolder C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\ndk does not exist
Considering C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK by ndk.dir
Considering C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\ndk-bundle in SDK ndk-bundle folder
Rejected C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\ndk-bundle in SDK ndk-bundle folder because that location has no source.properties
Found requested ndk.dir (C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK) which has version 21.3.6528147
Starting process 'command 'C:/agent/.../unityLibrary/src/main/Il2CppOutputProject/IL2CPP/build/deploy/il2cpp.exe''. Working directory: C:\agent\_work\7\a\unityLibrary Command: C:/agent/.../unityLibrary/src/main/Il2CppOutputProject/IL2CPP/build/deploy/il2cpp.exe --compile-cpp --platform=Android --architecture=arm64 --outputpath=C:/agent/.../unityLibrary/src/main/jniLibs/arm64-v8a/libil2cpp.so --libil2cpp-static --baselib-directory=C:/agent/.../unityLibrary/src/main/jniStaticLibs/arm64-v8a --configuration=Release --dotnetprofile=unityaot-linux --profiler-report --profiler-output-file=C:/agent/.../unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_conv.traceevents --print-command-line --generatedcppdir=C:/agent/.../unityLibrary/src/main/Il2CppOutputProject/Source/il2cppOutput --cachedirectory=C:/agent/.../unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_cache --tool-chain-path=C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
Successfully started process 'command 'C:/agent/..../unityLibrary/src/main/Il2CppOutputProject/IL2CPP/build/deploy/il2cpp.exe''
C:\agent\...\unityLibrary\src\main\Il2CppOutputProject\IL2CPP\build\deploy\il2cpp.exe --compile-cpp --platform=Android --architecture=arm64 --outputpath=C:/agent/.../unityLibrary/src/main/jniLibs/arm64-v8a/libil2cpp.so --libil2cpp-static --baselib-directory=C:/agent/.../unityLibrary/src/main/jniStaticLibs/arm64-v8a --configuration=Release --dotnetprofile=unityaot-linux --profiler-report --profiler-output-file=C:/agent/.../unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_conv.traceevents --print-command-line --generatedcppdir=C:/agent/.../unityLibrary/src/main/Il2CppOutputProject/Source/il2cppOutput --cachedirectory=C:/agent/.../unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_cache --tool-chain-path=C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
Starting: C:\agent\...\unityLibrary\src\main\Il2CppOutputProject\IL2CPP\build\deploy\bee_backend\win-x64\bee_backend.exe --profile="C:/agent/.../unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_cache/buildstate/backend_profiler0.traceevents" --stdin-canary --dagfile="C:/agent/.../unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_cache/buildstate/bee.dag" --continue-on-failure FinalProgram
WorkingDir: C:/agent/.../unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_cache/buildstate
ExitCode: 0 Duration: 33s
Build succeeded with 0 successful nodes and 0 failed ones

Task :unityLibrary:BuildIl2CppTask in launcher Finished
Task :unityLibrary:BuildIl2CppTask in unityLibrary Finished
3
  • Same issue here. Did you solve? Commented Jun 28, 2023 at 10:23
  • Hi, I've bypassed it but did not manage to solve the issue so it would be no help. I kept the question as I hope someone is able to provide the answer for those who still look for a solution. Commented Jun 28, 2023 at 10:45
  • 1
    Finally I got rid of the error by making a "Clean Project" and "Rebuild Project" and the file libil2cpp.dbg.so gets generated again. I suppose some cache issues. Commented Jun 30, 2023 at 6:43

1 Answer 1

3

I got rid of the error by making a "Clean Project" and "Rebuild Project" and the file libil2cpp.dbg.so gets generated again. I suppose there were some cache issues

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.