Unity freezes while building APK

I have Unity Pro with an Android license. Everything works fine until I build it. It asks me to select my Android SDK folder, which I do. It then freezes, and I have to force shut down Unity and restart it, and the APK doesn’t finish building.

I’ve tried several different configurations in the Player Settings, and the freeze always happens regardless. Thanks in advance for any help,

Cheers!

Update: Problem solved.

I just rolled back from 2.3 to 2.2 in the SDK. It is labeled as “android-8” in the Android SDK directory.

Hello, how do I roll back from 2.3 to 2.2 in SDK , thanks.

No need to roll back, just add the platform-tools (or where ever your adb.exe is) into your path.

so you’re saying that Unity 3.2 crashes if you’re trying to build with SDK 2.3?

Unity 3.2 (Windows) hangs when adb is not in the path. The Cancel button on the build dialog will not respond. I filed a bug report yesterday.

1 Like

This still happens for me with Unity 3.3 and even adb.exe in the PATH. Is there any other workaround?

Edit: After reinstalling java and the Android SDK everything works now.

same problem with latest 3.3 - detecting android sdk freeze

I had the same problem, now works fine after removed SDK Platform Android 1.x to 2.0 installed packages from the Android SDK and AVD Manager.

This worked for me. Thanks!

I had the same problem. For me, I found out that java.exe was blocking unity from getting past the step where it tries to locate the android sdk location. When it freezes at this point, I go into the task manager and kill ‘java.exe’. At this point the build finishes successfully.

This worked for me too. Thanks a ton for posting that!

This is likely caused by the fact that Google changed the location of adb.exe relative to the SDK folder in versions 2.3+.

I ran into this problem also. Forcing ‘java.exe’ to close works, but adding tool/ and platform-tools/ to my PATH didn’t work. I don’t like always having to force close java.exe…

What packages do I need to uninstall for ‘removed SDK Platform Android 1.x to 2.0 installed packages’? Would it be the SDK Platform Android 1.5 API 3, and 1.6 API 4? I don’t have any that are just 2.0.

Or has another work-around been found?

These are the packages I have installed:

Hello RogueLover2000,

try to remove :
SDK Andoid 1.6
SDK Andoid 1.5

Removing 1.5 and 1.6 worked perfectly for me, thanks.

Also had issue, killing java.exe also worked for me, deleted 1.5 and 1.6 and that did not seem to do the trick though

This STARTED when I updated to include android 3.1

PLEASE FIX UNITY! I build to android ALOT!

I’m experiencing this as well, among other seemingly common apk building issues. I’m using Windows 7 x64, Unity 3.3.0f3. Followed all

My build hangs on “Detecting Android SDK”.
The only SDK platforms I have are 2.2 and 2.3.3.
There are two “java.exe” processes running in the task manager.

This is highly irritating, and I’m not looking forward to uninstalling JDK x64 just to d/l and install JDK x32. Seems like this is something that might be worth mentioning in the “getting started” section.

edit
After trying the patient route, I received a “register class failed” message on screen. The build window stays frozen, however.

I just started getting this problem on my mac. I’ve been pushing builds to my Android device all day but now it keeps on hanging when pushing to the device. If I disconnect the device Unity starts working again but says no device connected.

Also getting it iwith Unity 5.3.3p3, Android Studio141 and JDK 8u77.