addEventListener not working in phonegap build app?

I have convert a version 1 app to the version 2 and now I tried to build it with phone gap build and it is not running the addEventListeners! Im building with cli-7.0.1 as I did before with v1.

I have a onbodyload funktion that runs when it loads the index file. And that works.

And it runs the “deviceready” listener or atleast it shows the first alert.

function onBodyLoad(){

document.addEventListener(“deviceready”, function(){
app.dialog.alert(“deviceready in index file”)//it is showing this alert…

//navigator.splashscreen.hide(); this worked before but not now…?

document.addEventListener("resume", onResume, false);


function onResume(){

app.dialog.alert(“inside onresume functionen in index file”)//this is not working…
onresumefunktionen();//it is not running this function…

Any input really appreciated, thanks.