Comments (19)
yeah, thanks for your help in advance, I will test in next monday
from qrcoder.
Hi Tim,
I'm neither an Unity expert nor do I own an iOS device. The Unity code was written by @alexnsfx and just pulled into the repo by me. So maybe he can give us a hint.
For now, could you please give more details about "it did not work"? Can you deliver some kind of stack trace or exception message?
from qrcoder.
When it run on unity edtitor, win/mac both run well. Android well too, but ios, it does not, I think the reason may be at Texture2D image =qr.GetGraphic(20);
QRCodeGenerator gen=new QRCodeGenerator();
PayloadGenerator.Url url=new PayloadGenerator.Url("http://tim.bai.uno");
QRCodeData qrCodeData =gen.CreateQrCode(url.ToString(),QRCodeGenerator.ECCLevel.L);
UnityQRCode qr=new UnityQRCode(qrCodeData);
Texture2D image =qr.GetGraphic(20);
GetComponent<Renderer>().sharedMaterial.mainTexture=image;
I'm not sure, but I'll do my best to test it and give the feedback.
from qrcoder.
Hi @tim-hub ,
could you please try the following and tell me, if this fixed your problems.
Please change line 37 in UnityQRCode.cs from:
var gfx = new Texture2D(size, size, TextureFormat.ARGB32, false);
to
var gfx = new Texture2D(size, size, TextureFormat.RGBA32, false);
(I've read that iOS doesn't support ARGB32, but I can't test it, so please test it for me.)
from qrcoder.
And don't forget to sync/checkout the newest version of the library. I've added some major bugfixes today.
from qrcoder.
I seemed that is still not work.
from qrcoder.
I'm sorry, but the TextureFormat thing was my only idea. I don't know how to help you, without getting more information on the error. Can you debug your app and give me more detailed information?
http://forum.unity3d.com/threads/debugging-c-on-ios-device.96551/
from qrcoder.
Hello.
It really doesn't work on iOS. I have a Mac and iOS devices where I work, but really don't understand Xcode to try debug.
If you get any help on this I can try to help. Sorry about this vague response.
from qrcoder.
Hey @tim-hub , hi @Biodam - some days are gone and so there are some news. Since I implemented a PCL version of the library, would you be so kind, to test again with the PCL version? Just use the "QRCoderProject.Portable.sln" project to compile the QRCoder.dll (or grab it from the Nuget package).
The portable version has only one QRCode type (BitmapByteQRCode). You can use it as described in the following:
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q);
BitmapByteQRCode qrCode = new BitmapByteQRCode(qrCodeData);
byte[] qrCodeImage = qrCode.GetGraphic(20);
// Create a texture. Texture size does not matter, since
// LoadImage will replace with with incoming image size.
Texture2D tex = new Texture2D(2, 2);
tex.LoadImage(qrCodeImage);
from qrcoder.
Hey @codebude , I tried to test the PCL version , but got an error when I import the QRCoder.dll to Unity.(Unity5.4.3p2 32bit)
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0
at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0
at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
The following assembly referenced from F:\work\snake\trunk_mobile\Assets\Plugins\QRCoder.dll could not be loaded:
Assembly: System.Runtime (assemblyref_index=0)
Version: 4.0.0.0
Public Key: b03f5f7f11d50a3a
The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (F:\work\snake\trunk_mobile\Assets\Plugins\).
Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Missing method .ctor in assembly F:\work\snake\trunk_mobile\Assets\Plugins\QRCoder.dll, type System.Runtime.Versioning.TargetFrameworkAttribute
Can't find custom attr constructor image: F:\work\snake\trunk_mobile\Assets\Plugins\QRCoder.dll mtoken: 0x0a00000e
And I also tried the common version , but I can't get it work on android. Got the error as below
12-07 13:29:26.971 31560 31581 I Unity : InvalidOperationException: Operation
is not valid due to the current state of the object
12-07 13:29:26.971 31560 31581 I Unity : at System.Linq.Enumerable.First[Met
hodInfo] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x0
0000] in <filename unknown>:0
12-07 13:29:26.971 31560 31581 I Unity : at System.Linq.Enumerable.First[Met
hodInfo] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename
unknown>:0
12-07 13:29:26.971 31560 31581 I Unity : at QRCoder.QRCodeGenerator+ModulePl
acer.MaskCode (QRCoder.QRCodeData& qrCode, Int32 version, System.Collections.Gen
eric.List`1& blockedModules, ECCLevel eccLevel) [0x00000] in <filename unknown>:
0
12-07 13:29:26.971 31560 31581 I Unity : at QRCoder.QRCodeGenerator.CreateQr
Code (System.String plainText, ECCLevel eccLevel, Boolean forceUtf8, Boolean utf
8BOM) [0x00000] in <filename unknown>:0
12-07 13:29:26.971 31560 31581 I Unity : at ShareUI+<GenerateTwoDimension>c_
_Iterator3.MoveNext () [0x00000] in <filename unknown>:0
12-07 13:29:26.971 31560 31581 I Unity : at UnityEngine.SetupCoroutine.Invok
eMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <file
name unknown>:0
Any help will be appreciated.
from qrcoder.
Hi @yangyujiang would it be ok for you, to send me some sample code or your sample project? So that I can debug, what's going wrong?
from qrcoder.
@yangyujiang one more idea. The PCL library is built with target x86. Grab the code from GitHub an try to compile the PCL library with target ARM. Maybe this helps to run on your Android.
from qrcoder.
It has been over 5 months since a reply. Is this dead, especially because no traffic inquiring?
from qrcoder.
@Hydroque - since I neither have an iPhone nor I'm really experienced in Unity, I can't handle this problem alone. But since this problem existed I didn't want to close it, before I have a proof that this problem is fixed.
In 1-2 months I'll get a iPhone, so that I can test it myself. So long I like to keep this issue open.
from qrcoder.
I wonder if it reproduces on an emulator.
from qrcoder.
@codebude did you get that iPhone you said you would have?
from qrcoder.
Is this issue still relevant?
from qrcoder.
Hi @Ruffio - I'm sorry, but I can't say if this is fixed, because I still don't have an iPhone dev environment. If you can help to solve this I would be happy.
from qrcoder.
@codebude Sorry for late reply, I did not try the PCL version yet. It takes a really long time for this issue.
from qrcoder.
Related Issues (20)
- The type name 'Bitmap' could not be found in the namespace 'System.Drawing'. HOT 1
- When will the new version be released HOT 4
- 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
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.