Before updating to Windows 10 you may need to return your Pro license. More information here

Build fails with Android plugin

To start with, I use Unity Pro 3.4.2 with Android Pro on OS X. I'm able to build my project for Android and deploy on the device, it works like a charm. I have also been able to create a java library that I want to use as a Unity plugin, create a java project in Eclipse that uses my library and the Unity project as a library. It works great and my calls from Unity to Java code does what's expected.

The process of using the Unity project as a Java library with Eclipse involves a lot of hands-on steps with copying this and that, and is quite error prone, so I really want to just add my java library as a plugin to have a more streamlined process. Here comes the problem:

As soon as I add any java-code to Assets/Plugins/Android the build fails with an ArgumentException and the console saying "An empty file name is not valid". Details:

Exception: Error building Player: ArgumentException: An empty file name is not valid.
UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions)
UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder)
UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings ()
UnityEditor.BuildPlayerWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke(System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.

Anyone recognizes this and/or have an idea of what's causing the build to fail?

As a side note, I have problems with configuring the Keystore in Unity, I don't know if it's related but I seem to be able to build and deploy a "clean" project anyway…


FYI, I'm a complete rookie with Android development, and hence, with Unity Android development as well...

more ▼

asked Feb 01, 2012 at 09:10 AM

avatar image

42 7 5 8

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first

Hi! I have a similar issue. I had 5 prefab and when i wanted to select one unity selected me the five of them. I got this error once ArgumentException: An empty file name is not valid. I dont know why it happened. My solution, i entered to the folder where i had my prefabs (throw windows ex: c:/yourProyect/Assets/PrefabFolder and simply rename them and now works fine. Hope this help you!

more ▼

answered Feb 25, 2012 at 10:26 AM

avatar image

11 22 16 20

(comments are locked)
10|3000 characters needed characters left

If You have integrated any plugins related iOS. Remove them for Android Build. And it will work fine.

more ▼

answered Nov 08, 2012 at 07:10 AM

avatar image

16 5 8 9

(comments are locked)
10|3000 characters needed characters left
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Feb 01, 2012 at 09:10 AM

Seen: 2628 times

Last Updated: Nov 08, 2012 at 07:10 AM