The Galaxy J2 Prime is a 7 year old phone, which is probably why it's having this kind of problem. It may be that the Game Optimizing Service is too out of date to operate correctly, or that the phone's OS version is too out of date for the service to work correctly.
Try wiping the cache partition in Recovery Mode, which won't affect personal data:
https://www.hardreset.info/devices/samsung/samsung-galaxy-j2-prime/recovery-mode/. If that doesn't help, then you'll either have to live with this persistent error message, or look into upgrading to a more current phone.