Not sure if you quoted the right post there, as we are having the ANR problems not finding any fixes. But below is our build.settings
settings = { plugins = { ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, --for vungle below ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", }, }, orientation = { default = "landscapeRight", supported = {"landscapeLeft", "landscapeRight"} }, iphone = { xcassets = "Images.xcassets", plist = { UIPrerenderedIcon = true, UIStatusBarHidden = true, UIApplicationExitsOnSuspend = false, UILaunchStoryboardName = "LaunchScreen", CFBundleDisplayName = "WOTZ" }, }, android = { largeHeap = true, usesExpansionFile = true, versionCode = "464", usesPermissions = { "android.permission.INTERNET", "android.permission.WRITE\_EXTERNAL\_STORAGE", "com.android.vending.CHECK\_LICENSE" }, } }
And this is the code in the main.lua calling for the permissions.
-------------------------------------------------------- -- CHECK STORAGE PERMISSION IS GRANTED -------------------------------------------------------- local function isStoragePermissionGranted( grantedAppPermissionsTable ) if grantedAppPermissionsTable then for k,v in pairs( grantedAppPermissionsTable ) do if ( v == "Storage" ) then print( "\*\* Storage permission granted! \*\*" ) return true end end end return false end local function appPermissionsListener( event ) if ( isStoragePermissionGranted( event.grantedAppPermissions ) ) then -- Do stuff requiring storage permission print("\* Storage Permission granted \*") debugLog.text=debugLog.text.."\n STORAGE PERMISSION GRANTED" else -- Handle not having storage permission print("\* Storage Permission NOT granted \*") debugLog.text=debugLog.text.."\n STORAGE PERMISSION NOT GRANTED" end end if ( not isStoragePermissionGranted( system.getInfo( "grantedAppPermissions" ) ) ) then if ( native.canShowPopup( "requestAppPermission" ) ) then -- Request Storage Permission. local options = { appPermission = "Storage", urgency = "Critical", listener = appPermissionsListener, rationaleTitle = "Storage access required", rationaleDescription = "Storage access is required to store your career data. Re-request now?", settingsRedirectTitle = "Alert", settingsRedirectDescription = "Without the ability to store data, this app cannot properly function. Please grant storage access within Settings." } native.showPopup( "requestAppPermission", options ) else -- You need to add a permission in the Storage group to your build.settings. print("\* requestAppPermission NOT compatible, Storage Permission NOT granted \*") end end
Whether the permissions request is one of the causes of ANRs I am not sure as we don’t actually have a device with android 7.0 or newer, we only got this info from one of our core beta testers in Europe.
We are using Build: 2018.3224, and the same build.settings for both android and ios.
**Apologies, CORRECTION to the build number, for our last android build we used 2018.3222 NOT 2018.3224.**
We use 2018.3224 for our mac osx builds which run fine.