MobileAds.initialize(context, id); takes too long

5,288 views
Skip to first unread message

Minas Keshishyan

unread,
Jul 23, 2018, 2:05:39 AM7/23/18
to Google Mobile Ads SDK Developers
Hi,
We are trying to optimize launch time for our app.
After detailed profiling we found out that MobileAds.initialize is the worst offender during app launch. On powerful devices it takes up to 500 ms and on lowend devices it takes up to whopping 5 seconds.
We tried to comment out the call and app launched significantly faster and ads were shown properly.
So we are trying to understand if MobileAds.initialize is still mandatory to call?
If yes please forward to the team to fix this issue, as we think it shouldn't take so long.

Regards,
Minas

mobileadssdk-a...@google.com

unread,
Jul 23, 2018, 5:57:57 AM7/23/18
to Minas Keshishyan, Google Mobile Ads SDK Developers
Hi Minas,

Thanks for contacting us.

Please note that the MobileAds.Initialize() method is not mandatory so you should be able to load Ads successfully without calling this method. This method is primarily used to reduce load time on your very first Ad request. 

Alternatively, you may opt not to call this method at app launch (e.g onCreate) but instead on a later part (e.g after all the views in your launching screen are displayed) before the screen/part where the first Ad request will be sent out.

Regards,
Steven Balan
Mobile Ads SDK Team

Minas Keshishyan

unread,
Jul 23, 2018, 6:04:48 AM7/23/18
to google-adm...@googlegroups.com
Hi Steven,
Thanks for quick and helpful reply!

MobileAds.initialize() is synchronous call and slows down app launch drastically.
If I understood correctly after we remove call to  MobileAds.initialize(), behaviour will be exactly the same, the only difference will be that init will happen automatically during first ad request?
We thought it may affect targeted ads or properly tracking ad clicks if we remove it, because there is no other place where we specify our AdMob app id. I guess it's taken from google-services.json or from the ad placement in the first ad request?

Minas Keshishyan

unread,
Jul 23, 2018, 6:21:20 AM7/23/18
to Google Mobile Ads SDK Developers
And "Get started" doc seems to be misleading: https://firebase.google.com/docs/admob/android/quick-start#initialize_the_sdk
By reading this I got an impression that it's required step. And it drastically slows down apps by 5 seconds on some scenarios, I guess because of network latency.


On Monday, July 23, 2018 at 1:57:57 PM UTC+4, mobileadssdk-a...@google.com wrote:

I.D.E.

unread,
Jul 23, 2018, 9:17:02 AM7/23/18
to google-adm...@googlegroups.com
But the documentation page says it is mandatory:


Why is it suddenly optional now?

Also the example code calls it on every Activity.onCreate() - whenever an activity is launched.

How would anyone know that it's not mandatory?

mobileadssdk-a...@google.com

unread,
Jul 24, 2018, 1:28:42 AM7/24/18
to Minas Keshishyan, Google Mobile Ads SDK Developers
Hi everyone,

Apologies for the confusion. It is part of the guide and our sample apps because this is the recommended implementation of the Mobile Ads SDK but please note that it is not mandatory to be able to load and display Ads.

However, to avoid confusion, let me raise this concern to the rest of the team and rest assured I will update this thread for any official feedback.

Regards,
Steven Balan
Mobile Ads SDK Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/9e46d05a-8fc4-4a44-9984-3b8791c469f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Russell Wilson

unread,
Jul 24, 2018, 2:08:29 PM7/24/18
to Google Mobile Ads SDK Developers
I am having the same issue with my app, this MobileAds.initialize() method, when used as prescribed, is responsible for a huge part of my app startup time.  A median of 405ms and a p95 of 1.5 seconds.

Is it safe to run the MobileAds.initialize() method on a background thread instead of running it on the main UI thread?

Minas Keshishyan

unread,
Jul 24, 2018, 2:55:54 PM7/24/18
to Google Mobile Ads SDK Developers
Hi Russell,
Yeah it's also ~500 ms for our app with high end devices and high speed connection, but on low end devices and slow internet it can take 5+ sec.

We removed the method call and our app launches much faster now, instead ads load few sec later, which is much better experience for our users. Can't understand how it's better to run it synchronously to "decrease first ad load latency", but increase app load time by few sec.
And we get the same ads with / without calling the method. Now our only concern is if AdMob team will decide to change something later and break ads for our app without the call.

mobileadssdk-a...@google.com

unread,
Jul 25, 2018, 2:02:18 AM7/25/18
to Russell Wilson, Google Mobile Ads SDK Developers
Hi everyone,

Below are my responses to your concerns:

I am having the same issue with my app, this MobileAds.initialize() method, when used as prescribed, is responsible for a huge part of my app startup time.  A median of 405ms and a p95 of 1.5 seconds.

It is important to note that initializing the SDK using the MobileAds.initialize() method is optional. Also, if you decided not to call this method, the SDK will be initialized automatically on your very first Ad request which might increase the Ads load time to a few milliseconds more, similar to what Minas have observed. That said, you should be able to load Ads with or without implementing the MobileAds.initialize() as it is mainly for the purpose of initializing the SDK ahead to decrease load time on the first Ad request.

 Is it safe to run the MobileAds.initialize() method on a background thread instead of running it on the main UI thread?

Please note that according to this guide, all calls to the Mobile Ads SDK such as the MobileAds.initialize() should be executed on the main thread and not in the background thread.

Regards,
Steven Balan
Mobile Ads SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 07/25/18 02:08:29 russell.h...@gmail.com wrote:
I am having the same issue with my app, this MobileAds.initialize() method, when used as prescribed, is responsible for a huge part of my app startup time.  A median of 405ms and a p95 of 1.5 seconds.

Is it safe to run the MobileAds.initialize() method on a background thread instead of running it on the main UI thread?

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Minas Keshishyan

unread,
Jul 25, 2018, 2:28:24 AM7/25/18
to google-adm...@googlegroups.com
Hi Steven,
Thanks for details!

In our case ad load time increased by several seconds and not milliseconds on mobile connections or low end devices, which is the usual use case scenario for our app. When we call MobileAds.initialize() our app shows blank screen for several seconds and when we call it after UI is drawn, UI is freezed for several seconds, because of the expensive call on the main UI thread.
I really don't understand how it can beneficial for anybody to increase app launch time by few seconds, just to decrease first ad request time. You're better off ditching the method to avoid confusion and instead focus on optimizing the first ad request time.

I.D.E.

unread,
Jul 25, 2018, 4:58:18 AM7/25/18
to Google Mobile Ads SDK Developers
Is it possible to rename it to MobileAds.preloadAds() ?

And consider adding some documentation that it's optional, and include a warning that it calling it will potentially freeze your app.

The sample code and JavaDoc and general web guides should all explain that it's optional.

mobileadssdk-a...@google.com

unread,
Jul 25, 2018, 6:23:51 AM7/25/18
to Minas Keshishyan, Google Mobile Ads SDK Developers
Hi everyone,

Thanks for the extra details. 

Rest assured that we will raise your concerns to the rest of the team and we will get back to you for any feedback.

Regards,
Steven Balan
Mobile Ads SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 07/25/18 14:28:24 min...@gmail.com wrote:
Hi Steven,
Thanks for details!

In our case ad load time increased by several seconds and not milliseconds on mobile connections or low end devices, which is the usual use case scenario for our app. When we call MobileAds.initialize() our app shows blank screen for several seconds and when we call it after UI is drawn, UI is freezed for several seconds, because of the expensive call on the main UI thread.
I really don't understand how it can beneficial for anybody to increase app launch time by few seconds, just to decrease first ad request time. You better ditch the method to avoid confusion and instead focus on optimizing the first ad request time.

On Wednesday, July 25, 2018 at 10:02:18 AM UTC+4, mobileadssdk-a...@google.com wrote:
Hi everyone,

Below are my responses to your concerns:

I am having the same issue with my app, this MobileAds.initialize() method, when used as prescribed, is responsible for a huge part of my app startup time.  A median of 405ms and a p95 of 1.5 seconds.

It is important to note that initializing the SDK using the MobileAds.initialize() method is optional. Also, if you decided not to call this method, the SDK will be initialized automatically on your very first Ad request which might increase the Ads load time to a few milliseconds more, similar to what Minas have observed. That said, you should be able to load Ads with or without implementing the MobileAds.initialize() as it is mainly for the purpose of initializing the SDK ahead to decrease load time on the first Ad request.

 Is it safe to run the MobileAds.initialize() method on a background thread instead of running it on the main UI thread?

Please note that according to this guide, all calls to the Mobile Ads SDK such as the MobileAds.initialize() should be executed on the main thread and not in the background thread.

Regards,
Steven Balan
Mobile Ads SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 07/25/18 02:08:29 russell.h...@gmail.com wrote:
I am having the same issue with my app, this MobileAds.initialize() method, when used as prescribed, is responsible for a huge part of my app startup time.  A median of 405ms and a p95 of 1.5 seconds.

Is it safe to run the MobileAds.initialize() method on a background thread instead of running it on the main UI thread?

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Nikola Mihaylov

unread,
Feb 19, 2019, 1:27:34 AM2/19/19
to google-adm...@googlegroups.com
What is the status of this issue? Ads take 3s-5s startup time on a good number of my customer's phones (not new devices, but obviously still in use!) because of this bug.

Just wondering - has someone else found a workaround? Or should we switch to some other ad provider?

mobileadssdk...@google.com

unread,
Feb 19, 2019, 6:40:00 AM2/19/19
to Nikola Mihaylov, Google Mobile Ads SDK Developers
Hi Nikola,

Could you confirm from which SDK version are you encountering this as well as the information of the affected devices?

Regards,
Ivan Bautista
Mobile Ads SDK Team




On 02/19/19 14:27:33 nikola....@gmail.com wrote:
What is the status of this issue? Ads take 3s-5s startup time on a good number of my customer's phones (not devices, but obviously still in use!) because of this bug.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Nikola Mihaylov

unread,
Feb 19, 2019, 6:37:07 PM2/19/19
to mobileadssdk...@google.com, Google Mobile Ads SDK Developers
Yes - Note 3 with AOSPExtended ROM, also seeing glitch on OnePlus One. Several customers report "slow" on variety of devices. SDK com.google.android.gms:play-services-ads:17.1.3.
Is this the info you were looking for? Please let me know if you need anything else!
btw, tried UnityAds on the same OnePlus One device - they have no glitch and no slowdown.
Still testing

To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/bf225500-534d-41d3-8614-2473f6c63ff9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

Ivo Pavlov

unread,
Feb 19, 2019, 7:44:03 PM2/19/19
to google-adm...@googlegroups.com
To add to the info from Nikola Mihaylov - here is log from executing MobileAds.Initialize(). App blocks for 3 seconds while Initialize() is running, but it also blocks for 2 additional seconds immediately after Initialize() has finished - so 5s total
I think app resumes around the "InputDispatcher" messages at the end.

2019-02-20 02:31:52.511 10530-10545/? D/FantasiaPainter: Ads init START!!!!!!!!!!!!!!
2019-02-20 02:31:52.554 10530-10545/? W/fantasiapainte: Unsupported class loader
2019-02-20 02:31:52.614 10530-10545/? I/fantasiapainte: The ClassLoaderContext is a special shared library.
2019-02-20 02:31:52.619 10530-10545/? I/chatty: uid=10182(com.datcompany.fantasiapainter) UnityMain identical 1 line
2019-02-20 02:31:52.623 10530-10545/? I/fantasiapainte: The ClassLoaderContext is a special shared library.
2019-02-20 02:31:54.120 810-1114/? E/WifiVendorHal: getWifiLinkLayerStats(l.937) failed {.code = ERROR_NOT_AVAILABLE, .description = }
2019-02-20 02:31:55.152 10530-10545/? I/DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:11140
2019-02-20 02:31:55.152 10530-10545/? I/DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 11140
2019-02-20 02:31:55.222 10530-10545/? W/fantasiapainte: Unsupported class loader
2019-02-20 02:31:55.325 10530-10540/? I/fantasiapainte: Background concurrent copying GC freed 113398(4MB) AllocSpace objects, 42(2MB) LOS objects, 69% free, 2MB/8MB, paused 1.737ms total 140.740ms
2019-02-20 02:31:55.350 10530-10545/? D/DynamitePackage: Instantiated singleton DynamitePackage.
2019-02-20 02:31:55.350 10530-10545/? D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl
2019-02-20 02:31:55.536 10530-10545/? I/Ads: Updating ad debug logging enablement.
2019-02-20 02:31:55.563 10530-10586/? W/Ads: Update ad debug logging enablement as false
2019-02-20 02:31:55.610 10530-10545/? D/FantasiaPainter: Ads init END!!!!!!!!!!!!!!: 3098 
2019-02-20 02:31:55.689 10530-10530/? I/WebViewFactory: Loading com.android.chrome version 72.0.3626.105 (code 362610502)
2019-02-20 02:31:56.869 10530-10530/? I/cr_LibraryLoader: Time to load native libraries: 8 ms (timestamps 8685-8693)
2019-02-20 02:31:56.950 10530-10530/? I/chromium: [INFO:library_loader_hooks.cc(42)] Chromium logging enabled: level = 0, default verbosity = 0
2019-02-20 02:31:56.951 10530-10530/? I/cr_LibraryLoader: Expected native library version number "72.0.3626.105", actual native library version number "72.0.3626.105"
2019-02-20 02:31:57.025 10530-10592/? W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true
2019-02-20 02:31:57.047 1311-1311/? W/webview_zygote: type=1400 audit(0.0:13947): avc: denied { search } for name="theme" dev="mmcblk0p26" ino=1403762 scontext=u:r:webview_zygote:s0 tcontext=u:object_r:theme_data_file:s0 tclass=dir permissive=0
2019-02-20 02:31:57.058 10530-10530/? I/cr_BrowserStartup: Initializing chromium process, singleProcess=false
2019-02-20 02:31:57.137 810-1114/? E/WifiVendorHal: getWifiLinkLayerStats(l.937) failed {.code = ERROR_NOT_AVAILABLE, .description = }
2019-02-20 02:31:57.263 810-832/? D/ConnectivityService: requestNetwork for uid/pid:10182/10530 NetworkRequest [ TRACK_DEFAULT id=84, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ]
2019-02-20 02:31:57.265 810-1114/? D/WIFI: got request NetworkRequest [ TRACK_DEFAULT id=84, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 02:31:57.265 810-1114/? D/WIFI_UT: got request NetworkRequest [ TRACK_DEFAULT id=84, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 02:31:57.266 810-1137/? D/Ethernet: got request NetworkRequest [ TRACK_DEFAULT id=84, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 02:31:57.267 1373-1373/? D/PhoneSwitcherNetworkRequstListener: got request NetworkRequest [ TRACK_DEFAULT id=84, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 02:31:57.402 810-892/? W/ActivityManager: Slow operation: 354ms so far, now at startProcess: returned from zygote!
2019-02-20 02:31:57.402 810-892/? W/ActivityManager: Slow operation: 355ms so far, now at startProcess: done updating battery stats
2019-02-20 02:31:57.402 810-892/? W/ActivityManager: Slow operation: 355ms so far, now at startProcess: building log message
2019-02-20 02:31:57.402 810-892/? I/ActivityManager: Start proc 10609:com.android.chrome:sandboxed_process0/u0i13 for webview_service com.datcompany.fantasiapainter/org.chromium.content.app.SandboxedProcessService0
2019-02-20 02:31:57.402 810-892/? W/ActivityManager: Slow operation: 355ms so far, now at startProcess: starting to update pids map
2019-02-20 02:31:57.403 810-892/? W/ActivityManager: Slow operation: 355ms so far, now at startProcess: done updating pids map
2019-02-20 02:31:57.447 10609-10609/? I/dboxed_process: Late-enabling -Xcheck:jni
2019-02-20 02:31:57.467 10609-10609/? E/dboxed_process: Not starting debugger since process cannot load the jdwp agent.
2019-02-20 02:31:57.511 10530-10621/? W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
2019-02-20 02:31:57.521 10530-10600/? W/cr_media: Requires BLUETOOTH permission
2019-02-20 02:31:57.540 810-1819/? D/ConnectivityService: requestNetwork for uid/pid:10182/10530 NetworkRequest [ TRACK_DEFAULT id=86, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ]
2019-02-20 02:31:57.542 810-1137/? D/Ethernet: got request NetworkRequest [ TRACK_DEFAULT id=86, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 02:31:57.542 810-1114/? D/WIFI: got request NetworkRequest [ TRACK_DEFAULT id=86, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 02:31:57.546 1373-1373/? D/PhoneSwitcherNetworkRequstListener: got request NetworkRequest [ TRACK_DEFAULT id=86, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 02:31:57.547 810-1114/? D/WIFI_UT: got request NetworkRequest [ TRACK_DEFAULT id=86, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 02:31:57.592 10530-10530/? I/Choreographer: Skipped 119 frames!  The application may be doing too much work on its main thread.
2019-02-20 02:31:57.599 810-996/? I/InputDispatcher: Window 'Window{f50a390 u0 com.datcompany.fantasiapainter/com.datcompany.fantasiapainter.MainActivity}' spent 2012.0ms processing the last input event: MotionEvent(deviceId=17, source=0x00001002, action=MOVE, actionButton=0x00000000, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[1: (398.0, 605.0)]), policyFlags=0x62000000
2019-02-20 02:31:57.599 810-996/? I/InputDispatcher: Window 'Window{f50a390 u0 com.datcompany.fantasiapainter/com.datcompany.fantasiapainter.MainActivity}' spent 2001.4ms processing the last input event: MotionEvent(deviceId=17, source=0x00001002, action=MOVE, actionButton=0x00000000, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[1: (417.0, 558.0)]), policyFlags=0x62000000


And extreme case where Initialize() took 15s:

2019-02-20 03:09:13.742 14990-14990/? D/FantasiaPainter: Ads init START!!!!!!!!!!!!!!
2019-02-20 03:09:13.783 14990-14990/? W/fantasiapainte: Unsupported class loader
2019-02-20 03:09:13.843 14990-14990/? I/fantasiapainte: The ClassLoaderContext is a special shared library.
2019-02-20 03:09:13.847 14990-14990/? I/chatty: uid=10182(com.datcompany.fantasiapainter) identical 1 line
2019-02-20 03:09:13.850 14990-14990/? I/fantasiapainte: The ClassLoaderContext is a special shared library.
2019-02-20 03:09:16.583 810-1114/? E/WifiVendorHal: getWifiLinkLayerStats(l.937) failed {.code = ERROR_NOT_AVAILABLE, .description = }
2019-02-20 03:09:22.911 810-890/? W/ActivityManager: Launch timeout has expired, giving up wake lock!
2019-02-20 03:09:19.619 810-1114/? I/chatty: uid=1000(system) WifiStateMachin identical 1 line
2019-02-20 03:09:22.651 810-1114/? E/WifiVendorHal: getWifiLinkLayerStats(l.937) failed {.code = ERROR_NOT_AVAILABLE, .description = }
2019-02-20 03:09:24.153 14990-14990/? I/DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:11140
2019-02-20 03:09:24.153 14990-14990/? I/DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 11140
2019-02-20 03:09:24.294 14990-14990/? W/fantasiapainte: Unsupported class loader
2019-02-20 03:09:24.560 14990-14990/? D/DynamitePackage: Instantiated singleton DynamitePackage.
2019-02-20 03:09:24.560 14990-14990/? D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl
2019-02-20 03:09:24.893 14990-15007/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2019-02-20 03:09:24.922 14990-14990/? I/Ads: Updating ad debug logging enablement.
2019-02-20 03:09:25.043 14990-14990/? I/WebViewFactory: Loading com.android.chrome version 72.0.3626.105 (code 362610502)
2019-02-20 03:09:27.079 810-1114/? E/WifiVendorHal: getWifiLinkLayerStats(l.937) failed {.code = ERROR_NOT_AVAILABLE, .description = }
2019-02-20 03:09:28.992 14990-14990/? I/cr_LibraryLoader: Time to load native libraries: 13 ms (timestamps 259-272)
2019-02-20 03:09:29.076 14990-14990/? I/chromium: [INFO:library_loader_hooks.cc(42)] Chromium logging enabled: level = 0, default verbosity = 0
2019-02-20 03:09:29.076 14990-14990/? I/cr_LibraryLoader: Expected native library version number "72.0.3626.105", actual native library version number "72.0.3626.105"
2019-02-20 03:09:29.160 14990-15015/? W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true
2019-02-20 03:09:29.173 14990-14990/? I/cr_BrowserStartup: Initializing chromium process, singleProcess=false
2019-02-20 03:09:29.202 1311-1311/? W/webview_zygote: type=1400 audit(0.0:16616): avc: denied { search } for name="theme" dev="mmcblk0p26" ino=1403762 scontext=u:r:webview_zygote:s0 tcontext=u:object_r:theme_data_file:s0 tclass=dir permissive=0
2019-02-20 03:09:29.367 810-1655/? D/ConnectivityService: requestNetwork for uid/pid:10182/14990 NetworkRequest [ TRACK_DEFAULT id=112, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ]
2019-02-20 03:09:29.369 1373-1373/? D/PhoneSwitcherNetworkRequstListener: got request NetworkRequest [ TRACK_DEFAULT id=112, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 03:09:29.371 810-1137/? D/Ethernet: got request NetworkRequest [ TRACK_DEFAULT id=112, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 03:09:29.371 810-1114/? D/WIFI: got request NetworkRequest [ TRACK_DEFAULT id=112, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 03:09:29.371 810-1114/? D/WIFI_UT: got request NetworkRequest [ TRACK_DEFAULT id=112, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Unwanted:  Uid: 10182] ] with score 60
2019-02-20 03:09:29.462 810-892/? W/ActivityManager: Slow operation: 257ms so far, now at startProcess: returned from zygote!
2019-02-20 03:09:29.462 810-892/? W/ActivityManager: Slow operation: 257ms so far, now at startProcess: done updating battery stats
2019-02-20 03:09:29.462 810-892/? W/ActivityManager: Slow operation: 258ms so far, now at startProcess: building log message
2019-02-20 03:09:29.463 810-892/? I/ActivityManager: Start proc 15032:com.android.chrome:sandboxed_process0/u0i20 for webview_service com.datcompany.fantasiapainter/org.chromium.content.app.SandboxedProcessService0
2019-02-20 03:09:29.463 810-892/? W/ActivityManager: Slow operation: 258ms so far, now at startProcess: starting to update pids map
2019-02-20 03:09:29.463 810-892/? W/ActivityManager: Slow operation: 258ms so far, now at startProcess: done updating pids map
2019-02-20 03:09:29.499 15032-15032/? I/dboxed_process: Late-enabling -Xcheck:jni
2019-02-20 03:09:29.504 15032-15032/? E/dboxed_process: Not starting debugger since process cannot load the jdwp agent.
2019-02-20 03:09:29.563 14990-15023/? W/cr_media: Requires BLUETOOTH permission
2019-02-20 03:09:29.575 14990-15046/? I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8974_LA.BF.1.1.3_RB1__release_AU (I741a3d36ca)
    OpenGL ES Shader Compiler Version: E031.29.00.00
    Build Date: 04/04/16 Mon
    Local Branch: mybranch19053788
    Remote Branch: quic/LA.BF.1.1.3_rb1.12
    Local Patches: NONE
    Reconstruct Branch: NOTHING
2019-02-20 03:09:29.576 14990-14990/? D/FantasiaPainter: Ads init END!!!!!!!!!!!!!!: 15834


Regards,
Ivo

mobileadssdk...@google.com

unread,
Feb 20, 2019, 4:19:53 AM2/20/19
to Ivo Pavlov, Google Mobile Ads SDK Developers
Hi everyone,

Thank you for the details provided. 

Could you also measure on your end the app performance with Android Profiler to help with our investigation?

Regards,
Ivan Bautista
Mobile Ads SDK Team


--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Minas Keshishyan

unread,
Feb 20, 2019, 4:26:43 AM2/20/19
to Google Mobile Ads SDK Developers
We also still have the issue. I eliminated almost all the other SDKs and our app's start time is still horrible because of admob SDK.

Ivo Pavlov

unread,
Feb 20, 2019, 6:45:44 AM2/20/19
to Google Mobile Ads SDK Developers
Hi Ivan,

Here is link to zip with all 4 types of trace logs from Android Profiler:

I don't know if it's easily visible in the trace files, but in each there are 3 touch events:
1) starts MobileAds.Initialize()
2) app reacts just for a moment after Initialize() finishes, then blocks again
3) app is reacting from that point onwards

Regards,
Ivo

mobileadssdk...@google.com

unread,
Feb 21, 2019, 3:17:02 AM2/21/19
to Ivo Pavlov, Google Mobile Ads SDK Developers
Hi Ivo,

Thank you for taking the time to profile the app on your end. 

I will share the information provided by everyone and I will keep you posted for any feedback.

Regards,
Ivan Bautista
Mobile Ads SDK Team



Nikola Mihaylov

unread,
Feb 22, 2019, 12:12:29 AM2/22/19
to Google Mobile Ads SDK Developers
Thanks! Looking forward to reply! 6 months ago, on 7/25 there was a similar message that "concerns will be raised and I will keep you posted for any feedback" without any update for 6 months.
I hope the Google Ads team considers this a serious issue and will look into it very soon. I suspect fixing it can improve the Android app ecosystem significantly if a large amount of apps start faster.

mobileadssdk...@google.com

unread,
Apr 24, 2019, 1:58:54 AM4/24/19
to Google Mobile Ads SDK Developers
Hi everyone,

I received a feedback from our team. Could you please put this code into your app, call it on app startup before invoking the SDK and then compare how long the SDK takes to init?

private void initWebView() {
        long beforeWebViewInit = System.currentTimeMillis();
        WebView webView = new WebView(this);
        webView.loadUrl("https://www.google.com");
        long afterWebViewInit = System.currentTimeMillis();
        Log.d("MyApp", "WebView init diff: " + (afterWebViewInit - beforeWebViewInit));
    }

Regards,
Teejay Pimentel
Mobile Ads SDK Team

Minas Keshishyan

unread,
Apr 24, 2019, 3:57:06 AM4/24/19
to Google Mobile Ads SDK Developers
Hi Teejay,

Without calling initWebView(), the MobileAds.initialize took 3491 ms on Galaxy S2.
With  initWebView() it took 879 ms, but initWebView() took another 2855 ms, so about the same in total ( 3734 ms ).

Without calling initWebView(), the MobileAds.initialize took 663 ms on Galaxy S5.
With  initWebView() it took 388 ms, but initWebView() took another 314 ms, so about the same in total ( 702 ms ).

Without calling initWebView(), the MobileAds.initialize took ~ 400 ms on Google Pixel.
With  initWebView() it took 177 ms, but initWebView() took another 233 ms, so 410 ms in total.

Please note that majority of our users are on low end devices, which are nowhere close to Pixel's performance. So it's a significant few seconds delay during app startup.

Is there any chance that you will stop using webview, so init will take ~ 2x less time?

Regards,
Minas

mobileadssdk...@google.com

unread,
Apr 24, 2019, 4:54:13 AM4/24/19
to Minas Keshishyan, Google Mobile Ads SDK Developers
Hi Minas,

Thank you for getting back to us.

I will relay these findings to the Engineering team and provide you for any feedback.


Regards,
Teejay Pimentel
Mobile Ads SDK Team
--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

mobileadssdk...@google.com

unread,
May 7, 2019, 2:40:47 AM5/7/19
to Minas Keshishyan, Google Mobile Ads SDK Developers
Hi Minas,

I received a feedback from Engineering team with regard to your question as there is no short term plans to stop using WebView and the use of WebView is common among ad network SDKs.

Regards,
Teejay Pimentel
Mobile Ads SDK Team

On 04/24/19 15:57:06 min...@gmail.com wrote:
--

Minas Keshishyan

unread,
May 7, 2019, 2:42:18 AM5/7/19
to mobileadssdk...@google.com, Google Mobile Ads SDK Developers
Hi Teejay,
Ok thanks.
At least init time will be reduced I hope :)

To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

Apc

unread,
May 20, 2019, 6:23:24 PM5/20/19
to google-adm...@googlegroups.com
Faced the same issue then I was pointed here. Almost one whole year of no resolution: just suggestions to postpone this blocking delay.
 
I wonder how then optimize apps performance and eliminate frozen frames while billion-scaled "authentic" code blocks UI thread so boldly :(

Even if this problem is mostly caused by WebView, this WebView itself could be already updated to address this issue. Anyway, this case of bad user experience should be resolved adequately at once, the time has come.


On Monday, July 23, 2018 at 8:05:39 AM UTC+2, Minas Keshishyan wrote:
Hi,
We are trying to optimize launch time for our app.
After detailed profiling we found out that MobileAds.initialize is the worst offender during app launch. On powerful devices it takes up to 500 ms and on lowend devices it takes up to whopping 5 seconds.
We tried to comment out the call and app launched significantly faster and ads were shown properly.
So we are trying to understand if MobileAds.initialize is still mandatory to call?
If yes please forward to the team to fix this issue, as we think it shouldn't take so long.

Regards,
Minas

Mobile Ads SDK Forum Advisor Prod

unread,
May 21, 2019, 2:00:41 AM5/21/19
to arseniy...@gmail.com, google-adm...@googlegroups.com
Hi,

The team has been actively pushing out fixes and updates so you should be seeing continued improvements. Please keep an eye on our Blogpost regarding on this.

Regards,
Teejay Pimentel
Mobile Ads SDK Team

ref:_00D1U1174p._5001UAqC4h:ref
Message has been deleted

Minas Keshishyan

unread,
May 21, 2019, 2:56:54 AM5/21/19
to Google Mobile Ads SDK Developers
Hi Teejay,
There were no any major updates for Android SDK this year. When the new version promised during Google IO will be released? It's already released for iOS.

Apc

unread,
May 21, 2019, 5:25:00 AM5/21/19
to Google Mobile Ads SDK Developers
Hi, Teejay!

Thank you for your reply. Look, exactly 10 months ago it becomes clear that documentation needed clarifications that initialize() call is not mandatory. Now, what we read in the actual document:

"Call this method as early as possible, and only once per application launch." 

Call for what? To get more frozen frames and bad vital statistics for app startup time? Nothing from this thread is reflected in the documentation, still NOTHING. Is it possible to raise the priority of this issue? it affects dramatically every device/app running Google Mobile Ads, every user.

Mobile Ads SDK Forum Advisor Prod

unread,
May 21, 2019, 6:16:41 AM5/21/19
to min...@gmail.com, google-adm...@googlegroups.com
Hi Minas,

We cannot give any definite timeline regarding on this. Please keep an eye on our blog or Release Notes for future updates. 

Wing Chan

unread,
Jun 18, 2020, 10:24:36 PM6/18/20
to Google Mobile Ads SDK Developers
Just wonder any update on this thread?!  Thanks.

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 19, 2020, 1:21:48 AM6/19/20
to win...@gmail.com, google-adm...@googlegroups.com

Hi Wing,

 

Thank you for reaching out to us.

 

The AdMob SDK has changed its MobileAds.initialize function since the last time this thread was updated. Kindly create a new thread with details on your concern if you are still encountering this issue in the latest version of the AdMob SDK (19.2.0), so that we can assist you better on it.

 

Regards,

Ziv Yves Sanchez

Reply all
Reply to author
Forward
0 new messages