Skip to content
Meredith Monticello edited this page Mar 22, 2017 · 33 revisions

FAQ

Here are answers to some of the most common questions we receive. This FAQ is a work in progress and will continue to be updated and expanded.

General Questions
Build and Development
Common Build Errors
VSImporter

I'm getting errors after downloading the bridge through the "Download ZIP" button on Github. What should I do?

There are two ways to install the bridge:

  • Download one of the precompiled release .zip packages from the releases page.
  • Download the complete source via git clone https://github.com/Microsoft/WinObjC.git.

Installing the bridge using one of the precompiled releases is simple; just follow the instructions on our Getting Started page.

If you would like to build the bridge from source – meaning you downloaded the complete repo using git – you must install Git LFS. We use Git LFS to manage the storage of large binaries that are part of the source code repo. For instructions on how to install Git LFS, please see our Building From Source wiki page.

NOTE: If you download the repo using the "Download ZIP" button on the main repo page, you will get errors building the project. Please use either one of the precompiled release builds or build from source using git.


What kind of telemetry does the iOS bridge collect?

Beginning with the 160304 release, we are capturing some data from Visual Studio users who have opted in to sharing telemetry with Microsoft in order to gain insight into the issues our developers are facing. We are doing this in two ways: first, through the Objective-C syntax-highlighting VSIX Visual Studio extension, and second by instrumenting Xib2Nib and vsimporter using ApplicationInsights.

Why is this being added to the bridge?

Capturing build issues directly from Visual Studio allows our team to identify, understand, prioritize and fix the top issues facing our developer community.

Can I opt out from data collection?

Yes. Data will only be collected if you chose to share telemetry with Microsoft when you installed Visual Studio.

What types of data does the VSIX collect?

Using regular expressions, we carefully filter out all personally-identifiable information, including:

  • User IDs
  • Local and network paths and filenames
  • Protocol handlers with paths
  • Any messages that do not match WinObjC types AND contain one of the following strings: "method", "class", "property", "interface", or "namespace"

In other words, the only data we collect are specifically related to bridge features or unimplemented APIs and have been stripped of personal identifiers.

What types of data does the Xib2Nib instrumentation collect?

Xib2Nib uses ApplicationInsights to log start/stop events as well as any unrecognized tags and unsupported classes encountered.

What types of data does the vsimporter instrumentation collect?

vsimporter uses ApplicationInsights to log start and stop events while your Xcode project is converted to a Visual Studio solution. The instrumentation is used to track configuration failures (wrong path, no xcodeproj folder, etc) before the build target can be converted. The instrumentation also logs information about your build target and build phases to determine their levels of support in the bridge. Finally, it logs information about what sort of projects vsimporter generates (.vcxitems, .vcxproj, solutionFolder).


Does the bridge support ARM?

As of the 160218 release, the bridge offers preliminary support for ARM devices, so you can test and run your apps on Windows Phone. The ARM compiler is currently in the Community Technical Preview (CTP) stage and we are actively seeking feedback. If you encounter problems building and running your app using the CTP ARM compiler, please file an issue.


How do I enable syntax highlighting for Objective-C in Visual Studio?

To enable Objective-C syntax highlighting in Visual Studio, navigate to bin/ and double click objc-syntax-highlighting.

Note: If you chose to share telemetry with Microsoft when you installed Visual Studio, enabling syntax highlighting will also turn on telemetry sharing with the Windows Bridge for iOS team. Capturing build issues directly from Visual Studio allows our team to identify, understand, prioritize and fix the top issues facing our developer community. For more information, see "What kind of telemetry does the iOS bridge collect" above.


How can I use a VM on a Mac to develop a single codebase simultaneously in Visual Studio and Xcode?

If you're using the iOS bridge on a Virtual Machine on a Mac, you can easily set up a cross-platform development environment by storing your codebase in a shared folder that is accessible from both the Windows 10 and OS X side. With this approach, you can run Xcode and Visual Studio side by side. To get started, download an evaluation virtual machine for your preferred virtualization environment from our website.

Warning: With this configuration, you may have to rebuild your whole solution or clean and build in Visual Studio before seeing changes made in your code (rather than Visual Studio automatically keeping track of modified files and recompiling the necessary ones). We are investigating this issue; if you encounter it, please file a bug and let us know.

Note: By default, Visual Studio will not register an app with the system if its files are on a network drive, and since folders shared with the Mac host machine in a virtual Windows 10 environment are treated as network drives, we have to change a few settings to get Visual Studio to build and run.

The easiest way to do this is to override the project's output directory. Right click on the project and change the output directory to $(Temp)\$(MSBuildProjectName)\bin\$(Configuration), where Temp is an environment variable pointing to your Temp directory.


How do I get my project log file to help determine the cause of an issue?

When posting an issue, adding the contents of your project log file is extremely helpful to pin down the cause of the problem. To do that, follow the steps below:

  1. Open your project in Visual Studio and go to Tools (1) -> Options (2).

  2. In the left panel of the Options window, select Build and Run (2) under Project and Solutions (1).

  3. Under MSBuild project build log file verbosity (1), select Diagnostic (2).

  4. Click OK to close the Options window.

  5. Rebuild your project solution.

  6. Go to the following path in the File Explorer: /.vsimporter/-WinStore10/<Release/Debug> (1), where is the path to your project solution, is the name of your project and <Release/Debug> is the configuration you built in the previous step.

  7. Locate your project log file <ProjectName>.log (1), and copy and paste its contents as a comment to your issue.


What's the deal with all of these stubs?

We introduced a large number of framework stubs in the 160218 release which contain headers that match the iOS 9.1 SDK. These framework stubs have stub implementations that typically return stub values (usually 0).

Reasoning

We want app developers to be able to compile, link and run their iOS apps on Windows 10 as quickly and easily as possible. Stubbing the iOS framework surface area allows developers to see where degraded functionality lies and focus their attention on the areas that need work. This is the approach we have taken internally to support apps using the Islandwood platform.

How it works

The methods and properties that are stubs have the STUB_METHOD and STUB_PROERTY macros respectively after them. For example:

GAMEPLAYKIT_EXPORT_CLASS
@interface GKNSPredicateRule : GKRule
- (instancetype)initWithPredicate:(NSPredicate*)predicate STUB_METHOD;
@property (readonly, retain, nonatomic) NSPredicate* predicate STUB_PROPERTY;
- (BOOL)evaluatePredicateWithSystem:(GKRuleSystem*)sys STUB_METHOD;
@end

If your app uses any of these methods or properties, you will get a build time warning that will give you an idea of the missing APIs you may be using. The warning will be of the sort:

Warning: method x is deprecated: it is not implemented
How to turn the warnings off

Define NO_WARN_STUBS in your project file.

How to cause build errors instead of warnings

Define NO_STUBS in your project file.

Known issues

The Foundation and UIKit frameworks have some incorrect STUB_* macros in them. We are working on cleaning them up.


What about accessibility?

At present, the Windows Bridge for iOS is still in development and does not yet support all the accessibility features your app might use in iOS. Accessibility is extremely important and we are working hard to ensure that future releases include this vital support. We appreciate your patience.


How does the bridge handle automatic magnification?

What has changed?

As part of our development of Project Islandwood, we have reversed some recent changes to automatic magnification. By default, Project Islandwood enables auto magnification which will automatically size your screen content to the size of the window.

How application layout works

To preserve the best layout experience for iOS developers porting their applications to Windows, the Windows Bridge for iOS uses the native scale of your device to render the layout of your application. The scale reported back to your application is automatically scoped (or clamped) to a value of 1 or 2. In this way you get the best possible layout being displayed without any additional efforts. You can enable or disable this feature if desired.

This capability is determined by the following WOCDisplayMode properties set in the +setStartupDisplayMode category of UIApplication (UIApplicationInitialStartupMode):

useHostScaleFactor: Enables/disables the use of? the native scale. clampScaletoClosestExpected: Clamps the magnification to the closest value for native scale - 1 or 2.


I’m getting errors on my header files about *.tlh files that can’t be opened, “+” and “-” method modifiers being marked as “expected declaration” and “unrecognized token” for “@interface” and “@property”. What should I do?

As you can see on the image below, Visual Studio IntelliSense wrongly flags these errors since it doesn’t yet have support for Objective-C projects. However, those errors do not prevent the compilation of your project, so you should ignore them at present.


I’m getting "error APPX0501: Validation error" and "error C00CE169: App manifest validation error" when building a sample. What should I do?

When building a sample from the samples folder of the SDK, you might get the errors below:

This is because you are using an old version of the SDK, and the test certificates for the samples are expired and/or invalid. To fix this, follow the steps below to generate a new test certificate:

  1. In Visual Studio, open the Package.appxmanifest (1) file of your project and under the Packaging (2) tab, click Choose Certificate... (3).

  2. In the Choose Certificate window, click Configure Certificate... (1) and select Create test certificate... (2).

  3. In the Create Test Certificate window, enter a Publisher Name and password and click OK (1).

  4. In the Choose Certificate window, click OK (1).

  5. If you get a warning about a temporary key already existing and being replaced, click Yes (1).

You should now be able to build your sample without errors.


I'm getting “cannot open input file 'libsqlite3.lib'” error. What should I do?

The Windows Bridge for IOS supports SQLLite for UWPs through the installation of the SQL-lite.vsix directly from sql-lite website download page, under Universal Windows Platform. To add it to your project, follow the steps below:

  1. Download the SQL VSIX for UWP on your machine, found under the Universal Windows Platform section of the sql-lite website download page.

  2. Install the VSIX.

  3. In Visual Studio’s Solution Explorer, right-click on your project (1) and select Add (2) -> Reference… (3)

  4. Under Universal Windows (1) -> Extensions (2), select SQLite for Universal App Platform and click OK (4) to finish.


I'm getting an error of the form "Unhandled exception at 0x7730F72B (ntdll.dll) in myApp.exe: 0xC00000FD: Stack overflow (parameters: 0x00000001, 0x00402FF4)". What should I do?

When trying to run an app, you might get the error below:

This is because your app is written in Swift, and the Windows bridge for IOS only supports Objective-C.


I’m getting “Unsupported 16-Bit Application” error when running vsimporter or “error MSB3073: The command ""C:\WinObjC-master\WinObjC-master\msvc..\bin\hmapmaker.exe" "Debug\HelloUI.txt" "Debug\HelloUI-project.hmap"" exited with code 216” when building a solution. What should I do?

When running vsimporter or trying to build your Visual Studio solution, you might get the errors below:

This is because you downloaded the source code of the Windows Bridge for IOS SDK as opposed to the prebuilt SDK, and you’re trying to use the SDK before building it.

If you only want to use the prebuilt SDK, download the latest prebuilt release .zip package from the releases page.

If you want to build the SDK from source, follow the steps on the Building From Source wiki page.


I'm getting error "The item metadata "%(FullPath)" cannot be applied to the path "Assets\Square44x44Logo.targetsize-24_altform-unplated.png"." when trying to load my project in Visual Studio and warning "[W] Failed to open C:\MyAppPath\MyApp.vsimporter\MyApp-WinStore10\Assets\Square44x44Logo.targetsize-24_altform-unplated.png for writing." in vsimporter. What should I do?

The error and warning above are because the path of your app is too long for Windows to properly handle. To fix this, simply move your app project folder to a shorter location and re-import your project with vsimporter.

Clone this wiki locally