Cannot run Android apk built with Unity 3.3.0f4

I am trying to build and run a Unity Android project.

I have a Nexus One, reported Android version on phone is 2.2.2, System Update says it is up to date.

I have Unity Pro Android 3.3.0f4, running on Windows Vista x64.

When I try to build->run or run the installed app on the phone, a window says:

“Sorry! The application Synthia (process com.threeD4.Synthia) has stopped unexpectedly. Please try again.”

The logcat says:

I/ActivityManager( 2341): Start proc com.threeD4.Synthia for activity com.threeD
4.Synthia/com.unity3d.player.UnityPlayerActivity: pid=2948 uid=10047 gids={}
I/AndroidRuntime( 2941): NOTE: attach of thread 'Binder Thread #3' failed
V/Unity   ( 2948): cpuarch.GetCpuFeatures() = 55
V/Unity   ( 2948): cpuarch.GetTotalMemory() = 385
D/dalvikvm( 2948): Trying to load lib /data/data/com.threeD4.Synthia/lib/libfmod
ex.so 0x44982428
D/dalvikvm( 2948): Added shared lib /data/data/com.threeD4.Synthia/lib/libfmodex
.so 0x44982428
D/dalvikvm( 2948): No JNI_OnLoad found in /data/data/com.threeD4.Synthia/lib/lib
fmodex.so 0x44982428, skipping init
D/dalvikvm( 2948): Trying to load lib /data/data/com.threeD4.Synthia/lib/libunit
y.so 0x44982428
D/dalvikvm( 2948): Added shared lib /data/data/com.threeD4.Synthia/lib/libunity.
so 0x44982428
W/dalvikvm( 2948): JNI_OnLoad returned bad version (0) in /data/data/com.threeD4
.Synthia/lib/libunity.so 0x44982428
W/dalvikvm( 2948): Exception Ljava/lang/RuntimeException; thrown during Lcom/uni
ty3d/player/UnityPlayer;.<clinit>
D/AndroidRuntime( 2948): Shutting down VM
W/dalvikvm( 2948): threadid=1: thread exiting with uncaught exception (group=0x4
001d7f0)
E/AndroidRuntime( 2948): FATAL EXCEPTION: main

I’ve tried just about every possible setting in Player → Other Settings. Specifically, seems to me 2.2 should work, as I have that SDK installed. Not sure why the phone is only reporting 2.2.2 (as I did the 2.2.3 ‘Gingerbread’ update, and the phone says it is up to date). Any Minimum API Level results in the same error.

I’ve updated my ADB completely, then had to remove SDK versions <= 2.0 so that Unity could find the android sdk folder.

What’s going on? This was working the last time I built to Android (about a month ago, before 3.3.0f4 update).

It seems that your JNI is returning an improper version code. Why? I have no idea.

Also, I should note that 2.2.3 is NOT gingerbread. 2.2.3 was a maintenance update reeleased for the N1 shortly before the 2.3.x (I forget the last digit) update successfully granting gingerbread to the N1. If you are running 2.2.2, then you are 2 updates behind on your device.

libfmod hasn’t been a separate libray in the apk since ~3.1, I’m sure you are not running 3.3

I tried re-installing Unity, as I thought maybe having a Java app running might have prevented something. After re-install, get the same error.

I also tried an “adb install” of the apk, thinking maybe it was just Unity’s build and run having problems – same error.

I am definitely running 3.3.0f4. At least, Unity thinks so.

Your libfmod error is very telling – are you suggesting the Unity android build system is confused? As I mentioned, I did try a re-install. Did not un-install Unity first, tho, just a re-install in place, which claims to remove “old Unity” first. I could try that, I suppose. Any other suggestions?

I tried a complete uninstall of Unity (including deleting C:\Program Files(x86)\Unity remaining files) and webplayers (there were two in Programs and Features, for some reason). Rebooted. Reinstalled UnitySetup-3.3.0.exe. Rebuilt project. Same error.

If libfmod is not supposed to be part of Unity 3.3 builds for Android, then something is seriously wrong. What could it be???

remainder of the unity engine on the android device?

Is there a “Unity engine” on the device, seperate from the apps? I don’t see anything like that in Settings.

I have removed old installs of the apk through Settings, before installing new builds.

Other Unity apps on the Android, built in the past, still run OK.

EUREKA!

It appears you have to have Development Build checked in the build settings!

Is this known? Did I miss something obvious?

I don’t know why, I don’t know what this means, but the build does run when this is the case.

The docs seem behind on this. Presumably it is the same as Debug Build? Presumably debug builds run slower than “real” builds? (Well, “real” builds don’t run at all, apparently.)

However, this app has a “Development Build” watermark in the corner of the app, whereas apps I built in the past do not have this watermark, so I would assume something with non-Development Builds is still broken.

Anybody know what this might indicate?

Bren, first make sure you don’t have anything left on the device. Go into Settings → Application → Manage Applications, and make sure your app is not still there. If it is, click it and then select Uninstall.

Then start the Unity editor, make sure it’s the latest version (3.3) and create a new project. Open the Build Settings window, make sure Development Build is not set and then click Build Run. The editor should compile an empty scene into an .apk and upload it to the device (if you have the device connected, USB debugging enabled, drivers installed etc). Then the application should start on your device and the empty scene will be displayed (without any watermark).

If it crashes out can you please report this as bug through the Unity bug-tracker (Help → Report a Bug) and attach the complete logcat output from the attempt to launch the app, as well as the generated .apk file. Please also write down the model of the device and firmware/OS version.

Thanks.

Same result with new empty project. I have submitted all the material you requested as a bug.

I am guessing the reason you need to have “Developmental Build” checked is because Android APK files are required to be signed with a keystore before they can be installed. Although I am not sure how Unity handles this, when using the traditional Android SDK, you need to create one and apply it to the APK before compiling. I assume that the “Developmental Build” option you selected tells Unity to use the default debug keystore that ships with the Android SDK. Please note, however, that with the debug keystore, your APK will be rejected from all app stores (Or at least the ones that are worth while).

That’s incorrect; Unity signs any build with the “debug” key if nothing else is set under Player Settings / Publishing Options in the editor. Development/Non-development makes no difference for this case.

I’ve had a look at that .apk you provided. It really includes the libfmodex.so, but also uses the 3.3 library layout (separate libmono.so). The only conclusion I can draw from that is that your Unity 3.3 installation is somehow a mishmash of 3.1 and 3.3.
Please try uninstalling Unity completely and/or install Unity into a separate directory. Maybe the uninstaller failed to remove the old Android binaries from your previous installation…

I finally got around to giving this a try.

I installed 3.3.0f4 again, in parallel, built and crashed with the same error.

I uninstalled both of Unity installs, nuked the remaining Program Files (x86) folders, reinstalled, built and crashed with the same error.

Whatever it is, it’s still there.

What could it be? My android sdk? Java? What?

Bren, with your attached APK I indeed get a crash, but when I open your project folder and install it to the device, it works. This hints at your Unity installation problem, or may be there is something with hardware (like overclocked CPU or overheating).

What, on my dev PC? That sounds unlikely…

We are working on a project in unity 3.1.0f3 and the animation works fine here, when we updated the unity version to unity 3.3.0f4 for android and played animation in the unity Editor, we got the following error while looping the animation for more than 12 times.

Unable to create broadphase entity.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Actor Initialisation failed: returned NULL.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Could not create actor. Maybe you are using too many colliders or rigidbodies in your scene?
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Is this unity version 3.3.0f4 bug? Will this hava an impact on game publish?

any luck here? i have a similar problem

i can build to my droid x no problem, but i tested on my friends desire and my touch and it crashes seconds after the splash screen, it also crashes within the emulator, i have no idea why its doing this 8(

Just to rule out any crash issues we actually fixed in 3.4 - did you try with the new version we just released?
Do you a logcat output of the crash?

If you still have this problem please “Report a Bug” in the Editor and attach your repro project, and the logcat output if available.

Thanks.

i updated it, it seems to be working on droidx and droid but not for desire, mytouch, or incredible 2 so far

the whole project file or just the apk?

Edit: also i dont wont be able to have the logcats from the devices it actually crashes on, they are just some my friends phones i dont actually own them myself, is this an issue?