tuyen-vuduc / dotnet-mapbox-quickstart

Mapbox quick-start and examples for .NET
MIT License
2 stars 1 forks source link

Running project on real iPhone / Xamarin.iOS project deploy to real device error #2

Closed jmielczarkowski closed 5 months ago

jmielczarkowski commented 10 months ago

I am facing strange issue - on Xamarin.iOS project I am able to build iPhone Simulator but on iPhone real device it's failing with error:

Unexpected error - Please fill a bug report at (MT0000).

I check and issue occurs after I am using library. So if there's code that reach library - compilation fails. Only difference in solution between those two configurations

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'QA-Debug|iPhoneSimulator' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\iPhoneSimulator\QA-Debug</OutputPath>
    <DefineConstants>DEBUG;</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <ConsolePause>false</ConsolePause>
    <MtouchArch>x86_64</MtouchArch>
    <MtouchLink>SdkOnly</MtouchLink>
    <MtouchDebug>true</MtouchDebug>
    <CodesignKey>...</CodesignKey>
    <MtouchFastDev>true</MtouchFastDev>
    <OptimizePNGs>false</OptimizePNGs>
    <MtouchExtraArgs>-gcc_flags "-ObjC"</MtouchExtraArgs>
    <CodesignProvision>Automatic</CodesignProvision>
    <CodesignEntitlements>Info.plist</CodesignEntitlements>
  </PropertyGroup>

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'QA-Debug|iPhone' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\iPhone\QA-Debug</OutputPath>
    <DefineConstants>__IOS__;__MOBILE__;__UNIFIED__;DEBUG</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <ConsolePause>false</ConsolePause>
    <MtouchArch>ARM64</MtouchArch>
    <CodesignKey>...</CodesignKey>
    <MtouchDebug>true</MtouchDebug>
    <MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
    <MtouchFastDev>true</MtouchFastDev>
    <MtouchFloat32>true</MtouchFloat32>
    <MtouchExtraArgs>-gcc_flags "-ObjC"</MtouchExtraArgs>
    <MtouchLink>SdkOnly</MtouchLink>
    <CodesignEntitlements>QA-Debug-Entitlements.plist</CodesignEntitlements>
    <MtouchInterpreter>-all</MtouchInterpreter>
    <CodesignProvision>...</CodesignProvision>
  </PropertyGroup>

Since I am not able to run on real device also sample project due 'Optimizing Assemblies for size not supported for the selected publish configurations' I will setup sample project using Xamarin.iOS and library and check if it will deploy on my real iPhone or not.

Issue should not be related to my profiles etc., since only if I am removing library or use of library in code then it compiles and deploy correctly.

Any idea what else I can check meanwhile?

I find out that issue occurs only with those lines of code inside:

var options = MapInitOptionsFactory.CreateWithresourceOptions(resourceOptions, nul, null, styleURI: "", null);

which comes from MapboxMapsObjC, without this code it works / compile and deploy.

tuyen-vuduc commented 10 months ago

Hi @jmielczarkowski ,

This is a known issue. I am still waiting for a Microsoft guy to support here.

There must be an incorrect configuration somewhere.

jmielczarkowski commented 10 months ago

@tuyen-vuduc is there any workaround now? I think other stuff works fine. I've tested versions on simulators and they behave as expected. I keep my fingers crossed that this Microsoft guy will help.

tuyen-vuduc commented 10 months ago

@jmielczarkowski No, I don't find a workaround yet. Still looking around.

sklyarovaleksey commented 10 months ago

also waiting solution for this problem

tuyen-vuduc commented 5 months ago

The latest version of the binding library will fix the issue, please bear with me.

tuyen-vuduc commented 5 months ago

Please try out the latest code then. (NOTE: .NET MAUI sample app not run on .NET 8 yet)