After making changes to the IPA, you need to resign it with a valid signature. You can do this using ldid:
insert_dylib @executable_path/FridaGadget.dylib Payload/App.app/AppBinary Inject Dylib Into Ipa
Manually add the dylib to the .app directory. You might need to use tools like otool and install_name_tool to update the library paths within the executable and the dylib itself. After making changes to the IPA, you need
cd SampleApp.app file SampleApp