How to package a hybrid app with a web widget

I have written a hyprid app for Tizen 4.0 consisting of a native service app and a web app for the UI. In Tizen studio they are packaged together via Properties > Tizen Studio > Package > Multi. The package can be installed without problems on two versions of Galaxy Watch Active 2.

Now, I wanted to write a web widget for my application. Similar to the above procedure for integrating the native into the web app, one can also package the widget with the other apps. So far no problems occured and I can create a signed build without any issues. However, when I try to install it (on one of the watches or on the emulator) I get

...

start process (install)
.......................
error : -9

end process (fail)
processing result : Icon error [-9] failed
spend time for pkgcmd is [767]ms
cmd_ret:247
    An exception occurred
(Installing the package... > Fail)
An exception occurred
Unexpected stop progress...
(68.555 sec)

Does anyone have an idea what goes wrong here?

What I have tried so far is:

  • Created new (and empty) web, native service, and widget app. Packaging them together yields the same error message.
  • Without the native service app one can deploy the app without problems.

ok, I think I have a clue as to where the error comes from. I looked at the logs of my watch during the install-process and saw the following warning pop up:

... file_util.cc:290 : copy file "/opt/usr/globalapps/SZJLMFGQvJ/res/wgt/widget/WidgetApp/preview.png" due to error [system:2]

However, when looking at the folder structure of the .wgt-package file we see that this picture is located under
res/wgt/res/wgt/widget/WidgetApp/preview.png.

I do not know how the .wgt-folder structure is changed during install-process, but it seems to me that the watch is searching for the icon in the wrong directory, i.e., Tizen Studio 4.0 is packaging my hybrid app incorrectly.

Could this be the cause of the error? (And does someone have an idea on how I could solve this?)

ok, I just checked again with Tizen Studio 4.1, but the error persists.

Hello, I think you might get better assistance if you submit a support request here.

Thanks for the hint. I sent them an inquiry, the response is still outstanding. I’ll keep this thread updated.

I got the following answer to my support request:

Our development team has checked your issue.
According to the team’s response, from Tizen studio, hybrid app can combine
Tizen Web UI application and one or more Tizen Native Services
or
Tizen Web UI application and Widget applications.
[Reference: https://developer.tizen.org/community/tip-tech/how-package-tizen-hybrid-app]

In order to work with Web UI, Service and Widget combined,
one way is to create a hybrid app with Web UI and Service and keeping the widget app separate.
Communication between the Web UI app and widget app will occur with Message Port.
[Reference: Message Port | Tizen Docs]

Another way is to bind them in visual studio with .NET
[Reference]
https://docs.tizen.org/application/dotnet/tutorials/create-dotnet-hybrid-package/
Create Your First Tizen Wearable .NET Application | Tizen Docs