- Home /
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…
Thanks!
FYI, I'm a complete rookie with Android development, and hence, with Unity Android development as well...
Answer by Martin_Gonzalez · Feb 25, 2012 at 10:26 AM
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!
Answer by nikbn29 · Nov 08, 2012 at 07:10 AM
If You have integrated any plugins related iOS. Remove them for Android Build. And it will work fine.
Your answer
![](https://koobas.hobune.stream/wayback/20220613063623im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Google Play Game Services Plugin "Failed to re-package resources" 2 Answers
PlayerPrefs Plugin. error CS0103: The name `PlayerSettings' does not exist in the current context 2 Answers
How do I correctly install the Facebook SDK plugin? 1 Answer
Game Thrive (One Signal) causes game to crash when calling init method. 1 Answer