If you have used Sharegate to migrate from an on-premise install of SharePoint to SharePoint Online (through O365) and are receiving a 404 error when trying to render SmartForms in realtime, it is likely that the migration changed the naming conventions of certain K2 resources that are crucial to the operability of Appit within your SharePoint Online environment. Sharegate has a feature that will rename an existing folder, appending a value to the end (e.g. renaming 'K2Pages' folder to 'K2Pages1') and create a new folder with the same name.
To resolve this issue, the K2Pages folder must be renamed back to the correct value. This can be achieved easily through SharePoint Designer (a free download from Microsoft) by following these steps:
1. Navigate to any list on the site collection/subsite and open the LIST ribbon.
2. Select 'Edit List' in the 'Customize List' section of the ribbon (This will open up SharePoint Designer. You must have SharePoint Designer installed for this to work.)
3. In SharePoint Designer, click 'All Files' on the left-hand navigation panel.
4. In the list that comes up, look for a K2Pages1 (or similarily named) folder. Click on the folder and verify that it has the correct K2 resources (depending on the version of Appit you are using, you should see files like s New/Edit/Display]]Form.aspx, as well as some .js files).
5. Move back up one level (or click on All Pages again on the left-hand navigation panel).
6. If a K2Pages folder exists, verify that it is empty, then delete the folder.
7. Rename the folder containing the correct resource files to 'K2Pages'
This should allow SmartForms to render correctly now on your SharePoint site.
If after trying the method above you are still having difficulties, please log a support ticket and reference this community article in the description of the ticket, and a support engineer will work with you to resolve the issue.