Git Product home page Git Product logo

Comments (18)

codebude avatar codebude commented on August 24, 2024

Could you please give a little more sample code. Just from reading this short error text, it is hard to analyze what is going wrong.

from qrcoder.

vishalpvr123456 avatar vishalpvr123456 commented on August 24, 2024

screen shot 2016-09-06 at 10 10 32 am
screen shot 2016-09-06 at 10 11 29 am

from qrcoder.

vishalpvr123456 avatar vishalpvr123456 commented on August 24, 2024

Above i put my project screenshot i hope it will be help to understand my problem or error. I am trying your code in unity 5.3.1f so its a problem or other .... please help me ...thanks

from qrcoder.

codebude avatar codebude commented on August 24, 2024

This problem looks strange, because both types seem to be the same, so no cast should be needed. Nevertheless, have you tried to cast?

You could test the following three variants. (Please tell me if one of it worked for you.)

1) QRCodeData qrCodeData = (QRCodeData)qrGenerator.CreateQrCode("Hi", QRCodeGenerator.ECCLevel.Q);

2) QRCodeData qrCodeData = (qrGenerator.CreateQrCode("Hi", QRCodeGenerator.ECCLevel.Q) as QRCodeData);

3) var qrCodeData = qrGenerator.CreateQrCode("Hi", QRCodeGenerator.ECCLevel.Q);

from qrcoder.

vishalpvr123456 avatar vishalpvr123456 commented on August 24, 2024

None of these are not working..still i got same error

from qrcoder.

codebude avatar codebude commented on August 24, 2024

Can copy the stacktrace or send a more detailed log of the error? Otherwise, would you mind to upload your sample unity project, so that I can test it on my hardware?

from qrcoder.

vishalpvr123456 avatar vishalpvr123456 commented on August 24, 2024

QR Generator.unitypackage.zip

from qrcoder.

vishalpvr123456 avatar vishalpvr123456 commented on August 24, 2024

i sent you unity package of my project in zip..

from qrcoder.

vishalpvr123456 avatar vishalpvr123456 commented on August 24, 2024

Hello, You tested my project ?

from qrcoder.

codebude avatar codebude commented on August 24, 2024

I think I got the problem. You "imported" QRCoder libs twice. On the one hand you imported the QRCoder.dll as reference and on the other hand, you added QRCodeData.cs and UnityQRCoder.cs as single files.

When Mono/Unity tries to compile, it prefers the .cs-files over the .dll. Unfortunately your .cs-files are in a different version and you added just some .cs-files but not all, which are needed. So it comes to an conflict between the .cs-file QRCoder implementation and the .dll QRCoder lib.

The easiest way to fix this, is to remove the both .cs-files (QRCodeData.cs, UnityQRCode.cs) from your Mono project. Then the complete code will be delivered by the QRCoder.dll.

from qrcoder.

vishalpvr123456 avatar vishalpvr123456 commented on August 24, 2024

If i remove both than it will work ? because all QR Code generator code in those files so i ask you

from qrcoder.

codebude avatar codebude commented on August 24, 2024

Yes that's correct. You just need the QRCoder.dll (and of course your own coding in the Behaviour.cs file). Please give a quick feedback, if it worked for you.

from qrcoder.

vishalpvr123456 avatar vishalpvr123456 commented on August 24, 2024

not even require of UnityQRCode.cs ? i am confuse here ...please

from qrcoder.

codebude avatar codebude commented on August 24, 2024

In the unitypackage you uploaded some posts ago, there were multiple files. Besides others I found the "QRCoder.dll", "UnityQRCode.cs" and "QRCodeData.cs".

You only need the QRCoder.dll - the DLL file is the complete library packed into one file. It holds the compiled versions of UnityQRCode.cs, QRCodeData.cs and all the other .cs-files of the QRCoder library.

So you have the choice. Either you include all source files from this Github repository (except the QRCoder.dll), then the library will be compiled, when your Unity project will be compiled.

Or you just embed the QRCoder.dll in you Unity project and forget about all .cs-files. The first option gives you the chance to rewrite or change the QRCoder library. The second option, is easier to implement and has less overhead.

At the moment you took a bit of both approaches. You included the QRCoder.dll and some of the .cs-files. Since the QRCoder.dll has another version as the .cs-files you embedded, Unity/MonoDevelop finds a conflict. He tries to map the QRCodeData object from the cs-file to the version of QRCodeData from the DLL library. Since they're are not at the same version you get the error.

By removing the .cs-files Unity/Monodevelop will take all code from the .dll-file. So your solution should become consistent and so the error should be resolved.

from qrcoder.

codebude avatar codebude commented on August 24, 2024

@vishalpvr123456 Did my solution work for you?

from qrcoder.

vishalpvr123456 avatar vishalpvr123456 commented on August 24, 2024

ArgumentException: The Assembly System.Drawing is referenced by QRCoder ('Assets/Plugins/QRCoder.dll'). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:156)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:162)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:194)
UnityEditor.HostView:OnGUI()

from qrcoder.

vishalpvr123456 avatar vishalpvr123456 commented on August 24, 2024

i got this error after removing files and this error comes at build time

from qrcoder.

codebude avatar codebude commented on August 24, 2024

Seems like something with your compilation target isn't right. You could try this answer: http://answers.unity3d.com/questions/53170/using-drawing-package-like-systemdrawing.html

Or otherwise you could use the PCL version of QRCoder (which I released last Saturday). Indeed the PCL version only has the BitmapByteQRCode class and not the UnityQRCode class, but therefore it's crossplatform. And there are also methods to create a Texture2D from the byte[] which is generated by the QRCoder PCL.

from qrcoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.