Annoying error problem when exporting Android APK file from Unity 2021.3.11f1!!!

preview_player
Показать описание
I got these annoying errors:

- Starting a Gradle Daemon, 1 incompatible Daemon could not be reused
- FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':launcher:packageRelease'.
- CommandInvokationFailure: Gradle build failed.
- Build completed with a result of 'Failed'
- UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
blablabla....

In my Unity preference settings, I'm using everything recommended by the Unity, from SDK, NDK and so on... but this is what I get.

Fortunately I can solve this problem by exporting the Unity Project as Android Studio Project. I can export APK right from Android Studio.
Рекомендации по теме
Комментарии
Автор

5 years on and Unity still can't fix this problem. I'm thinking of switching to Godot or going back to Unity 2018.

JonBaldock
Автор

The solution is to create a Keystore in Edit > Project Settings > Player > Publishing Settings.

Herman-
Автор

I have the exact same problem. Why doesn't Unity fix this? 2018 Unity with its internal build was perfect, then they got rid of it. Basically, they gave busines to Unreal.

JonBaldock
Автор

I have the same Problem with Unity 2020 & 2021. With Unity 2022 I can build an apk. Has anyone found a solution yet?

unitybuddy
Автор

I have same problem I think it is a bug by unity

DArtisian
Автор

In Android studio project open build.gradle file under project section and inside it under the packaging Options, I added this line and then i build my project, and it worked for me

jayantbarthwal
Автор

Did you find the solution because I am the same problem

cjpro
Автор

Same error followed me to Android Studio BUT
I just fixed this after weeks of work...
Let me help everyone...

My error I have been running into.
TIRAMISU seems to be a kind of dessert.
This is an andriod API Version problem?
I went to
Build Settings > Player > Other Settings
Changed Min and Max API to level 33 (Highest I could)
Edit: Make sure your phone is plugged in and Allow USB Debugging
If you need help with this google it but DON'T CLOSE THIS COMMENT
Says I need to download Required API level 33
I clicked Update Android SDK
Scary Blue Window says not to close ;) just wait a min
OK... Now I get an error that my phone is only using API 31...
I press OK... Cool...
Back into Player and change Min API to... Eh... one less than my phone... What do I know? I clean toilets for a living.
Leave Target API at 33!!!!
IT WORKED...
Took 10 min to build a blank project with a Button coded end... but... IT WORKED!

My toilet cleaning guess...
You need to always build for the Max because...
Unity made it check if you are >= Max in build process...
And if you don't build for max it doesn't even define it so unity says what THE F*CK is this?

C:\ ... error: cannot find symbol
if (Build.VERSION.SDK_INT >=
^
symbol: variable TIRAMISU
location: class VERSION_CODES
C:\ ... error: cannot find symbol
permissionGranted = ==
^
symbol: variable POST_NOTIFICATIONS
location: class permission

kenttody
join shbcf.ru