Error building Player: CommandInvokationFailure: Failed to build apk. See the Console for details.
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“/Users/frj/dev/tools/android-sdk-macosx/tools” -Dfile.encoding=UTF8 -jar “/Applications/Unity/Unity.app/Contents/BuildTargetTools/AndroidPlayer/sdktools.jar” -
stderr[
Error: Duplicate file(s) in apk: ‘/Users/frj/dev/App-Unity/src/App-Unity/Temp/StagingArea/raw.ap_’
]
stdout[
I deleted the entire src/App-Unity folder and checked everything out from Git again - Unity wrote this in the console ‘Rebuilding Library because the asset database could not be found!’ - after that I was able to build apk files again.
Is there a nicer way of triggering the asset database rebuild than deleting everything?
I had the same error message when building for Android. My issue was related to having the same file in my Assets
\StreamingAssets and Assets\Plugins\Android\assets folders.
I would have thought that too - and did try it. But it did not help for some unknown reason.
Indeed that was the case - It sure would be helpfull if the console error named the duplicate entries. In large projects it can be quite a pain to find such problems.