Flutter Not all asset views lie inside the native ad view

Viewed 311

I was trying to add an native admob to my flutter app.
I completed adding admob account and ad unit.
so I got this result.
Phone showing native ad

I think this is not completed. And I found one log.

I/Ads     (11192): Received log message: <Google:HTML> Not all asset views lie inside the native ad view. This indicates an integration problem. Such implementations will not be supported in the future. Please make sure that all native ad assets are rendered inside the native ad view.

The code of this native admob is here.

class MatchingPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

    final ad_id = 'my admob ad id';

    return Scaffold(
      appBar: CommonAppBar(text: '매칭'),
      body: Center(
        child: Column(
          children: <Widget>[
            Container(
              height: 60,
              child: NativeAdmob(
                adUnitID: ad_id
              ),
            ),
            Expanded(
              child: Container(),
            ),
            CircularProgressIndicator(),
            SizedBox(
              height: 30,
            ),
            Text(
              '예상 대기시간 60초',
              style: TextStyle(color: Colors.white, fontSize: 16),
            ),
            Text(
              '???초 경과',
              style: TextStyle(color: Colors.white, fontSize: 16),
            ),
            Expanded(
              child: Container(),
            ),
            CommonButton(
              text: 'STOP!',
              onPressed: () {},
            )
          ],
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
        ),
      ),
    );
  }
}
1 Answers

I stumbled upon the same warning message when implementing native ads for my Flutter app, and despite going thoroughly through the native ads checklist, I was still getting the warning.

What fixed it for me was to set generous dimensions on the parent Flutter widget, and I got rid of the warning.

In your case, you seem to give it 60dp height and full screen width, there is probably not enough space to display the required elements like the ad headline and body. Try giving it a greater height and the warning should disappear.

In my case, I was wrapping the ad into an AspectRatio widget with value 16/9 : it turned out this was too less for displaying headline, body, and image, I had to change it to a more square-like format.

Related