Error in building and signing APK

Just today, I have a serious problem where I cannot build any APK for Android. Whenever I tried to build an unsigned (debug) APK, there always an error message saying:

Error building Player: ArgumentException: An empty file name is not valid.

And whenever I tried to sign the app with a keystore that I generated before, after I filled the password and clicked the “Alias” drop down menu, there always this error message:

ArgumentException: An empty file name is not valid.
    System.IO.FileSystemInfo.CheckPath (System.String path)
    System.IO.DirectoryInfo..ctor (System.String path, Boolean simpleOriginalPath)
    System.IO.DirectoryInfo..ctor (System.String path)
    (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:.ctor (string)
    UnityEditor.AndroidKeystoreWindow.findPathWildcard (System.String str)
    UnityEditor.AndroidKeystoreWindow.LocateJDKbin ()
    UnityEditor.AndroidKeystoreWindow.setupKeytool ()
    UnityEditor.AndroidKeystoreWindow.GetAvailableKeys (System.String keystore, System.String storepass)
    UnityEditor.PlayerSettingsEditor.PublishSectionGUI (Int32 selectedPlatform)
    UnityEditor.PlayerSettingsEditor.OnInspectorGUI ()
    UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty)
    UnityEditor.InspectorWindow.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

This also the case when I tried to build create a new keystore, after I filled in all the details like name, organization, validity etc, the same error message appear after clicking the “Create Key” button.

I didn’t do anything with the project and I knew that the keystore works properly as I just used it yesterday.

I’m using Mac OSX Mountain Lion 10.8.2 and Unity Pro 3.5.6f4. Not sure what happened… I don’t want to end up reformatting my mac.

Thanks in advance.

I have this problem too. Unity 3.5.6f4, MacOS 10.7.5, JDK 1.6.0_29. where is the problem?

Not sure where’s the problem. But I ended up reformatting my mac and reinstalling all my apps from zero, and now it works again.

PS: I’ve tried to reformat and restore all my apps, user folders, and system settings with migration assistant but the error was still there. But when I reformat again and this time I only migrate the user folders (without the applications system settings), it now works perfectly.

I guess the problem is with some of the installed apps in your mac or conflicting with system settings.

I’m not in a position to do a reformat. I reinstalled Unity with no luck. When I try to use “Browse Keystore” it won’t let me select any files, is there are particular file extension its looking for?

updating java to 1.6.0._37 seems to have fixed my issue.

when I try to compile my Android application I get this error “” An empty file is not valid "right after adding l sdk path I get the error. I work from a mac 10.8.2, Unity3D 4, java 7. someone poria would greatly appreciate help.