I had the problem where the welcome code I entered in the smarthings app returned an “Invalid Code” an android device I tried to add.
I read a lot of the answers online and saw that Samsung support was not helpful so I decided to add this explanation.
1st - I found the code on the bottom of the smarthings hub inside the battery department.
2nd - If you have already setup your Smartthings on another device all your settings are stored on the Smartthings API website so you should not have to use a welcome code on another device.
3rd - Just make sure that your Samsung App is setup with the right account. It must match the Smarthings API website Login and Password.
Look at your installed apps on your android. You will see the Samsung account. Make sure it is correct.
I have Samsung androids so the Samsung app had my Samsung device login/password instead of my Smartthings login/password.
Hope this helps.