- Unity Gamedev
- How to fix Android Gradle Build failed error in unity
- 2020.2 2f1 not building for Android #944
- Comments
- SummerLynx commented Jan 30, 2021 •
- [REQUIRED] Please fill in the following fields:
- [REQUIRED] Please describe the issue here:
- Unity android build support install failed validation failed
- Comments (10)
Unity Gamedev
learn game development
How to fix Android Gradle Build failed error in unity
- Get link
- Other Apps
There is a simple way to resolve this error if you are using older version than unity 2019
Just go to build setting setting and change Build system from gradle to internal. it will resolve your error.
But it is ok for just testing your game if you are building for google play store then should build your game with gradle build.
To build with gradle you should follow some step
1. go to build setting -> player setting -> publishing setting
In publishing setting you should setup your keystore here you can create a new key or use existing key.
2. Sometimes gradle build failed also occur because of minimum API level so go in build setting -> player setting -> other setiing
in other setting you will find minimum API level try to change this API level to Android 4.4 or 5.0
if you are using newer version of unity and API level is not present in other setting than leave it.
3. third and main reason of gradle build failed is gradle is not installed correctly so just go to file explorer and click on window drive
click local user name (this is whatever is your name in computer)
here you will find «.gradle» folder.
delete this folder and now now build your project and make sure your pc is connected to internet because unity will download the correct gradle version according to unity version so don’t need to worry about anything just remember you arfe connected to network.
After following these step you can build your gradle project.
Источник
2020.2 2f1 not building for Android #944
Comments
SummerLynx commented Jan 30, 2021 •
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2020.2 1f1, 2020.2 2f1
- Firebase Unity SDK version: 7.0.2_
- Source you installed the SDK: .unitypackage
- Problematic Firebase Component: Analytics
- Other Firebase Components in use: Auth, Firestore, Storage
- Additional SDKs you are using: None
- Platform you are using the Unity editor on: Windows
- Platform you are targeting: Android
- Scripting Runtime: IL2CPP
[REQUIRED] Please describe the issue here:
Can not build for Android. When you install Firebase, your JDK link breaks. You are getting a JAVA_HOME error on build). If you try to fix that with:
untoggle everying Android SDK, JDK and NDK related it in preferences, restart Unity, toggle It back
you get a message: do you want to activate Jetpack? AndroidX Jetttison needs target api to be 28 and forces the «Target Api level»
to 28, which is not installed by default by Unity Hub, because they use 29. so you can’t build with that. If you switch target back to (highest), it almost builds, but on «Building Gradle project» you get an error, described in issue #377.
If you try to reimport firebase sdk, you get the cycle of «JDK» link breaking.
I managed to make it build once somehow, but the app crached on firebase app initialization
Note: C:\Work\MatterFlowCommunity\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:launcher:mergeReleaseNativeLibs’.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
More than one file was found with OS independent path ‘lib/armeabi-v7a/libFirebaseCppAnalytics.so’
Try:
Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output. Run with —scan to get full insights.
BUILD FAILED in 25s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use —status for details
Configure project :launcher
WARNING: The option ‘android.enableR8’ is deprecated and should not be used anymore.
It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:preBuild UP-TO-DATE
Task :unityLibrary:FirebaseApp.androidlib:preBuild UP-TO-DATE
Task :launcher:preReleaseBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :unityLibrary:FirebaseApp.androidlib:preReleaseBuild UP-TO-DATE
Task :unityLibrary:FirebaseApp.androidlib:compileReleaseAidl NO-SOURCE
Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:FirebaseApp.androidlib:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :unityLibrary:FirebaseApp.androidlib:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResValues
Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResources
Task :unityLibrary:generateReleaseBuildConfig
Task :launcher:generateReleaseBuildConfig
Task :launcher:compileReleaseAidl NO-SOURCE
Task :unityLibrary:generateReleaseResValues
Task :launcher:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseResources
Task :launcher:mainApkListPersistenceRelease
Task :launcher:generateReleaseResValues
Task :launcher:generateReleaseResources
Task :launcher:createReleaseCompatibleScreenManifests
Task :launcher:extractDeepLinksRelease
Task :launcher:prepareLintJar
Task :unityLibrary:FirebaseApp.androidlib:packageReleaseResources
Task :unityLibrary:packageReleaseResources
Task :unityLibrary:extractDeepLinksRelease
Task :unityLibrary:FirebaseApp.androidlib:generateReleaseBuildConfig
Task :unityLibrary:FirebaseApp.androidlib:extractDeepLinksRelease
Task :unityLibrary:compileReleaseLibraryResources
Task :unityLibrary:FirebaseApp.androidlib:compileReleaseLibraryResources
Task :unityLibrary:prepareLintJarForPublish
Task :unityLibrary:FirebaseApp.androidlib:javaPreCompileRelease
Task :unityLibrary:FirebaseApp.androidlib:prepareLintJarForPublish
Task :unityLibrary:parseReleaseLocalResources
Task :unityLibrary:FirebaseApp.androidlib:parseReleaseLocalResources
Task :unityLibrary:FirebaseApp.androidlib:mergeReleaseShaders
Task :unityLibrary:mergeReleaseShaders
Task :unityLibrary:compileReleaseShaders
Task :unityLibrary:FirebaseApp.androidlib:compileReleaseShaders
Task :unityLibrary:generateReleaseAssets
Task :unityLibrary:FirebaseApp.androidlib:generateReleaseAssets
Task :unityLibrary:FirebaseApp.androidlib:packageReleaseAssets
Task :unityLibrary:FirebaseApp.androidlib:processReleaseManifest
Task :launcher:checkReleaseDuplicateClasses
Task :unityLibrary:FirebaseApp.androidlib:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:FirebaseApp.androidlib:bundleLibResRelease
Task :unityLibrary:FirebaseApp.androidlib:mergeReleaseJniLibFolders
Task :unityLibrary:packageReleaseAssets
Task :unityLibrary:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:FirebaseApp.androidlib:generateReleaseRFile
Task :unityLibrary:mergeReleaseJniLibFolders
Task :unityLibrary:processReleaseManifest
Task :unityLibrary:bundleLibResRelease
Task :unityLibrary:mergeReleaseNativeLibs
Task :launcher:processReleaseManifest
C:\Work\MatterFlowCommunity\Temp\gradleOut\launcher\src\main\AndroidManifest.xml:27:9-34:50 Warning:
activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was tagged at AndroidManifest.xml:27 to replace other declarations but no other declaration present
Task :unityLibrary:stripReleaseDebugSymbols
Task :launcher:mergeReleaseShaders
Task :launcher:compileReleaseShaders
Task :launcher:generateReleaseAssets
Task :unityLibrary:FirebaseApp.androidlib:compileReleaseJavaWithJavac
Task :unityLibrary:FirebaseApp.androidlib:bundleLibCompileRelease
Task :unityLibrary:FirebaseApp.androidlib:mergeReleaseNativeLibs
Task :unityLibrary:FirebaseApp.androidlib:stripReleaseDebugSymbols
Task :unityLibrary:FirebaseApp.androidlib:copyReleaseJniLibsProjectOnly
Task :unityLibrary:FirebaseApp.androidlib:bundleLibRuntimeRelease
Task :launcher:mergeReleaseAssets
Task :launcher:processReleaseJavaRes NO-SOURCE
Task :launcher:mergeReleaseJniLibFolders
Task :launcher:validateSigningRelease
Task :unityLibrary:copyReleaseJniLibsProjectOnly
Task :unityLibrary:javaPreCompileRelease
Task :unityLibrary:generateReleaseRFile
Task :launcher:mergeReleaseResources
Task :launcher:processReleaseResources
Task :unityLibrary:bundleLibCompileRelease
Task :unityLibrary:bundleLibRuntimeRelease
Task :launcher:mergeReleaseJavaResource
Task :launcher:desugarReleaseFileDependencies
Task :launcher:javaPreCompileRelease
Task :launcher:compileReleaseJavaWithJavac
Task :launcher:compileReleaseSources
Task :launcher:dexBuilderRelease
Task :launcher:mergeReleaseNativeLibs FAILED
Task :launcher:lintVitalRelease
Task :launcher:mergeExtDexRelease
65 actionable tasks: 65 executed
Источник
Unity android build support install failed validation failed
1. Open Unity Hub and go to the Installs tab
2. Click ADD and select any Unity version available there
3. Click NEXT and then DONE
4. Disconnect from the internet while the Editor is still downloading
5. Download and install the same Unity Editor versions as in step 2 from the Unity download archive
6. In the Installs tab click ADD and locate the Editor installed in step 5
Expected results: the Editor is added to the list of Unity installations
Actual results: Installation failed message is displayed and attempting to remove the Editor results in «Could not Delete Files» error
Reproducible with: 2.4.0
Not reproducible with: 2.3.2
Notes:
-An already existing installation can be used in the 5th step to reproduce the issue
-Restarting Unity Hub doesn’t fix the issue and the «failed» installations remain. To fix the issue, deleting the Hub cache seems to be required
-Editors.json file points to the correct Editor location after reproducing the bug
-After reproducing the issue a «no folder path defined for
Workaround (the file name changes depending on the version that’s stuck in the «failed» state):
Windows: delete the «C:\Users\USERNAME\AppData\Roaming\UnityHub\downloadProgress%3A2018.4.27f1.json» file
Mac: delete the «
/Library/Application Support/UnityHub/downloadProgress%3A2018.4.27f1.json» file
Linux: delete the «
Fixed in Unity Hub 2.4.1
Comments (10)
May 16, 2021 01:22
May 03, 2021 13:57
Mar 14, 2021 22:39
I have Unity on my Chromebook. I downloaded it using terminal. My Chromebook has a like about 13.1GB of storage. I’m trying to add an old version of Unity editor with Android build support and i get the message installation failed/there is not enough storage to download the selected items. So I’m having the same issue.
Jan 24, 2021 07:24
FIX :After the install fails from unity hub go to C:\Users\USERNAME\AppData\Local\Temp\ and run the installer from there directly .This is the only thing that worked for me .
Jan 11, 2021 03:17
Sep 18, 2020 07:43
Same painful issue here (with Unity Hub 2.4.0)
Sep 15, 2020 16:58
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Sep 15, 2020 16:58
1. Open Unity Hub and go to the Installs tab
2. Click ADD and select any Unity version available there
3. Click NEXT and then DONE
4. Disconnect from the internet while the Editor is still downloading
5. Download and install the same Unity Editor versions as in step 2 from the Unity download archive
6. In the Installs tab click ADD and locate the Editor installed in step 5
Expected results: the Editor is added to the list of Unity installations
Actual results: Installation failed message is displayed and attempting to remove the Editor results in «Could not Delete Files» error
Reproducible with: 2.4.0
Not reproducible with: 2.3.2
Notes:
-An already existing installation can be used in the 5th step to reproduce the issue
-Restarting Unity Hub doesn’t fix the issue and the «failed» installations remain. To fix the issue, deleting the Hub cache seems to be required
-Editors.json file points to the correct Editor location after reproducing the bug
-After reproducing the issue a «no folder path defined for
Workaround (the file name changes depending on the version that’s stuck in the «failed» state):
Windows: delete the «C:\Users\USERNAME\AppData\Roaming\UnityHub\downloadProgress%3A2018.4.27f1.json» file
Mac: delete the «
/Library/Application Support/UnityHub/downloadProgress%3A2018.4.27f1.json» file
Linux: delete the «
Sep 15, 2020 16:56
Workaround (the file name changes depending on the version that’s stuck in the «failed» state):
Windows: delete the «C:\Users\USERNAME\AppData\Roaming\UnityHub\downloadProgress%3A2018.4.27f1.json» file
Mac: delete the «
/Library/Application Support/UnityHub/downloadProgress%3A2018.4.27f1.json» file
Linux: delete the «
Sep 15, 2020 16:55
How can we assist you today?
Learn more about Analytics here. Please feel free to also submit requests and feedback on the Unity Analytics forum and make sure to check out our FAQ.
Источник