Comments (18)
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.
from qrcoder.
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.
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.
None of these are not working..still i got same error
from qrcoder.
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.
from qrcoder.
i sent you unity package of my project in zip..
from qrcoder.
Hello, You tested my project ?
from qrcoder.
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.
If i remove both than it will work ? because all QR Code generator code in those files so i ask you
from qrcoder.
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.
not even require of UnityQRCode.cs ? i am confuse here ...please
from qrcoder.
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.
@vishalpvr123456 Did my solution work for you?
from qrcoder.
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.Dictionary
2 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.Dictionary
2 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.
i got this error after removing files and this error comes at build time
from qrcoder.
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)
- Tests for old .NET Frameworks HOT 2
- Documentation issue: URLs HOT 1
- Time Zone in Calendar events HOT 1
- WiFi Payload Won't Generate Correctly HOT 2
- Module size (note pixelsPerModule) HOT 1
- PlatformNotSupportedException when trying to generate QR Code. HOT 2
- Intelligent Mail, IM, postal barcode support? HOT 3
- Memory leak occurs when QR codes used Base64QRCode class HOT 4
- How to generate qr code with transparent background? HOT 2
- 更新到1.4.3,SvgQRCode没有了 HOT 4
- Why not use Color struct instead of byte[] in color parameters? HOT 1
- PayloadGenerator.WiFi.Authentication.WPA2 missing HOT 2
- Can Create a QR with shapes of my logo HOT 1
- Sample code fails - "QRCode" doesn't exist HOT 5
- Guidance on artistic QR codes HOT 1
- Trying to Convert a SVG QRCODE to PNG file HOT 3
- PayloadGenerator give the same result HOT 2
- How to read the code from image HOT 2
- Qr-code
- The type initializer for 'SkiaSharp.SKData' threw an exception. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qrcoder.