question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VisionApi.Create not get correct App

See original GitHub issue

Hi!

When start demo example, i have error, there is a workaround?:

Parameter name: app’. Callstack: ’ at Firebase.MLKit.Vision.VisionApi.Create (Firebase.Core.App app) <0x1502279c8 + 0x00014> in <8607cf18847b4467a58b3fd7d84f75f1>:0 at GoogleVisionBarCodeScanner.UICameraPreview+CaptureVideoDelegate…ctor (System.Boolean vibrationOnDetected) [0x0004c] in D:\BarcodeScanner.XF-master\GoogleVisionBarCodeScanner\iOS\UICameraPreview.cs:178 at GoogleVisionBarCodeScanner.UICameraPreview.Initialize (System.Boolean defaultTorchOn, System.Boolean vibrationOnDetected, System.Boolean startScanningOnCreate) [0x0011a] in D:\BarcodeScanner.XF-master\GoogleVisionBarCodeScanner\iOS\UICameraPreview.cs:141 at GoogleVisionBarCodeScanner.UICameraPreview…ctor (System.Boolean defaultTorchOn, System.Boolean vibrationOnDetected, System.Boolean startScanningOnCreate) [0x00008] in D:\BarcodeScanner.XF-master\GoogleVisionBarCodeScanner\iOS\UICameraPreview.cs:39 at GoogleVisionBarCodeScanner.Renderer.CameraViewRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1[TElement] e) [0x00059] in D:\BarcodeScanner.XF-master\GoogleVisionBarCodeScanner\iOS\Renderer\CameraViewRenderer.cs:25 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00172] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:296

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
AdrianBylicacommented, Apr 14, 2021

Does it works if you set the linker behaviour to No Link?

No, this don’t work in all option (Don’t Link, SDK only and All linked) also with and without Hot reload. off course the GoogleServices-info.plist is set to - BundleResource

This could be a bug from the Firebase library for Xamarin iOS. xamarin/GoogleApisForiOSComponents#452 Could you please check if Firebase.Core.App.DefaultInstance (after Firebase.Core.App.Configure()) is null or not? if it is null, please try to add the parameter to the config function to see if it is null or not. In fact, there is nothing I can do with this.

result is null 2021-04-14 17:17:47.405 Xamarin.PreBuilt.iOS[934:93167] Firebase App App.DefaultInstance IS NULL

Sorry, just look back to your previous comment. You should disable HOT-RESTART instead of hot reload. They are different.

To disable hot restart, please refer to https://docs.microsoft.com/en-us/xamarin/xamarin-forms/deploy-test/hot-restart.

Xamarin Hot Restart is disabled by default on Visual Studio 16.8 and previous versions. 
You can enable it under Tools > Options > Environment > Preview Features > Enable Xamarin Hot Restart. 
Starting in Visual Studio 16.9, Xamarin Hot Restart is on by default and can be turned off from Tools > Options > Xamarin > iOS Settings > Enable Hot Restart.

I guess some firebase libraries are static libraries that do not support hot restart and as a result, it cannot be activated.

If you are using Visual Studio for Windows, please try to disable the hot-restart and try again. If you are using Visual Studio for Mac, I think it is good to go.

I do not have Windows right now so I could not try it. I am looking forward to your feedback.

Ok Jimmy, i have try this all option in Windows without success, the disable Hot Reload option also eliminate use my real device, so i have run to VS in MAC and the problem disappear. So, for all People that will use this in iOS platform don’t try this in Windows this only waste your time, go to Visual studio in MAC. Thanks for help.

1reaction
JimmyPun610commented, Apr 14, 2021

Hi @decv86,

Just like above comment, please try to disable HOT-RESTART / use Visual Studio for Mac to debug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Cloud Vision API hangs when used inside app ...
1 Answer 1 ... You are supposed to make calls to Cloud Vision API, a service hosted in the Cloud, not locally on...
Read more >
Cloud Vision setup and cleanup
This guide provides all required setup steps to start using Cloud Vision. It also provides advice for possible cleanup steps after trying or...
Read more >
Make a Vision API request
The Cloud Vision API is a REST API that uses HTTP POST operations to perform data analysis on images you send in the...
Read more >
Using Google Vision API
Google offers several APIs, so for this tutorial not to get bigger than it already is, ... Try Google Vision API — creating...
Read more >
How to Fix 'API Key Not Valid' Error When Trying to Access ...
Next, check that your API key has permission to access the Cloud Vision API. Go to the Google Cloud Console and navigate to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found