Search code examples
.netarmtizensamsung-gear

How to build Tizen C# .NET Wearable TPK for ARM platform and publish to Samsung Seller Portal?


Background

I am attempting to publish my Tizen Wearable .NET app to the Samsung Seller portal.

I am using Visual Studio 2017, Tizen plugin up-to-date, and can run my app successfully in release mode on both emulator and real device (Gear Sport) using my author and distributor certificates. My app is targeting Tizen 4.0.

The Samsung Seller portal needs the release binary but doesn't give much instruction, so I assume to get this I'm rebuilding the solution in release mode with the certificate profile setup correctly. The result TPK file is in the bin/Release folder.

Inspecting the TPK binary archive I see all my built DLLs, resources, manifest, etc.

The Problem

Once I upload this binary to the Samsung Seller portal and submit it for review, it fails the automated pre-review due to the following error:

[Defect] Application was built by x86 compiler. X86 means app run on Tizen emulator, not real target.

[Expected Result] Please configure Architecture to arm when you build app. Project properties -> C/C++ build -> Tizen settings and you can check architecture of your app filename.

e.g. org.example.app-1.0.0-arm.tpk e.g. org.exapmple.ap-1.0.0-x86.tpk

[Reference] In generally, Platform architecture automatically selected based on the test environment. If test device connected by USB, Tizen IDE selected arm architecture automatically but if emulator connected to sdb, Tizen IDE selected arm architecture automatically.

The instructions here are useless as I'm using Visual Studio and C# .NET, not Tizen Studio or C++.

Attached to the rejection is a file named gear_core_architecture.txt whose contents are simply:

Intel 80386[libSkiaSharp.so]

Is this problematic file? If I inspect the release binary TPK archive I find the libSkiaSharp.so file inside the bin/runtimes/linux-x86/native and bin/runtimes/tizen-armel/native folder. I am not using SkiaSharp in my app at all, but my nuget packages might be (Tizen.NET, Xamarin, etc.). Looking at the Tizen-CSharp samples project, the SkiaSharp project sample also includes these libraries in their TPK as well.


I have looked everywhere in Visual Studio and cannot change the platform type for any solution or project to arm. Right now it only builds for Any CPU, x86, or x64. I've added the C++ compilers for ARM and ARM64 to Visual Studio from the individual components but no change. Manually creating an ARM build configuration won't let me.

TL;DR

How do you build a Tizen Wearable C# .NET app for ARM platform in Visual Studio 2017 for publishing to Samsung Seller Portal?


Solution

  • Asking the same question on the Tizen support forum lead to the following solution, answering here for future reference should anyone else experience this.

    Reference: https://developer.tizen.org/forums/tizen-.net/unable-publish-c-tizen-.net-wearable-tpk-seller-portal


    The linux-x86 folder in the result TPK was tripping the automated rejection system in the Samsung Seller Portal.

    The solution was adding the following line to your property group in the *.csproj file for your Wearable project so tizen-armel is the only one generated.

    <RuntimeIdentifier>tizen-armel</RuntimeIdentifier>
    

    Example:

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>tizen40</TargetFramework>
        <RuntimeIdentifier>tizen-armel</RuntimeIdentifier>
    </PropertyGroup>
    

    As for what was including the libSkiaSharp.so, it was the package Xamarin.FFImageLoading.Svg.Forms.