Try moving your inline script to the body or add the "defer" attribute so that it waits until everything else has finished loading. You might also try moving your script to a separate .js file (like index.js).
Also, have you tried debugging the app using either Chrome (Android)? There might be some error messages appearing in the console that might be of use. Also check "adb logcat" to see if your device is logging messages that might be of use.
I moved it to the body, it didn't change anything.
Debugging was the right choice though: the console says "Uncaught ReferenceError: device is not defined".
When I take a look into the plugins folder, there is no folder for cordova-plugin-device. However, when I download the APK and open it with 7-Zip, it's there (SampleApp-debug.apk\assets\www\plugins\cordova-plugin-device\www\device.js).
I kinda solved the problem. Well, I didn't really solve it, but it's not occurring anymore.
I deleted the app on https://build.phonegap.com/apps and reuploaded it. I don't know what did the trick, but now it's working fine!
Thanks a lot for your help - remote debugging using Chrome is awesome!