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:
:launcher:processReleaseNavigationResources
The exact error is:
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:
Assets/GeneratedLocalRepo/Firebase/m2repository
Relevant Gradle output
> 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:
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:
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:
FirebaseApp.androidlib
FirebaseCrashlytics.androidlib
There are also SDK permission warnings:
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:
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:
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.
Unity 6 Android build fails with
Cannot convert URI ... Firebase/m2repository to a fileEnvironment
Problem
The Android release build fails during the Gradle build at:
The exact error is:
The problematic path is the Firebase local Maven repository generated inside the Unity project:
Relevant Gradle output
Followed by:
Additional warnings
There are also these warnings, although they do not appear to be the immediate cause of the build failure:
These warnings are reported for:
There are also SDK permission warnings:
However, Gradle continues past these warnings and fails specifically when processing the Firebase local Maven repository URI.
What I have tried
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: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 generatedAssets/GeneratedLocalRepo/Firebasecontents if needed.