Symptoms
Cannot create K2 process package using K2 Studio/Visual Studio with Create Reference/For Each functionality.
Diagnoses
You may run into situation when you are unable to create packages for any process that uses the new Create Reference/For Each functionality when the process is created using K2 Studio or Visual Studio receiving the following error message during package creation:
'xxx' Process is referencing the return type '{kdselectedmethodtype}' of the 'yyy' method on the 'zzz' SmartObject that could not be found.
At the same time, when the process is created using the K2 Designer in SharePoint then the package can be created successfully.
Steps to reproduce this issue:
1) Create a new list and create a smartObject for the list
2) Create a new library and create a smartObject for the library
3) Create a new K2 Studio process for the test list and create a for each loop for the library items.
4) Deploy the process and then try to create a package using the K2 Package and Deployment.
The error occurs for any smartObject and not only for library smartObjects.
This is known issue in K2 4.6.11 with coldfix available upon request from K2 support (internal ID 592365).
Resolution
This is has been confirmed as a bug by our labs team. coldfix can be requested from support.