I discovered that actually the layout variable was indeed null. Instead of creating a layout with an xml, I ended up instead creating it programmatically like so:
public FREObject call(FREContext context, FREObject[] args) {
AdView adView = new AdView(context.getActivity(), AdSize.BANNER, NewAdFunction.developerId);
Activity activity = context.getActivity();
ViewGroup viewGroup = (ViewGroup)activity.findViewById(android.R.id.content);
viewGroup = (ViewGroup)viewGroup.getChildAt(0);
LinearLayout layout = new LinearLayout(activity);
viewGroup.addView(layout, new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
adView.setVisibility(View.VISIBLE);
layout.addView(adView, params);
}
That's the best way I've found to add a view in an AIR native extension.