When I remove the ‘Microsoft office 365’ package entirely from my library project I am able to publish without any errors. So the cause of the problem is related to this package. But I need certain activities from the package inside my library so removing the package permanently is no solution.