How to Fix FileNotFoundException in Unity | Step-by-Step Guide

 Fix:

 FileNotFoundException: Temp\gradleOut\launcher\build\outputs\bundle\release\launcher.aab does not exist

Outline:

1. Introduction: Explanation of the error and its causes

2. Quick Solution

3. How to fix FileNotFoundException in Unity: Step-by-step guide

4. Conclusion


Notes:

This blog post aims to provide a step-by-step guide to fix the FileNotFoundException error that can occur in Unity when trying to build a project. The error message indicates that the launcher.aab file is missing, which can prevent the project from being built. The guide should be easy to follow and include clear instructions for each step, making it accessible to Unity users with varying experience levels.



1. Introduction:

The FileNotFoundException error is a common problem in Unity that occurs when trying to build a project. This error message indicates that the Temp\gradleOut\launcher\build\outputs\bundle\release\launcher.aab file is missing, which can prevent the project from being built. There are several possible causes for this error, including incorrect settings, missing files, or a corrupted project. In this guide, we will provide step-by-step instructions on how to fix the FileNotFoundException error in Unity.

2. Quick Solution:

I've found a solution. You should do as they say here  when you check the custom gradle check box and then change the path in this file instead of " classpath 'com.android.tools.build:gradle:3.6.0' " you should write "classpath 'com.android.tools.build:gradle:3.4.3' 

3. How to fix FileNotFoundException in Unity: Step-by-step guide

I. Check the Build Settings

  • Open the Build Settings window by going to File > Build Settings.
  • Make sure that the platform you want to build for is selected.
  • Check that the scenes you want to include in the build are listed.
  • Make sure the Build System is set to Gradle.
  • Click on the "Player Settings" button to open the Player Settings window.

II. Update the Player Settings

  • In the Player Settings window, navigate to the "Other Settings" tab.
  • Change the "Scripting Backend" to "IL2CPP".
  • Change the "API Compatibility Level" to ".NET 4.x".
  • Save the changes by clicking on the "Apply" button.

III. Delete the Temp Folder

  • Close Unity and navigate to your project folder in Windows Explorer or Finder.
  • Delete the "Temp" folder located in the root of your project folder.
  • Open Unity and try building your project again.

IV. Clean the Project

  • Click on "Edit" from the menu bar and select "Preferences".
  • In the Preferences window, go to "External Tools".
  • Check "Gradle" and click "Apply".
  • Close the Preferences window and go to "Build" from the menu bar.
  • Select "Clean Project".
  • Wait for the cleaning process to complete and try building your project again.

V. Reimport the Project

  • Close Unity and navigate to your project folder in Windows Explorer or Finder.
  • Delete the "Library" folder located in the root of your project folder.
  • Open Unity and select "Assets" from the menu bar.
  • Select "Reimport All".
  • Wait for the reimport process and try building your project again.

VI. Verify the Gradle Installation

  • Open Unity and select "Assets" from the menu bar.
  • Select "External Dependency Manager" > "Android Resolver" > "Settings".
  • Under "Gradle Installations", click the "Verify" button.
  • Wait for the verification process to complete and try building your project again.

4. Conclusion

The FileNotFoundException error in Unity can be frustrating, but it can be fixed by following the steps outlined in this guide. By checking the build settings, updating player settings, deleting the temp folder, cleaning the project, reimporting the project, and verifying the Gradle installation, you can resolve the error and successfully build your project. If you continue to encounter issues, consider seeking additional support or troubleshooting from the Unity community or support team.

No comments

Powered by Blogger.