Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

CANNOT build for android 'Found plugins with same names and architectures" Dear GOD.

Discussion in 'Scripting' started by Unlimited_Energy, Sep 15, 2016.

Thread Status:
Not open for further replies.
  1. Unlimited_Energy

    Unlimited_Energy

    Joined:
    Jul 10, 2014
    Posts:
    469
    I have never had a problem with a build before now all of a sudden I get this error below. Please help me guys, im trying to build an APK file for android...

    Found plugins with same names and architectures, Assets/Plugins/Android/libs/armeabi-v7a/libOpenCL.a () and Assets/Plugins/Android/libs/x86/libOpenCL.a (). Assign different architectures or delete the duplicate.
    UnityEditor.AndroidPluginImporterExtension:CheckFileCollisions(String)
    UnityEditorInternal.PluginsHelper:CheckFileCollisions(BuildTarget) (at C:/buildslave/unity/build/Editor/Mono/Plugins/PluginsHelper.cs:25)
    UnityEditor.HostView:OnGUI()
     
    davtam and Mercbaker like this.
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,139
    You'd be better off posting this in the android forum
    http://forum.unity3d.com/forums/android-development.30/

    The only thing I can tell you is you have two assets that probably set up the same class so now you have duplicates. These may be contained in jar or aar files and can be tough to track down. Either check and see if you have two of the same files (thus perhaps deleting one) or you may have to go into each jar/aar and see what is in it.

    This is a guess based on your error and my basic understanding of android. But, like I said, try the android forum and you might get better feedback.
     
    Unlimited_Energy likes this.
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,181
    The problem is right there in the error text. It's even got the path to the problematic files.

    Assets/Plugins/Android/libs/armeabi-v7a/libOpenCL.a
    Assets/Plugins/Android/libs/x86/libOpenCL.a

    You've put the same library in your project twice, and the compiler doesn't know which one it should use. The solution is also right there in the error text: "Assign different architectures or delete the duplicate"

    Did you try to delete one of them? Did you read the error?
     
  4. Unlimited_Energy

    Unlimited_Energy

    Joined:
    Jul 10, 2014
    Posts:
    469
    I read the error but I have no idea what deleting that file will do? My question is if one is for ARM devices and the other is for x86 devices then wont deleting one of them screw up something on that device. Like if I delete the x86 libOpenCL.a Won't that cause issues somehow on x86 devices. The obvious solution is to delete it and i realize the answer is in teh text I could find zero information online in what deleting this file will cause.
     
  5. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,139
    Honestly, you might not find anyone here that knows, since this is the scripting part of the forum. For myself, I could probably figure something out, but it would take looking into it. Suggestion is you back up each file before you choose to delete one.

    I know one of those two isn't as common, so that might be the one to try. But I do suggest the android forum if you haven't tried there yet.
     
    Unlimited_Energy likes this.
  6. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,181
    The libraries will be included both in ARM and x86 devices unless you do something to prevent that from happening. Unity won't read the name of the file and go "well this one is in a folder named x86, best only include it in x86 builds!".

    As I said, just try to delete one! If you're not got the confidence to try what the error message is telling you to do, I can't imagine that you'd try to follow any advice I'd give you.

    Removing one of the libraries - as the error told you to - and then hitting the build button would've taken you 15 seconds. Instead, you've waited two days for a forum to tell you to do that very thing. You've got to have some initiative, otherwise you'll never get anything done!
     
  7. Unlimited_Energy

    Unlimited_Energy

    Joined:
    Jul 10, 2014
    Posts:
    469
    Im not understanding something, so hear where my confusion stems from. Your talking to a guy that has only been programming for 2 years. My logic is if its a x86 device and it needs that library from that folder and I delete it, will that not cause some issue? if I delete the file from the x86 folder how will it be included in both devices? Yes it would have the library in the ARM folder still, but won't x86 devices be trying to access that library from that folder and it will be gone if I delet the x86 libOpenCL.a? I do not have any x86 devices to test on to see if there is an issue? not sure if that sounds stupid..
     
  8. flaminghairball

    flaminghairball

    Joined:
    Jun 12, 2008
    Posts:
    868
    You're right -- deleting plugins is not a great solution.

    In this case, given that almost no consumer android devices run an x86 architecture (ARM dominates mobile CPU market), my guess is that the x86 plugin is for compatibility inside the editor.

    With that in mind, take a look here: https://docs.unity3d.com/Manual/PluginInspector.html

    Just select the x86 libOpenCL.a and make sure it is disabled for android builds and the error should go away.
     
  9. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,181
    By week three you should be trying things without being sure if they work - you can't wait until you're sure until you do something. Have you still not tried deleting it to see what happens? Your computer's not going to burn down! You can't build now, worst case scenario if you delete it is that you still can't build, and you have ruled out an option. Then you just put the file back in.

    The folders are named x86 and ARM, but that just implies what the authors of those packages intended. If the required dependencies are around - no matter the folder name - stuff should work.

    You have two copies of libOpenCL. That's probably because you downloaded two different plugins that both depend on that library, and included their own copy. If you can delete it depends on if the two plugins are depending on the same version. If both are the exact same size, that's probably the case, and you're good.

    You can also go the route to disable the x86 version for non-x86 platforms, and disable the ARM build for non ARM platforms, but that'll only work if the plugins that require them are not included in both platforms.

    Of course, if both belong to the same plugin, it's probably because it's two different versions for two different platforms, and you should disable them based on platform. That might be the case!
     
    Crocodile_y and Ryiah like this.
  10. mynameisjohnj

    mynameisjohnj

    Joined:
    Mar 18, 2017
    Posts:
    11
    Just wanted to chime in and say that I ran into this issue, and the fix was to do what flaminhairball said and make sure that the proper include/exclude checkboxes were checked for my plugins. You can see these by clicking on the dynamic library and looking at the inspector.
     
    Fibonaccov and Mercbaker like this.
  11. tashfiq103

    tashfiq103

    Joined:
    Mar 4, 2016
    Posts:
    14
    [Solved]

    That was quick by me to be honest xD . Some of the guy in the unity forum was saying to delete one of the library which is not the best you wanna do.

    So the problem was when you import the "Everyplay" package from the "Asset Store", the both "libeveryplay" are selected with "ARMv7" under the "Android" section. So all you need to do is to change that to "x86" at the "libeveryplay" that is under the "Plugin/Everyplay/AndroidDynamicLibraries/x86/libeveryplay".

    Solution.png

    That's it, you are all good to go for making your "Android Build" :)

    Thanks to @flaminghairball and @jj_cakewalk for the information.
     
  12. Mercbaker

    Mercbaker

    Joined:
    Apr 18, 2017
    Posts:
    18
    @flaminghairball 's solution not only works but made sense of how I can fix other issues along this nature. My particular issue was very similar to the OP where I had two of the same plugins from experimenting with two different AdMob plugins. (libgpg.so).

    @Baste Your response was very evangelical and all I learned from you was how to not let my emotions run high when communicating a different point of view - it's a bit embarrassing. Because I chose not to "just delete the file", and instead try to understand the problem, I was able to read further and thus apply flaminghairball's solution and actually understand what was going on.

    Thanks to all who echoed the right solutions here and to sunseeker1988 for asking.
     
    Luferau, MartynEm, Fibonaccov and 4 others like this.
  13. KevinGelking

    KevinGelking

    Joined:
    Jul 17, 2014
    Posts:
    15
    I'm just adding my two cents here because deleting the library (libeveryplay.so clean install via asset store) was not a good option for us either.

    As @tashfiq103 already pointed out, the problem here lies in the meta files.
    The ARMv7 meta works fine and is set correctly, but the x86 meta uses "DefaultImporter" - so while it may look correct in the editor, it may not during a build. To fix this, make any change to the x86 library import settings and apply the change. You will end up with a meta which explicitly states the architecture it is to be used on!

     
  14. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,802
    You guys are bashing @Baste for telling you to read the error and do what it says, but that's exactly what you should do before asking for help.

    Considering the error said "Assign different architectures or delete the duplicate.", and you tried neither before coming here is a bit concerning.

    The answer was to assign a different architecture, as the error stated plainly to begin with. Suggesting that you delete the duplicate (which is usually the reason for these errors) is completely reasonable. I really don't understand all the resistance to basic debugging.
     
    Last edited: Jan 22, 2018
    ehsanrabiei and Ryiah like this.
Thread Status:
Not open for further replies.