App crashes when opened after installation on android phone, post Corona Ads plugin integration

Hi There

i have added corona ads plugin along with google analytics and social plugin. As soon as i have added the corona ads plugin, my successfully build app through corona simulator, crashes every single time i try to open it after a successful installation. 

error snapshot of the crash attached.

Build settings below: 

please note, i have read numerous answers on corona forum of guys facing the same issue and have even commented out the supported platform values as per some suggestions. the issue remains the same.

------------------------------------start-----------------------------------

settings =

{

orientation =

{

– Supported values for orientation:

        – portrait, portraitUpsideDown, landscapeLeft, landscapeRight

default =“portrait”,

supported = {“portrait”},

},

plugins =

    {

[“plugin.coronaAds”] =

 {

publisherId = “com.coronalabs”,

– supportedPlatforms = { android=true }

 },

[“plugin.google.play.services”] =

{

publisherId = “com.coronalabs”,

– supportedPlatforms = { android=true }

},

[“shared.android.support.v4”] =

{

publisherId = “com.coronalabs”,

– supportedPlatforms = { android=true }

},

[“plugin.googleAnalytics”] =

{

publisherId = “com.coronalabs”,

– supportedPlatforms = { iphone=true, android=true, }

},

[“CoronaProvider.native.popup.social”] =

{

publisherId = “com.coronalabs”

},

    },

}

------------------------------------end----------------------------------

You need to post your code where you’re initializing Corona Ads, include the listener function and the code where you’re trying to show the ads.

Also you can put some print statements in your listener function and print out the values you’re getting back from the calls:

local json = require( "json" ) local function coronaAdsListener( event ) -- assuming this is what you named your listener function      print( json.prettify( event ) )      -- rest of your function end

then look in your device’s console log to see what’s going on. There will also likely be additional information there as well.

If you need help with looking at your device’s console log, please see: https://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

Hi Rob

thanks for the reply, my code for main.lua. will review the logs and update as well… 

-----------------------------------------start ------------------------------------------------

– req and initialize google analytic

local ga = require(“plugin.googleAnalytics”)

ga.init( “Ready Steady Squeeze”, “UA-86396024-1” )

–end ga

–init and start physics

local physics = require( “physics” )

physics.start()

physics.setGravity( 0, 0 )

–end physics

– req corona ads

local coronaAds = require( “plugin.coronaAds” )

local interstitialPlacement = “corona-int”

– end corona ads

–load sounds

local readySound = audio.loadSound(“ready.wav”)

local playSound = audio.loadSound(“alert.wav”)

–end sounds

– Initialize variables

local playerOne

local playerComputer

local playerTwo

– Set up display groups

local backGroup = display.newGroup()  – Display group for the background image

local mainGroup = display.newGroup()  – Display group for game play elements

local uiGroup = display.newGroup()    – Display group for UI objects like the score

– Hide the status bar

display.setStatusBar( display.HiddenStatusBar )

– Load the background

local background = display.newImageRect( backGroup, “background.png”, 800, 1400 )

background.x = display.contentCenterX

background.y = display.contentCenterY

– laod the transparent layer

local transparentLayer = display.newImageRect( mainGroup,“transparent.png”, 800, 1400 )

transparentLayer.x = display.contentCenterX

transparentLayer.y = display.contentCenterY

transparentLayer.isActive = false

transparentLayer.isVisible = false

– load the start btn

local startBtn = display.newImageRect(mainGroup, “start.png”, 800, 100)

startBtn.x = display.contentCenterX

startBtn.y = display.contentCenterY

– load the retry button

local retryBtn = display.newImageRect(mainGroup,“retry.png”, 800, 100)

retryBtn.x = display.contentCenterX

retryBtn.y = display.contentCenterY

retryBtn.isActive = false

retryBtn.isVisible = false

– Display lives and score

playerOneText = display.newText( uiGroup, “Player One Wins!!”, display.contentCenterX, display.contentHeight - 50, native.systemFont, 56 )

playerTwoText = display.newText( uiGroup, “Player Two Wins!!”, display.contentCenterX, 50, native.systemFont, 56 )

playerTwoText:rotate(180)

playerOneText:setTextColor(0,0,128)

playerTwoText:setTextColor(0,0,128)

playerOneText.isVisible = false

playerTwoText.isVisible = false

– Corona Ads listener function

local function adListener( event )

    – Successful initialization of Corona Ads

    if ( event.phase == “init” ) then

        – Show an ad

        --coronaAds.show( bannerPlacement, false )

        print(“corona ads initialized”)

        coronaAds.show( interstitialPlacement, true )

    end

end

– custom sound functions

local function playMainSound()

transparentLayer.isVisible = true

transparentLayer.isActive = true

audio.play( playSound, { duration=2000})

end

local function playMainSoudCheck()

print(“in play main sound random check”)

local randomTime = math.random(100,3000)

print(randomTime)

timer.performWithDelay(randomTime, playMainSound)

end

local function playReadySound()

  audio.play( readySound, { duration=3000, onComplete=playMainSoudCheck} )

  transparentLayer.isActive = true

end

– end sound functions

– event function for start button

local function startGame()

  transparentLayer.isActive = false

  playerOneText.isVisible = false

  playerTwoText.isVisible = false

startBtn.isVisible = false

print(“start button touched”)

ga.logEvent( “userAction”, “start”, “Start Button” )

timer.performWithDelay( 2000, playReadySound)

end

– end start button function

– event function for retry button

local function retryGame()

  – log a ga event

  ga.logEvent( “userAction”, “Retry”, “Retry Button” )

  – calling corona ad listener function when user retry to play again

  coronaAds.init( “0353baa6-25e4-42cc-8ae4-0f408983b8de”, adListener )

  – display hide buttons

  startBtn.isVisible = true

  startBtn.isActive = true

  retryBtn.isVisible = false

  retryBtn.isActive = false

  playerOneText.isVisible = false

  playerTwoText.isVisible = false

  transparentLayer.isActive = false

  transparentLayer.isVisible = false

– social plugin

–native.showPopup( “social”,

 --{

  –   service = “twitter”,

  –   message = “Hi there!”,

  –   url = "http://www.coronalabs.com",

 --})

end

– end retry button function

– calculate result

local function checkResult(event)

  local touchValue = 0

  if ( event.phase ==“began”) then

  if (event.y > display.contentCenterY) then

   print(" player 1 wins")

   transparentLayer.isActive = false

   playerOneText.isVisible = true

   retryBtn.isVisible = true

   retryBtn.isActive = true

 elseif (event.y < display.contentCenterY) then

   print(" player 2 wins")

   transparentLayer.isActive = false

   playerTwoText.isVisible = true

   retryBtn.isVisible = true

   retryBtn.isActive = true

end

elseif ( “ended” == phase or “cancelled” == phase ) then

      print(“transparent layer touched and ended”)

end

end

– end calculate result

– start, retry and touch event listeners

startBtn:addEventListener( “tap”, startGame)

retryBtn:addEventListener(“tap”, retryGame)

transparentLayer:addEventListener(“touch”, checkResult)

------------------------------------------- end ----------------------------------------------

You need to look at your console log and see what errors you’re getting. Please see:

https://docs.coronalabs.com/guide/basics/debugging/index.html

If you need help with that.

Rob

Hi Rob

i have Installed at least the Android SDK Tools and Android SDK Platform-tools. My Device is also connected but when i write adb logcat  in command prompt it gives me following error… 

‘adb is not recognized as internal or external command’ 

in which dir should i run this command on cmd-prompt.

please help…

You will have to find out where they got installed. Maybe google: “where does adb get installed on Windows” (or macOS).

You will have to run adb from that location or have that folder added to your PATH system environment variable so you can just type adb.

Rob

I have managed to run the adb logcat corona command with my device connected. As soon as i run my app, it crashes and i see the following message which i figured out. 

com. danish.muhammad.GameReady has died…
Calling a process in system process without a qualified user

please help Rob!

Hi Rob 

Success!! Corona Ads plugin is integrated and Interstitial Ad is showing up! 

Was making a mistake with my bundle ID while building an apk, it was incorrect to the bundle ID mentioned in Ads Dashboard App settings. 

Thanks 

D

Great! I didn’t see much from that error message. There was likely messages higher up in the log that might have been useful.

Rob

You need to post your code where you’re initializing Corona Ads, include the listener function and the code where you’re trying to show the ads.

Also you can put some print statements in your listener function and print out the values you’re getting back from the calls:

local json = require( "json" ) local function coronaAdsListener( event ) -- assuming this is what you named your listener function &nbsp; &nbsp; &nbsp;print( json.prettify( event ) ) &nbsp; &nbsp; &nbsp;-- rest of your function end

then look in your device’s console log to see what’s going on. There will also likely be additional information there as well.

If you need help with looking at your device’s console log, please see: https://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

Hi Rob

thanks for the reply, my code for main.lua. will review the logs and update as well… 

-----------------------------------------start ------------------------------------------------

– req and initialize google analytic

local ga = require(“plugin.googleAnalytics”)

ga.init( “Ready Steady Squeeze”, “UA-86396024-1” )

–end ga

–init and start physics

local physics = require( “physics” )

physics.start()

physics.setGravity( 0, 0 )

–end physics

– req corona ads

local coronaAds = require( “plugin.coronaAds” )

local interstitialPlacement = “corona-int”

– end corona ads

–load sounds

local readySound = audio.loadSound(“ready.wav”)

local playSound = audio.loadSound(“alert.wav”)

–end sounds

– Initialize variables

local playerOne

local playerComputer

local playerTwo

– Set up display groups

local backGroup = display.newGroup()  – Display group for the background image

local mainGroup = display.newGroup()  – Display group for game play elements

local uiGroup = display.newGroup()    – Display group for UI objects like the score

– Hide the status bar

display.setStatusBar( display.HiddenStatusBar )

– Load the background

local background = display.newImageRect( backGroup, “background.png”, 800, 1400 )

background.x = display.contentCenterX

background.y = display.contentCenterY

– laod the transparent layer

local transparentLayer = display.newImageRect( mainGroup,“transparent.png”, 800, 1400 )

transparentLayer.x = display.contentCenterX

transparentLayer.y = display.contentCenterY

transparentLayer.isActive = false

transparentLayer.isVisible = false

– load the start btn

local startBtn = display.newImageRect(mainGroup, “start.png”, 800, 100)

startBtn.x = display.contentCenterX

startBtn.y = display.contentCenterY

– load the retry button

local retryBtn = display.newImageRect(mainGroup,“retry.png”, 800, 100)

retryBtn.x = display.contentCenterX

retryBtn.y = display.contentCenterY

retryBtn.isActive = false

retryBtn.isVisible = false

– Display lives and score

playerOneText = display.newText( uiGroup, “Player One Wins!!”, display.contentCenterX, display.contentHeight - 50, native.systemFont, 56 )

playerTwoText = display.newText( uiGroup, “Player Two Wins!!”, display.contentCenterX, 50, native.systemFont, 56 )

playerTwoText:rotate(180)

playerOneText:setTextColor(0,0,128)

playerTwoText:setTextColor(0,0,128)

playerOneText.isVisible = false

playerTwoText.isVisible = false

– Corona Ads listener function

local function adListener( event )

    – Successful initialization of Corona Ads

    if ( event.phase == “init” ) then

        – Show an ad

        --coronaAds.show( bannerPlacement, false )

        print(“corona ads initialized”)

        coronaAds.show( interstitialPlacement, true )

    end

end

– custom sound functions

local function playMainSound()

transparentLayer.isVisible = true

transparentLayer.isActive = true

audio.play( playSound, { duration=2000})

end

local function playMainSoudCheck()

print(“in play main sound random check”)

local randomTime = math.random(100,3000)

print(randomTime)

timer.performWithDelay(randomTime, playMainSound)

end

local function playReadySound()

  audio.play( readySound, { duration=3000, onComplete=playMainSoudCheck} )

  transparentLayer.isActive = true

end

– end sound functions

– event function for start button

local function startGame()

  transparentLayer.isActive = false

  playerOneText.isVisible = false

  playerTwoText.isVisible = false

startBtn.isVisible = false

print(“start button touched”)

ga.logEvent( “userAction”, “start”, “Start Button” )

timer.performWithDelay( 2000, playReadySound)

end

– end start button function

– event function for retry button

local function retryGame()

  – log a ga event

  ga.logEvent( “userAction”, “Retry”, “Retry Button” )

  – calling corona ad listener function when user retry to play again

  coronaAds.init( “0353baa6-25e4-42cc-8ae4-0f408983b8de”, adListener )

  – display hide buttons

  startBtn.isVisible = true

  startBtn.isActive = true

  retryBtn.isVisible = false

  retryBtn.isActive = false

  playerOneText.isVisible = false

  playerTwoText.isVisible = false

  transparentLayer.isActive = false

  transparentLayer.isVisible = false

– social plugin

–native.showPopup( “social”,

 --{

  –   service = “twitter”,

  –   message = “Hi there!”,

  –   url = "http://www.coronalabs.com",

 --})

end

– end retry button function

– calculate result

local function checkResult(event)

  local touchValue = 0

  if ( event.phase ==“began”) then

  if (event.y > display.contentCenterY) then

   print(" player 1 wins")

   transparentLayer.isActive = false

   playerOneText.isVisible = true

   retryBtn.isVisible = true

   retryBtn.isActive = true

 elseif (event.y < display.contentCenterY) then

   print(" player 2 wins")

   transparentLayer.isActive = false

   playerTwoText.isVisible = true

   retryBtn.isVisible = true

   retryBtn.isActive = true

end

elseif ( “ended” == phase or “cancelled” == phase ) then

      print(“transparent layer touched and ended”)

end

end

– end calculate result

– start, retry and touch event listeners

startBtn:addEventListener( “tap”, startGame)

retryBtn:addEventListener(“tap”, retryGame)

transparentLayer:addEventListener(“touch”, checkResult)

------------------------------------------- end ----------------------------------------------

You need to look at your console log and see what errors you’re getting. Please see:

https://docs.coronalabs.com/guide/basics/debugging/index.html

If you need help with that.

Rob

Hi Rob

i have Installed at least the Android SDK Tools and Android SDK Platform-tools. My Device is also connected but when i write adb logcat  in command prompt it gives me following error… 

‘adb is not recognized as internal or external command’ 

in which dir should i run this command on cmd-prompt.

please help…

You will have to find out where they got installed. Maybe google: “where does adb get installed on Windows” (or macOS).

You will have to run adb from that location or have that folder added to your PATH system environment variable so you can just type adb.

Rob

I have managed to run the adb logcat corona command with my device connected. As soon as i run my app, it crashes and i see the following message which i figured out. 

com. danish.muhammad.GameReady has died…
Calling a process in system process without a qualified user

please help Rob!

Hi Rob 

Success!! Corona Ads plugin is integrated and Interstitial Ad is showing up! 

Was making a mistake with my bundle ID while building an apk, it was incorrect to the bundle ID mentioned in Ads Dashboard App settings. 

Thanks 

D

Great! I didn’t see much from that error message. There was likely messages higher up in the log that might have been useful.

Rob