Application Error : Unfortunatley game has stopped!

Corona SDK : 2016.2860

Platform : Android

Game is crashing on start!!!

Saw the logs and found this,

04-20 15:32:00.412 23900 23900 E AndroidRuntime FATAL EXCEPTION: main 04-20 15:32:00.412 23900 23900 E AndroidRuntime java.lang.NoSuchMethodError: android.support.v4.content.ContextCompat.checkSelfPermission 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.m2.common.util.DeviceUtils.isPermissionGranted(DeviceUtils.java:257) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.m2.mraid.MraidNativeCommandHandler.isStorePictureSupported(MraidNativeCommandHandler.java:143) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.m2.mobileads.AdViewController.\<init\>(AdViewController.java:101) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.m2.mobileads.factories.AdViewControllerFactory.internalCreate(AdViewControllerFactory.java:21) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.m2.mobileads.factories.AdViewControllerFactory.create(AdViewControllerFactory.java:17) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.m2.mobileads.MoPubView.\<init\>(MoPubView.java:74) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.m2.mobileads.MoPubView.\<init\>(MoPubView.java:48) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.m2.mobileads.MoPubInterstitial$MoPubInterstitialView.\<init\>(MoPubInterstitial.java:222) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.m2.mobileads.MoPubInterstitial.\<init\>(MoPubInterstitial.java:50) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.ads.adapters.MopubAdAdapter$InterstitialFactory.createInterstitial(MopubAdAdapter.java:262) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.ads.adapters.MopubAdAdapter.setPortraitAdUnitId(MopubAdAdapter.java:115) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.ads.adapters.MopubAdAdapter.onSettingsUpdated(MopubAdAdapter.java:63) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.ads.AdManager.updateSettings(AdManager.java:130) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.fuseapi.FuseAPI.updateAdManagerSettings(FuseAPI.java:1431) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.fuseapi.FuseAPI.adConfigReceived(FuseAPI.java:1566) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.fusepowered.util.XMLParser$1.run(XMLParser.java:80) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at android.os.Handler.handleCallback(Handler.java:725) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at android.os.Handler.dispatchMessage(Handler.java:92) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at android.os.Looper.loop(Looper.java:153) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at android.app.ActivityThread.main(ActivityThread.java:5336) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at java.lang.reflect.Method.invokeNative(Native Method) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at java.lang.reflect.Method.invoke(Method.java:511) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) 04-20 15:32:00.412 23900 23900 E AndroidRuntime at dalvik.system.NativeStart.main(Native Method)

When I rebuild the game it  is working fine i.e only for some builds, this error is coming.

Help!

We’re looking into the issue.

Hi madan,

Can you post the build.settings file for this project?

A potential cause for this issue is that your project is including multiple plugins that use the “android.support.v4” library, and an older version of said library is being built into your project.

Hi Ajay,

Apologies for the delay.

Following are the plugins used,

plugins = { --social ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs", }, ["plugin.facebook.v4"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true }, }, ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, ["plugin.gamecircle"] = { publisherId = "COM\_INNOVATIVELEISURE",supportedPlatforms = { ["android-kindle"] = true }, }, ["plugin.gameanalytics"] = { publisherId = "com.gameanalytics", }, ["CoronaProvider.analytics.flurry"] = { publisherId = "com.coronalabs", }, ["plugin.amazon.iap"] = { publisherId = "com.amazon", supportedPlatforms = { ["android-kindle"] = true }, }, ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, ["plugin.fuse"] = { publisherId = "com.coronalabs" }, ["plugin.fuse.ads"] = { publisherId = "com.coronalabs" }, ["plugin.coronaAds"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, ["plugin.applovin"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, appletvos=true } }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true,iphone=true, ["android-kindle"]=true,} }, ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", supportedPlatforms = { android = true , iphone=true, ["iphone-sim"]=true, }, }, ["CoronaProvider.ads.iads"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, ["plugin.chartboost"] = { publisherId = "com.swipeware", }, ["plugin.adbuddiz"] = { publisherId = "com.adbuddiz" }, ["plugin.openssl"] = { publisherId = "com.coronalabs", }, ["plugin.photon"] = { publisherId = "com.exitgames", }, ["plugin.notifications"] = { publisherId = "com.coronalabs" }, },

Hi madan,

No worries. Looking at your build.settings, try swapping the order of the Facebook-v4 plugin and the Fuse plugin.

The “android.support.v4” library in the Fuse plugin was updated to include the method that you’re getting an exception on,

android.support.v4.content.ContextCompat.checkSelfPermission()

Facebook-v4 also uses the “android.support.v4” library, but it may be an older version. Specifying the Fuse plugin before the Facebook-v4 plugin should result in the newer version of “android.support.v4” to be included in your project.

I did the change and still the problem persists.

plugins = { ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs", }, ["plugin.fuse"] = { publisherId = "com.coronalabs" }, ["plugin.fuse.ads"] = { publisherId = "com.coronalabs" }, ["plugin.facebook.v4"] ={ publisherId = "com.coronalabs" }, .................. .................. .................. }

P.S : That exception thing only occurs for some random builds [i.e some builds work fine and some will have this exception].

We’re looking into the issue.

Hi madan,

Can you post the build.settings file for this project?

A potential cause for this issue is that your project is including multiple plugins that use the “android.support.v4” library, and an older version of said library is being built into your project.

Hi Ajay,

Apologies for the delay.

Following are the plugins used,

plugins = { --social ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs", }, ["plugin.facebook.v4"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true }, }, ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, ["plugin.gamecircle"] = { publisherId = "COM\_INNOVATIVELEISURE",supportedPlatforms = { ["android-kindle"] = true }, }, ["plugin.gameanalytics"] = { publisherId = "com.gameanalytics", }, ["CoronaProvider.analytics.flurry"] = { publisherId = "com.coronalabs", }, ["plugin.amazon.iap"] = { publisherId = "com.amazon", supportedPlatforms = { ["android-kindle"] = true }, }, ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, ["plugin.fuse"] = { publisherId = "com.coronalabs" }, ["plugin.fuse.ads"] = { publisherId = "com.coronalabs" }, ["plugin.coronaAds"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, ["plugin.applovin"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, appletvos=true } }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true,iphone=true, ["android-kindle"]=true,} }, ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", supportedPlatforms = { android = true , iphone=true, ["iphone-sim"]=true, }, }, ["CoronaProvider.ads.iads"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, ["plugin.chartboost"] = { publisherId = "com.swipeware", }, ["plugin.adbuddiz"] = { publisherId = "com.adbuddiz" }, ["plugin.openssl"] = { publisherId = "com.coronalabs", }, ["plugin.photon"] = { publisherId = "com.exitgames", }, ["plugin.notifications"] = { publisherId = "com.coronalabs" }, },

Hi madan,

No worries. Looking at your build.settings, try swapping the order of the Facebook-v4 plugin and the Fuse plugin.

The “android.support.v4” library in the Fuse plugin was updated to include the method that you’re getting an exception on,

android.support.v4.content.ContextCompat.checkSelfPermission()

Facebook-v4 also uses the “android.support.v4” library, but it may be an older version. Specifying the Fuse plugin before the Facebook-v4 plugin should result in the newer version of “android.support.v4” to be included in your project.

I did the change and still the problem persists.

plugins = { ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs", }, ["plugin.fuse"] = { publisherId = "com.coronalabs" }, ["plugin.fuse.ads"] = { publisherId = "com.coronalabs" }, ["plugin.facebook.v4"] ={ publisherId = "com.coronalabs" }, .................. .................. .................. }

P.S : That exception thing only occurs for some random builds [i.e some builds work fine and some will have this exception].