Xamarin Forms: BLE Laerdal Dfu OTA. compilation problems - xamarin.forms

I am trying to get an App to work with OTA Nordic Dfu, and the only xamarin nuget I can find was the one made by Laerdal on GitHub
When I try to build under iOS I am getting a few error like this one here:
Error MT5211: Native linking failed, undefined Objective-C class: _TtC13iOSDFULibrary11DFUFirmware. The symbol '_OBJC_CLASS_$__TtC13iOSDFULibrary11DFUFirmware' could not be found in any of the libraries or frameworks linked with your application.
A bug is open for this, but so far not a word from the people maintaining it.
I am left wondering if this is actually a local problem and not a problem with the nugget its self. So if any one out here is able to compile this under iOS help would be really appreciated.

Related

Type or namespace name Forms does not exist in the namespace Xamarin

I downloaded VS2019 and proceeded to create a Solution and Project to learn Xamarin. I have tried using different templates (Mobile apps or just iOS) with the same result. Without changing anything in the resultant forms etc., if I build the solution I get the error that Forms does not exist in Xamarin. I have tried to download Xamarin.Forms, but it says it is already installed. I have searched and Googled and while there are similar questions of "name XXX does not exist in namespace YYY", none of those solutions apply in my case. I have tried to re-install VS, done a "repair" to VS. Many sites suggest closing and re-opening the solution (or cleaning), or restoring Nuget - none of that helps. The iOS project contains a reference to Xamarin.ios and I can see Xamarin.Forms under that so it does exist, but the project can't seem to find it. I know people like to see code here, but I haven't done any coding yet.
Solution image
Error image
AppDelegate
The solution was to manually add a folder called Thinktecture in C:/Program Files (x86)/Microsoft SDKs, then do an update of Xamarin.ios. It then gives a host of warnings about "Can't resolve the conflict between....", but it chooses the latest version and the Build works.

How to include Android.Support.v4 in Xamarin Forms (iOS)?

I am using Visual Studio For Mac. My Xamarin Forms project is quite large and contains many content pages. Some of them will be only used in android project and some of them only used in iOS project. There is no problem when I compile the project into android. However, when I want to compile the project into iOS, it seems like did not accept anything related to android. Please refer to the screenshot. There is no way I can include the android specialised reference and compile into iOS project. So, any idea to deal with this? Maybe there is a way to force build the iOS project no matter what? The error from the screenshot is from the page that will be only used in android. So what I can do for now is delete the page when I want to compile as iOS and recreate the page when I want to used it for android. But there are plenty of them, it is too heavy for me to do this every time. Please help.
You can't call platform specific APIs at the .NET standard libraries that are used to host Xamarin.Forms code by default.
Basically you have those options:
1) using shared project instead of library and using conditional compiling (easier but it is now not available as the option when creating the project)
2) using dependency injection.

Xamarin.Forms - Xamarin.Forms.Maps broken references in Droid Project

I need to implement Map functionality into an application that I'm building.
And I was folliwing this guide.
I downloaded the package and did all of the configuration.
I haven't implemented the Map class into my project yet, I only did the configuration required for both platforms (Android and iOS).
The Portable project and the iOS project are fine, the problem here is the Android project.
It has some broken references, these ones:
And when I try to compile the Android project, I get this error and these warnings:
Can anybody give me a hand? Thanks in advance.
EDIT:
As a sidenote, I'm using the Sdk installed by Android Studio, and that one has the latest Google Play Services installed.
UPDATE:
I just upgraded the version of my Xamarin.GooglePlayServices one by one (the one listed up there in the first image) for some reason it downloaded a really old version of those. So I just upgraded them, and it seems those references are fine now.
But I still get the error:
The "ResolveLibraryProjectImports" tasks failed unexpectedly.
SOLUTION:
I unloaded the Android project, added this:
<UseShortFileNames>True</UseShortFileNames>
To every property group in the .csproj file.
Load my android project back, and it all worked fine now.

is 'dyld library not loaded- image not found' an error in the simulator or an error in the app extension?

When I run a build with the simulator it crashes with this error, saying 'dyld: Library not loaded' and also 'image not found';
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /Users/username/Library/Developer/CoreSimulator/Devices/105F223C-3558-46E2-B3C0-CEF7E29B6B3D/data/Containers/Bundle/Application/D0F33E52-59FC-46EA-B1FF-DBE191CA4DD2/Watch.app/PlugIns/Watch Extension.appex/Watch Extension
Is this a simulator error, or an app code error? I would like to know if I can upload the app to the App store, or would it be an invalid build because of this error?
Also, any ideas on how I can fix it?
You cannot upload to the App Store this way, though I don't know why you would want to since you can't test your app.
Go to your main application and try turning on Always Embed Swift Standard Libraries (this was called Embedded Content Contains Swift in earlier releases).
Sometimes if the main app target doesn't have any Swift code or you have a plugin situation Xcode doesn't realize it should be including the Swift standard library in your bundle. In this case, for whatever reason, Xcode doesn't think Watch.app needs Swift so it doesn't include it even though your extension does use Swift.

Resource.Designer.cs file not updating correctly

I'm trying to build a simple barcode scanner using Xamarin forms and I'm using ZXing Library (I copied/added the Dlls manually).
when i build the project i get the following errors:
'Resource.Id' does not contain a definition for'contentFrame'
'Resource.Layout' does not contain a definition for 'zxingscanneractivitylayout'
'Resource.Layout' does not contain a definition for 'zxingscannerfragmentlayout'
I did my research before posting this, I know that the error has something to do with the "Resource.Designer.cs" file not being updated but I honestly don't know how to fix this.
I also found this old post with the same problem
[Unknown globals when installing ZXing Scanner
but nothing suggested worked for me.
Any Idea, how can this error be fixed, Thanks for your help.
Edit : I'm using Visual Studio Enterprise 2015 and Xamarin Forms v2.2.0.45
Just update to Zxing.Net.Mobile 2.1.0.1 beta prelease and the errors will disappear.
The problem is widely known
Xamarin bugzilla
Issue on Github repository of Zxing

Resources