xamarin - UWP - Object reference not set to an instance of an object -


after upgrading microsoft.netcore.universalwindowsplatform cannot compile xamarin app-project in release anymore, internal compiler error: object reference not set instance of object.

i using these nuget packages

acr.userdialogs   5.2.2 exiflib.pcl   1.0.1   (in portable project) microsoft.netcore.universalwindowsplatform   5.2.0 mr.gestures   1.3.4 newtonsoft.json   7.0.1   (in portable project) splat   1.6.2   (in portable project) sqlite.net.core-pcl   3.1.1 sqlite.net-pcl   3.1.1 win2d.uwp   1.18.0   (in portable project) xam.plugins.settings   2.1.0 xamarin.forms   2.3.0.107 xamarin.insights   1.12.3 xlabs.core   2.2.0-pre02 xlabs.forms   2.2.0-pre02 xlabs.ioc   2.2.0-pre02 xlabs.platform   2.2.0-pre02 xlabs.serialization   2.2.0-pre02 

a log can found here.

i hope in here can me.

all platforms set compile .net native tool chain.

update
if build xlabs myself , set compile .net native tool chain unchecked. these errors occurs.

app manifest
error found: app manifest test detected following errors: <project> takes dependency on microsoft .net native runtime package 1.x framework missing framework dependency declaration in manifest.

binary analyzer
error found: binary analyzer test detected following errors: file c:\program files\windowsapps\<project>_1.8.0.0_x64__r1myykanma94r\clrjit.dll has failed appcontainercheck check.

supported apis
error found: supported apis test detected following errors:

api systemfunction036 in advapi32.dll not supported application type. clrjit.dll calls api. api debugbreak in kernel32.dll not supported application type. clrjit.dll calls api. api heapvalidate in kernel32.dll not supported application type. clrjit.dll calls api. api loadlibraryexw in kernel32.dll not supported application type. clrjit.dll calls api. api rtlcapturecontext in kernel32.dll not supported application type. clrjit.dll calls api. api rtlvirtualunwind in kernel32.dll not supported application type. clrjit.dll calls api. api tlsalloc in kernel32.dll not supported application type. clrjit.dll calls api. api tlsfree in kernel32.dll not supported application type. clrjit.dll calls api. api tlsgetvalue in kernel32.dll not supported application type. clrjit.dll calls api. api tlssetvalue in kernel32.dll not supported application type. clrjit.dll calls api. api unhandledexceptionfilter in kernel32.dll not supported application type. clrjit.dll calls api. api virtualalloc in kernel32.dll not supported application type. clrjit.dll calls api. api virtualprotect in kernel32.dll not supported application type. clrjit.dll calls api. api executeassembly in uwphost.dll not supported application type. <project>.exe calls api. api dllgetactivationfactory in uwphost.dll not supported application type. <project>.uwp.exe has export forwards api. 

update 2

i rewrite code, did not use win2d.uwp anymore. somehow have installed microsoft.netcore.universalwindowsplatform v 5.2.0 last friday, latest in nuget v 5.1.0. down these nuget packages

acr.userdialogs   5.3.0 exiflib.pcl   1.0.1   (in portable project) microsoft.netcore.universalwindowsplatform   5.1.0 mr.gestures   1.3.4 newtonsoft.json   7.0.1   (in portable project) splat   1.6.2   (in portable project) sqlite.net.core-pcl   3.1.1 sqlite.net-pcl   3.1.1 xam.plugins.settings   2.1.0 xamarin.forms   2.3.0.107 xamarin.insights   1.12.3 xlabs.core   2.2.0-pre02 xlabs.forms   2.2.0-pre02 xlabs.ioc   2.2.0-pre02 xlabs.platform   2.2.0-pre02 xlabs.serialization   2.2.0-pre02 

and error occurs the assembly windows in file c:\program files\windowsapps\<app-name>_1.8.0.0_x64__r1myykanma94r\windows.winmd has non-empty exported type reference table. every windows runtime assembly must have empty exported type reference table.

update 3
figured out uninstalling win2d.uwp , compiling xlabs myself way go.

i had problem , resolution simple: had reference pcl version newtonsoft.json.dll both in pcls , in uwp project. older portable version (portable40).

after updated latest version of newtonsoft.json.dll (nuget version 9.0.1) compilation exception went away.

keep in mind when updating replaced references newtonsoft libreary i.e. in pcls reference portable version lib\portable-net40+sl5+wp80+win8+wpa81

in startup project reference newtonsoft package (my project.json file contents):

{   "dependencies": {   "microsoft.netcore.universalwindowsplatform": "5.2.2",   "newtonsoft.json": "9.0.1",   "xamarin.forms": "2.3.2.127"   },   "frameworks": {     "uap10.0": {}   },   "runtimes": {     "win10-arm": {},     "win10-arm-aot": {},     "win10-x86": {},     "win10-x86-aot": {},     "win10-x64": {},     "win10-x64-aot": {}   } } 

which uses reference c:\users\<username>\.nuget\packages\newtonsoft.json\9.0.1\lib\portable-net45+wp80+win8+wpa81.

published solution @ xamarin forums quite while ago , people worked them well.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

android - CoordinatorLayout, FAB and container layout conflict -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -