Getting an error on IOS when trying to build

I’m getting this weird error when I try and run a dev build on IOS

patched_env["TERM"] = os.environ["TERM"]

File “/Users/antoine/Projects/webmynd/banjo-hat.hg.installers/dist/build/pyi.darwin/TriggerToolkit/outPYZ1.pyz/UserDict”, line 23, in getitem
KeyError: ‘TERM’

Not sure what this means also I was using the latests forge build, tried dropping it down from 2.8.04 to 2.8.04 with no luck. I also tried to disable all modules but get the same error message

Sloppy coding on my part I’m afraid :stuck_out_tongue:

I’ve pushed a fix, can you please make sure you’re on "platform_version": "v2.8.4" then do a:

cd <your app's directory>
rm -rf .template .lib
forge build ios

…and try again?

Hi Antoine,

That seemed to let me build however the splashscreen will no go away. in the console I see this
[WARNING] Webview error: Error Domain=NSURLErrorDomain Code=-1202 “The certificate for this server is invalid. You might be connecting to a server that is pretending to be “localhost” which could put your confidential information at risk.” UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x283bddc20>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9813, NSErrorPeerCertificateChainKey=(

the splash screen just appears stuck.

I feel like I have had this problem in the past and had to use the IP vs say localhost in the httpd config, but seeing as it is built in to the core I’m not sure how to proceed. I also tried to hook in catalyst and it registers but does not show anything.

As of Forge v2.8.x the httpd module is compiled in by default. Can you try:

  • removing the httpd module if it’s still referenced in your src/config.json
  • remove core.general.httpd if referenced in your src/config.json

This should give you something that works out the box.

Also, can you please try temporarily removing the launchimage module if you’re using it. Just to check that it isn’t causing any issues.

If it’s still dying after that can you please attach your src/config.json file?

So I removed the modules etc and now the ‘forge splash screen’ shows up and goes away I’m left with a blank screen. Trying to load up the dev tools in safari shows no webview running.

here is the config file

{
“config_version”: “4”,
“name”: “app”,
“author”: “info”,
“modules”: {

	"file": {
		"version": "2.24",
		"config": {
			"usage_description": "Access to your camera allows you to take photos in the app as well as use the QR scanner to scan codes"
		}
	},
	"icons": {
		"version": "2.9",
		"config": {
			"android": {
				"48": "img//splash//icon48.png",
				"72": "img//splash//icon72.png",
				"96": "img//splash//icon96.png",
				"144": "img//splash//icon144.png",
				"192": "img//splash//icon192.png"
			},
			"ios": {
				"57": "img//splash//icon57.png",
				"72": "img/splash/icon72.png",
				"76": "img//splash//icon76.png",
				"114": "img//splash//icon114.png",
				"120": "img//splash//icon120.png",
				"144": "img//splash//icon144.png",
				"152": "img//splash//icon152.png",
				"167": "img//splash//icon167.png",
				"180": "img//splash//icon152.png",
				"1024": "img//splash//icon114.png"
			}
		}
	},
	"tabs": {
		"version": "3.3"
	},
	"topbar": {
		"version": "2.15",
		"config": {},
		"disabled": true
	},
	"request": {
		"version": "2.11",
		"config": {}
	},
	"tabbar": {
		"version": "2.7",
		"disabled": true
	},
	"notification": {
		"version": "2.8"
	},
	"calendar": {
		"version": "2.9",
		"config": {
			"usage_description": "Access to the calendar allows you to add sessions to your device calendar"
		}
	},
	"prefs": {
		"version": "2.2"
	},
	"platform": {
		"version": "2.3"
	},
	"barcode": {
		"version": "2.7"
	},
	"media": {
		"version": "2.7",
		"config": {}
	},
	"contact": {
		"version": "2.13",
		"config": {
			"usage_description": "Access to your contacts all you to add other attendees to your address book"
		}
	},
	"display": {
		"version": "2.12",
		"config": {
			"fullscreen": {
				"ios7": "not-fullscreen"
			},
			"orientations": {
				"ipad": "portrait",
				"android": "portrait",
				"iphone": "portrait"
			}
		}
	},
	"permissions": {
		"version": "2.1"
	},
	"urlhandler": {
		"version": "2.2",
		"config": {
			"scheme": "conbop"
		}
	},
	"bolts": {
		"version": "1.9.0"
	},
	"parse": {
		"version": "3.1",
		"config": {
			"android": {
				"24": "img//splash//icon96.png",
				"36": "img//splash//icon96.png",
				"48": "img//splash//icon96.png",
				"72": "img//splash//icon96.png",
				"96": "img//splash//icon96.png",
				"notificationIcon": "@drawable/custom_push_icon",
				"googleServicesJson": "google-services.json"
			},
			"applicationId": "",
			"server": "h",
			"clientKey": ""
		}
	},
	
	"capture": {
		"version": "2.25",
		"config": {
			"usage_description": "This will allow you to take add a photo to your profile or photo gallery"
		}
	}
},
"platform_version": "v2.8.4",
"version": "2.12.11",
"core": {
	"android": {
		"minimum_version": "18",
		"package_name": "",
		"disable_ics_acceleration": true,
		"remote_debugging": true,
		"windowSoftInputMode": "adjustResize|stateHidden"
	},
	"ios": {
		"minimum_version": "11.0",
		"device_family": "any",
		"webview": "UIWebView",
		"package_name": "",
		"disable_web_storage_backup": true
	},
	"general": {
		"trusted_urls": [
			"https://youtube.com/*"
		]
		
	},
	"crosswalk": {
		"disable_pull_to_refresh_effect": true,
		"minimum_version": "19"
	}
},
"description": "",
"flags": {
	"move_filescheme_storage_to_httpscheme": true
}

}

Hrmmm… everything looks reasonable here.

I’d probably look for any javascript errors during startup, maybe add a global try/catch that logs any exceptions like:

try {
   ... app startup code ...
} catch (e) {
    forge.logging.error(JSON.stringify(e));
}

Maybe also try your config against a minimal index.html like:

<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <title> </title>
  </head>
  <body>
    Boink!
  </body>
</html>

I’ve been having a devil of a time attaching the Safari debugger to the last few versions of iOS 13.x on hardware. Some days it works others it just won’t. Simulator might fare a little better?

I’m away from my machine right now, but I’ll take a look and see if I can reproduce with the given src/config.json when I’m back in the office tomorrow morning.

Oh wait, I just noticed:

"webview": "UIWebView",

Since iOS 13 we’re unable to support UIWebView at all, can you try remove it?

Hi Antoine,

I just tried this and that seems to have fixed the problem, Thanks!

1 Like