Unable to build for android "Could not find androidx.tonyodev.fetch2"

I’ve set up my environment as described by unreal in their posts, and I’m matching the description for 5.3 found here (Android Development Requirements for Unreal Engine | Unreal Engine 5.3 Documentation)

When I build, I get the following error:

Execution failed for task ':app:compileDebugAidl'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
   > Could not find androidx.tonyodev.fetch2:xfetch2:3.1.6.
     Required by:
         project :app

Hence I googled why this is an error and wanted to try the solution from this stack overflow post:

But, it seems the two files where this is set are:

./Intermediate/Android/arm64/gradle/AFSProject/app/buildAdditions.gradle:39:            implementation "androidx.tonyodev.fetch2:xfetch2:3.1.6" 
./Intermediate/Android/arm64/gradle/app/buildAdditions.gradle:39:               implementation "androidx.tonyodev.fetch2:xfetch2:3.1.6"

Hence those files get overridden when I’m executing the build command.

Does someone know where I can change that, or what I’m doing wrong in the first place since I’ve followed the steps by unreal?

Hey try to delete temp files (saved, build, intermediate) select Android NDK 25.18937393 and in 5.3 instead of using old JDK or JRE use JBR. Like on video tutorial:

coz from log seems something with Gradle (old jdk)

I have deleted all temporary files multiple times.
I can build the default top-down project without any issues.
It’s just this project and I don’t know why.
I have an identical setup to the video you linked.

I’m productive again since I was able to create a new project and copy the content over.
But I would still like to know what caused the error in the first place.

Hmm yeah good idea to migrate not all, but for a parts and check when it’s happen that could help to intercept the issue. I thought also that can be a plugin…

In my case the solution was just to turn off the following plugin:

2 Likes

Deactivating this plugin worked perfectly for me. Thanks! UE5.3

Change your AndroidFetchBackgroundDownload_UPL.xml file so that it looks like:

//AndroidFetchBackgroundDownload -- START
	repositories {
		mavenCentral()
		maven { url 'https://jitpack.io' }
	}
	dependencies {
		//Fetch2 library used to manage downloads at java level
		implementation "com.github.tonyofrancis:fetch:3.1.6"
		
		//Used for parsing from JSON files in DownloadDescription.java
		//excluding hamcrest to avoid collision with junit that also includes hamcrest
		implementation ('com.googlecode.json-simple:json-simple:1.1.1') {
			exclude group: 'org.hamcrest', module: 'hamcrest-core'
		}
	}
//AndroidFetchBackgroundDownload -- STOP

As jcenter no longer hosts these files. I’ve updated the engine to account for this and should be getting to github shortly.

1 Like


I did exactly what you did there and still gives me this error? Any ideas?

UPDATE: Alright i managed to correct this mistake but… another one now keeps ocourring…


Any idea of what it could be?