Xamarin Forms WatchOS main iOS app couldn’t be found - xamarin.forms

I am trying to create a watchOS app in an existing Xamarin Forms application in Visual Studio 2017 on Windows. I have followed all the steps listed here. I have also added watchOS app project reference to the main iOS app by selecting add reference option of the references node of the main iOS app. Solution also builds successfully but when I try to launch watchOS app in watch simulator, it instantly throws the below error without even launching the simulator.
Error:
Main iOS app couldn't be found, please make sure you've created an iOS app and it is referencing
Please suggest what I am doing wrong.

I think you have add the watchOS app reference in a wrong place.
You should add the reference in xxx.iOS projecct instead of xxx(xamarin.forms project).
Let me show a screenshot for you:
Update:
Steps:
I create a new MobileApp(Xamarin.forms) project(platform iOS).
Right click on the solution -->add --> new project -->Apple Watch -->watchOS app-->ok.
Right click on the xxx.iOS project --> add---> reference --> check XXX.watchOSApp
Right click on the xxx.WatchOSApp --> Set as Setup Project.
(Clean and rebuild) Run on the appleWatch simulator.

Related

RefreshView when target Platform is UWP then it is not wokring

RefreshView when target paltform is UWP it is not working i.e I'am unable to apply pull to refresh, but on iOS and Android it is Working fine.
RefreshView when target paltform is UWP it is not working
I have to say the RefreshView only avaiable for touch screen, if you use mouse mode, it will not response your drag gestue. please run your app with simulator or touch device.
For more detail please refer to Run UWP apps in the simulator document

Xamarin forms: ITMS-90809: Deprecated API Usage, but no webview in my project

Yesterday I have pushed a new app to AppStore, but it gets rejected with the following error.
ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).
In my knowledge, this issue usually occurs due to the use of Webview. I have one Webview in my project, so I decided to remove it (Since that part is currently not using in the project). I have pushed the app again to AppStore after removing the Webview, but again my app gets rejected with the same error. After that I do a clean, rebuild, and deleted the bin, obj folders. 2 times my app gets rejected from Appstore after removing Webview.
See the below screenshot: No Webviews are available for the entire solution.
Are there any other reasons for this error?
This seems an existing issue of Xamarin.forms on iOS .
Make sure that the version Xamarin.Forms is 4.6 or higher and Xamarin.iOS is 13.10.0.17 or higher.
Change the Linker Behavior to SDK Only or Link All and then add the
additional arguments: --optimize=experimental-xforms-product-type
Please check all of these have been set under the release
configuration and iPhone platform.
For more details you could refer
https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-forms/

Xamarin Hot Reload 'Local Device' not shown

I'm trying to get hot reload working on an existing xamarin.forms project, so I can deploy to my iOS devices directly without a mac.
I got this feature to at least show the 'Local Device' selection on a new project, but I can't get it to show this selection in the existing project therefore I cannot setup the hot reload.
Do you have any idea what might be the problem?
If it helps I also added the iOS project build properties.

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.

How to submit crash report to Microsoft App Center for Xamarin.Forms?

I want to submit crash report to Microsoft App Center for my project which is created in Xamarin.Forms.
Can anybody please suggest a link or steps where I can follow and integrate required steps in my project? I also want to test.
Please guide.
Whenever you login to the App Center portal all the information you need is right there. Create an app in the portal, one for Android and one for iOS if you have these platforms.
From there, basically you have to install the NuGet packages and add one initialisation line in your code. Note that you will be provided with the ID for this specific app under step 2. If you have multiple platforms, add the line once and replace the different IDs for each platform.
You will then have basic crash reporting and analytics (if you install both packages). You do not need to do anything extra for it, start your app, start using it and watch data come back to the portal.
Since a little while you can now also track handled exceptions and custom events.
For more information, check out the extensive documentation here: https://learn.microsoft.com/en-us/appcenter/
Please refer the detailed information here:
App center for Xamarin
Steps are:
You need to create 3 apps in App Center – one for each OS.You need to select Xamarin as the platform for Android and iOS applications and obtain App secret
Install Microsoft.AppCenter.Analytics and Microsoft.AppCenter.Crashes packages.
Open your App.xaml.cs and write this in OnStart() method:
AppCenter.Start("ios={Your App Secret};android={Your App Secret}", typeof(Analytics), typeof(Crashes));

Resources