4

I am creating a Tizen.NET wearable app using Tizen.NET 4.0 in Visual Studio 2019. During debugging, when attempting to use a function that uses Samsung SAP, the app crashes with 'Frame not in module' error in Visual Studio - which doesn't really explain much. There's no further exception information.

I've tried the advice elsewhere around ticking Common Runtime Exceptions settings in Visual Studio, but it makes no difference. Reviewing the log for the device, I can however see the below error. This could be the problem but I'm not sure how to solve it? (I'm deploying my app to a real watch, not an emulator if that makes a difference).

12-25 15:13:34.369 : Info / DOTNET_LAUNCHER ( 4670 : 4677 ) : monitor dir /opt/usr/home/owner/share/.elementary/config/wearable
12-25 15:13:48.879 : Info / DOTNET_LAUNCHER ( 4670 : 4677 ) : Unhandled Exception: 
12-25 15:13:49.419 : Info / DOTNET_LAUNCHER ( 4670 : 4677 ) : System.IO.FileNotFoundException: Could not load file or assembly 'Samsung.Sap, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
12-25 15:13:49.419 : Info / DOTNET_LAUNCHER ( 4670 : 4677 ) : eApp1.Program.Main(String[] args) in C:\Users\james\source\repos\TizenWearableApp1\TizenWearableApp1.cs:line 21

EDIT: I've even tried manually copying samsung.sap.dll into C:\Users\james\source\repos\TizenWearableApp1\bin\Debug\tizen40\tpkroot\bin before deploying to the watch to test.

EDIT AGAIN: It would seem I'm not the only one with this issue? - https://forum.developer.samsung.com/t/add-samsung-sap-dll-to-project/8020

JamesMatson
  • 2,522
  • 2
  • 37
  • 86
  • The error message says ". The system cannot find the file specified.". Fix the obvious error first before trying to fix the harder to fix errors. – jdweng Dec 29 '20 at 13:36
  • Thanks for that insight, but that's what I'm asking for help with - that error. I have shown clear attempts to resolve that error without success. – JamesMatson Dec 30 '20 at 06:24
  • The Net library can only load a managed dll as a reference. The samsung.sap.dll is probably a c++ dll and you need to use ImportDll to run the code. – jdweng Dec 30 '20 at 10:42
  • Is that based on anything or just a thought? I haven't seen any documentation around this. Official documentation just says to just use nuget to download / add the package samsung.sap. Which it does, successfully. This error occurs when trying to run the app and use a section of the code that referes to the samsung sap library. – JamesMatson Dec 30 '20 at 11:56
  • The error says "Could not load file" which means on of two things 1) File is not found but you said it was placed in correct location 2) The file did not load. So I'm assuming it did not load. Loading means it was loaded at runtime (not compiled). You did not say in the posting you were using nuget. I think you may have an issue with the xml file which is used during loading. See : https://docs.tizen.org/application/dotnet/get-started/wearable/first-app/ – jdweng Dec 30 '20 at 12:10
  • Samsung.Sap.dll should exist in tpkroot/bin after building a TPK. If it doesn't, obviously something is going wrong (maybe an issue with Tizen SDK). Note that placing the dll manually into the location doesn't do anything. Could you try copying the dll into the app project's lib directory (create if none) and build the TPK again? – Swift Kim Dec 30 '20 at 15:28

1 Answers1

0

Do make sure that the necessary Samsung.Sap NuGet Package, and extensions are installed on your Visual Studio 2019 project and add the required privileges in your manifest file.

Also do Add the Accessory Service Profile and privileges accordingly.

To reduce complexity you can try integrating SAP on a blank project, like this one before moving on to your existing project.

Most importantly do make sure that your SDK software and other dependencies are all up-to-date.

Ridwan
  • 367
  • 3
  • 11