firebase / firebase/quickstart-unity

Unity 6 Android build fails converting Firebase local Maven repository URI

Open
#1,448 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
923
Forks
456
PR merge metrics
No merged PRs in 30d

Description

# Unity 6 Android build fails with `Cannot convert URI ... Firebase/m2repository to a file`

## Environment

* **Unity:** 6000.3.23f1
* **Platform:** Android
* **Build:** Release / AAB
* **Gradle:** 9.1.0
* **Java:** Unity bundled OpenJDK
* **Firebase:** Firebase Unity SDK
* **Plugins:** Firebase App + Firebase Crashlytics
* **Google Mobile Ads:** Installed
* **OS:** Windows

## Problem

The Android release build fails during the Gradle build at:

```text
:launcher:processReleaseNavigationResources
```

The exact error is:

```text
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:processReleaseNavigationResources'.
> Cannot convert URI 'file:///E:/9. Queen Fashion Battle/Queen-Fashion-Battle/Assets/GeneratedLocalRepo/Firebase/m2repository' to a file.
```

The problematic path is the Firebase local Maven repository generated inside the Unity project:

```text
Assets/GeneratedLocalRepo/Firebase/m2repository
```

## Relevant Gradle output

```text
> Configure project :unityLibrary:FirebaseApp.androidlib

> Configure project :unityLibrary:FirebaseCrashlytics.androidlib

> Task :unityLibrary:FirebaseApp.androidlib:processReleaseNavigationResources

> Task :unityLibrary:FirebaseCrashlytics.androidlib:processReleaseNavigationResources

> Task :launcher:processReleaseNavigationResources FAILED
```

Followed by:

```text
Cannot convert URI
'file:///E:/9. Queen Fashion Battle/Queen-Fashion-Battle/Assets/GeneratedLocalRepo/Firebase/m2repository'
to a file.
```

## Additional warnings

There are also these warnings, although they do not appear to be the immediate cause of the build failure:

```text
WARNING: minSdkVersion (25) is greater than targetSdkVersion (9)
for variant "debug".

WARNING: minSdkVersion (25) is greater than targetSdkVersion (9)
for variant "release".
```

These warnings are reported for:

```text
FirebaseApp.androidlib
FirebaseCrashlytics.androidlib
```

There are also SDK permission warnings:

```text
Exception while marshalling ... package.xml.
Probably the SDK is read-only
```

However, Gradle continues past these warnings and fails specifically when processing the Firebase local Maven repository URI.

## What I have tried

* Rebuilding the project
* Regenerating Unity's Android build files
* Force resolving Android dependencies
* Cleaning Unity's generated build/cache directories
* Verifying that the Firebase local Maven repository exists at:

```text
Assets/GeneratedLocalRepo/Firebase/m2repository
```

The issue still occurs.

## Expected behavior

Firebase's generated local Maven repository should be correctly recognized by the Gradle build, and the Unity Android release build should proceed normally.

## Actual behavior

Gradle 9.1 fails to convert the generated Firebase `file://` repository URI into a file:

```text
Cannot convert URI 'file:///.../Assets/GeneratedLocalRepo/Firebase/m2repository' to a file.
```

## Question

Is this a compatibility issue between the Firebase Unity SDK's generated local Maven repository configuration and the newer Gradle/Android Gradle Plugin versions used by Unity 6000.3.23f1?

If so, is there a recommended fix or an updated version of the Firebase Unity SDK / External Dependency Manager that resolves this?

I can provide the complete Gradle project, `mainTemplate.gradle`, dependency resolver logs, or the generated `Assets/GeneratedLocalRepo/Firebase` contents if needed.

Contributor guide

Open the contributing guide

Research direction

Start by inspecting mainTemplate.gradle and the generated Assets/GeneratedLocalRepo/Firebase/m2repository path, then reproduce :launcher:processReleaseNavigationResources with the listed Unity and Gradle versions. Done means the Firebase repository URI is accepted and the Android release AAB completes without the URI conversion failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, unity
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.