If you run your code with your device connected to the device does it work?

Are you installing all your dependencies on the device.

There are loads of hints and pointers to articles on deployment if you search these forums.