-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App crashing on try to scan on IOS #100
Comments
Hi, |
So i switched to ZXing Scanner by Redth. |
@JimmyPun610 : I tried older versions of BarcodeScanner.XF. None of them worked. Even the sampleproject crashes on iOS with the same Exception: 'Could not create an native instance of the type 'Firebase.MLKit.Vision.VisionBarcodeDetectorOptions': the native class hasn't been loaded. Thanks in advance |
Hi @JoergTie , Just built for my iPhone 11, iOS 15 and it looks working. For this issue, it is probably caused by building for an unsupported architectures. |
@JimmyPun610 :I use a iPhone SE iOS15.2.1, Visual Studio 2022 on Windows. Connected to a Macbook (15.2) with Xamarin.iOS xamarin.ios-15.4.0.0.pkg |
The latest version of official releases are not published yet. I built from their source code and created an update.
Please make sure you have set the architecture to ARM64 only. |
@JimmyPun610 : Thank you so much for your help, I still get an exception but a different one: here are my project settings after using your nuget packages: |
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <ItemGroup> comment: < replaces < |
Hi @JoergTie , I cannot reproduce this error. What about if you just include the BarcodeScanner.XF in your projects but not that 3 Firebase/MLKit packages? Another suggestion is that download the BarcodeScanner.XF source project, import to your solution and add it to your Xamarin project as reference. If all of above suggestion is not working, it would be nice if you could share a sample project for me |
Hi @JimmyPun610, 2022-02-14 01:45:41.944 Xamarin.PreBuilt.iOS[4720:2354019] Xamarin.iOS: Successfully received USB connection from the IDE on port 10000, fd: 7 Loaded assembly: /private/var/containers/Bundle/Application/0E2788E8-C527-46CF-9477-E4032E569CC4/SampleApp.iOS.app/Xamarin.iOS.dll [External] 2022-02-14 01:45:42.609 Xamarin.PreBuilt.iOS[4720:2353999] App path /var/containers/Bundle/Application/0E2788E8-C527-46CF-9477-E4032E569CC4/SampleApp.iOS.app/SampleApp.iOS.content/SampleApp.iOS.exe 2022-02-14 01:45:42.609 Xamarin.PreBuilt.iOS[4720:2353999] Xamarin.iOS: Unable to locate assembly 'Xamarin.Forms.Platform.iOS' (culture: '') 2022-02-14 01:45:42.609 Xamarin.PreBuilt.iOS[4720:2353999] Xamarin.iOS: Unable to locate assembly 'Xamarin.Forms.Platform.iOS' (culture: '') Loaded assembly: /private/var/containers/Bundle/Application/0E2788E8-C527-46CF-9477-E4032E569CC4/SampleApp.iOS.app/SampleApp.iOS.content/SampleApp.iOS.exe Thread started: #4 2022-02-14 01:45:42.866 Xamarin.PreBuilt.iOS[4720:2353999] Xamarin.iOS: Unable to locate assembly 'Xamarin.Forms.Core' (culture: '') Loaded assembly: /private/var/containers/Bundle/Application/0E2788E8-C527-46CF-9477-E4032E569CC4/SampleApp.iOS.app/SampleApp.iOS.content/Xamarin.Forms.Core.dll [External] 2022-02-14 01:45:42.925 Xamarin.PreBuilt.iOS[4720:2353999] Xamarin.iOS: Unable to locate assembly 'Xamarin.Forms.Xaml' (culture: '') Loaded assembly: /private/var/containers/Bundle/Application/0E2788E8-C527-46CF-9477-E4032E569CC4/SampleApp.iOS.app/SampleApp.iOS.content/Xamarin.Forms.Xaml.dll [External] at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) |
Hi @JimmyPun610,
I have put a lot of time searching for a solution to make this work in ios. |
Hi @Pranse2003 , Yeah, the Firebase.Core.App.Configure(); is no longer needed.
B:
|
I am having this crash with iOS as well. It happens whether I use Xamarin Forms or Maui. Visual Studio 17.3.0 Here is a video replicating it with the SampleApp.Maui. It first requires changing the sample app to target iOS. The call stack shows it is happening in the iOS CaptureVideoDelegate. |
Hi @lowellburns , Did you tried to use Visual Studio for Mac to build to see if it success? |
@JimmyPun610 I'm having the same issue on iOS 15.6 using the MAUI project. Android works great :)
|
We tried on Visual Studio for Mac. As it turns out when targeting an iOS simulator (instead of physical ios device) with Visual Studio for MAC or Vistual Studio on Windows the build fails because of the issue of native references. It is the same issue, but it is just caught at build time when targeting a simulator and runtime when deploying to a physical iOS device. |
Was there a resolution to this found? im having the same ios issue with the Xamarin Forms sample |
Is @JimmyPun610 alive? I'm facing the same issue, scan works on iphone 6 but crash on iphone 12 and 13 |
Please provide more information. E.g. logging, is it happening in Xamarin.Forms or Maui?
You could try this... For Maui, please add these to project file
|
Updating to 6.3.0.25 resolved the issue. It's working in all devices now. |
Hi In Android it works perfectly. Great. Thank you. But I am also getting the error on iPhone for version 6.3.0.25: [0:] An error occurred: 'Could not create an native instance of the type 'MLKit.BarcodeScanning.BarcodeScannerOptions': the native class hasn't been loaded. at (wrapper managed-to-native) UIKit.UIApplication.xamarin_UIApplicationMain(int,string[],intptr,intptr,intptr&) |
Hi, I have just done some research against this issue recently and it seems it has a possible workaround. To be short, you may try to copy the code from https://gist.github.com/mattjohnsonpint/37d3ac06a563c41618fc933bf7282d66 to your maui project .csproj, paste it with the and try to rebuild it again. Or as an alternative, build and deploy to iOS directly by the latest Visual studio for Mac. For others related articles, please see if below could help you.... Any feedback would be appreciate |
Hi |
Hello guys,
I just wanted to implement the Scanner in my App, but everytime i try to scan the app crash. So i tried it with the sample app and here its not working too.
This is the Exception output.
I figured out that when i am builduing the app, this output is shown:
Can someone help me?
The text was updated successfully, but these errors were encountered: