First of all, I'm informing you in advance that I've tried so many different things and as a result, I'm asking you questions here because they all failed.
I will write down the last method I tried from beginning to end for accurate information delivery.
Unity version : 22.3.52f1
admob plugin version(unity package) : 9.3.0
Test Device : Galaxy S9 and Galaxy S20 (All of my devices are registered as test devices in admob.)
Used Admob ID : ca-app-pub-3940256099942544~3347511713 (sample ID)
Used ad unit ID : ca-app-pub-3940256099942544/6300978111 (sample ad unit ID)
create new 2d mobile project ->
switch platform to android ->
install admob plugin(import all, enable all) ->
check custom main manifest, custom launcher manifest, custom main gradle template, custom launcher gradle template, custom base gradle template, custom gradle properties template, custom gradle settings template ->
set custom keystore ->
set minimum api level22 ->
set target api level 34 ->
change mono to IL2CPP ->
change NET Standard to NET Framework ->
check ARM64 ->
change package name ->
Set Google Mobile Ads App ID (sample ID : ca-app-pub-3940256099942544~3347511713 Of course, I've also tested my own account in addition to this.)->
ForceResolve->
Build and run (check build app bundle(google play)) ->
call banner ad ->
failed to load ad with error code : 0
Apart from the above methods, I've also tried changing the Unity version and lowering the admob plugin version.
And the picture is jdk, sdk, ndk, gradle from the last build I tried. I used them all as defaults on Unity.
In addition to this, the system environment is set as shown in the picture.
and adb.exe path setting (for device auth )
Below are some logs that are output to the logcat.
Info Unity Loading banner Ad !!
Info Unity #0 0x7604aac128 (libunity.so) ? 0x0
Info Unity #1 0x7604ebd920 (libunity.so) ? 0x0
Info Unity #2 0x76047d7898 (libunity.so) ? 0x0
Info Unity #3 0x76047d77ac (libunity.so) ? 0x0
Info Unity #4 0x7602e015d8 (libil2cpp.so) ? 0x0
Info Unity #5 0x7603c37270 (libil2cpp.so) ? 0x0
Info Unity #6 0x7602e68aec (libil2cpp.so) ? 0x0
Info Unity #7 0x7603e30b44 (libil2cpp.so) ? 0x0
Info Unity #8 0x7603e3013c (libil2cpp.so) ? 0x0
Info Unity #9 0x7603e2fe9c (libil2cpp.so) ? 0x0
Info Unity #10 0x7602d4facc (libil2cpp.so) ? 0x0
Info Unity #11 0x7602d4fa18 (libil2cpp.so) ? 0x0
Info Unity #12 0x76049bb510 (libunity.so) ? 0x0
Info Unity #13 0x76049cabcc (libunity.so) ? 0x0
Info Unity #14 0x76049d85c8 (libunity.so) ? 0x0
Info Unity #15 0x7604855f08 (libunity.so) ? 0x0
Info Unity #16 0x76048ee828 (libunity.so) ? 0x0
Info Unity #17 0x76048ee868 (libunity.so) ? 0x0
Info Unity #18 0x76048eeafc (libunity.so) ? 0x0
Info Unity #19 0x7604a4bebc (libunity.so) ? 0x0
Info Unity #20 0x7604a608e8 (libunity.so) ? 0x0
Info Unity #21 0x760ab5643c (base.odex) ? 0x0
Info Unity
Info ViewRootImpl@30c775e[UnityPlayerActivity] Relayout returned: old=(0,0,720,1480) new=(0,0,720,1480) req=(720,1480)0 dur=8 res=0x1 s={true 508551344128} ch=false
Debug AdsUnity Calling loadAd() on Android
Debug DynamitePackage Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
Info Ads Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("23E44E61FDAF9A1DD0DCF447E9BEFF78")) to get test ads on this device.
Info DynamiteModule Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:243799204
Info DynamiteModule Selected remote version of com.google.android.gms.ads.dynamite, version >= 243799204
Info GASS GassClearcutLogger Initialized.
Debug ConnectivityManager requestNetwork; CallingUid : 10371, CallingPid : 21938
Debug ConnectivityManager requestNetwork; CallingUid : 10371, CallingPid : 21938
Info DynamiteModule Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:243799204
Info DynamiteModule Selected remote version of com.google.android.gms.ads.dynamite, version >= 243799204
Info GASS GassClearcutLogger Initialized.
Warn Ads Invoke Firebase method getInstance error.
Warn Ads The Google Mobile Ads SDK will not integrate with Firebase. Admob/Firebase integration requires the latest Firebase SDK jar, but Firebase SDK is either missing or out of date
Warn ConnectionStatusConfig Dynamic lookup for intent failed for action: com.google.android.gms.ads.service.CACHE
Warn ConnectionStatusConfig Dynamic lookup for intent failed for action: com.google.android.gms.ads.service.START
Debug ConnectivityManager requestNetwork; CallingUid : 10371, CallingPid : 21938
Debug ConnectivityManager requestNetwork; CallingUid : 10371, CallingPid : 21938
Debug ConnectivityManager unregisterNetworkCallback; CallingUid : 10371, CallingPid : 21938
Debug ConnectivityManager unregisterNetworkCallback; CallingUid : 10371, CallingPid : 21938
Error chromium [ERROR:aw_browser_terminator.cc(165)] Renderer process (26611) crash detected (code -1).
Info Ads Ad failed to load : 0
Error Unity Banner view failed to load an ad with error : {
Error Unity "Code": 0,
Error Unity "Message": "Unable to obtain a JavascriptEngine.",
Error Unity "Domain": "com.google.android.gms.ads",
Error Unity "Cause": "null",
Error Unity "Response Info": {
Error Unity "Response ID": "null",
Error Unity "Mediation Adapter Class Name": "",
Error Unity "Adapter Responses": [],
Error Unity "Response Extras": {}
Error Unity }
Error Unity }Error Unity #0 0x7604aac128 (libunity.so) ? 0x0
Error Unity #1 0x7604ebd920 (libunity.so) ? 0x0
Error Unity #2 0x76047d7898 (libunity.so) ? 0x0
Error Unity #3 0x76047d77ac (libunity.so) ? 0x0
Error Unity #4 0x7603c2f4cc (libil2cpp.so) ? 0x0
Error Unity #5 0x7603c2f414 (libil2cpp.so) ? 0x0
Error Unity #6 0x7602d4facc (libil2cpp.so) ? 0x0
Error Unity #7 0x7602d4fa18 (libil2cpp.so) ? 0x0
Error Unity #8 0x76049bb510 (libunity.so) ? 0x0
Error Unity #9 0x76049cabcc (libunity.so) ? 0x0
Error Unity #10 0x7604a76744 (libunity.so) ? 0x0
Error Unity #11 0x76048ee828 (libunity.so) ? 0x0
Error Unity #12 0x76048ee868 (libunity.so) ? 0x0
Error Unity #13 0x76048eeafc (libunity.so) ? 0x0
Error Unity #14 0x7604a4bebc (libunity.so) ? 0x0
Error Unity #15 0x7604a608e8 (libunity.so) ? 0x0
Error Unity #16 0x760ab5643c (base.odex) ? 0x0
Error Unity
Debug InputMethodManager prepareNavigationBarInfo() DecorView@5da8e5[UnityPlayerActivity]
Debug InputMethodManager getNavigationBarColor() -855310
Verbose InputMethodManager Starting input: tba=com.onedropskyclub ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : false , NavTrans : false
Debug InputMethodManager startInputInner - Id : 0
Info InputMethodManager startInputInner - mService.startInputOrWindowGainedFocus
Debug InputTransport Input channel destroyed: 'ClientS', fd=73
Warn MessageQueue Handler (android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate) {48d762} sending message to a Handler on a dead thread
Warn MessageQueue java.lang.IllegalStateException: Handler (android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate) {48d762} sending message to a Handler on a dead thread
Warn MessageQueue
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:558)
Warn MessageQueue
at android.os.Handler.enqueueMessage(Handler.java:754)
Warn MessageQueue
at android.os.Handler.sendMessageAtTime(Handler.java:703)
Warn MessageQueue
at android.os.Handler.sendMessageDelayed(Handler.java:673)
Warn MessageQueue
at android.os.Handler.sendMessage(Handler.java:611)
Warn MessageQueue
at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.sendDisplayEvent(DisplayManagerGlobal.java:1510)
Warn MessageQueue
at android.hardware.display.DisplayManagerGlobal.handleDisplayEvent(DisplayManagerGlobal.java:416)
Warn MessageQueue
at android.hardware.display.DisplayManagerGlobal.access$200(DisplayManagerGlobal.java:73)
Warn MessageQueue
at android.hardware.display.DisplayManagerGlobal$DisplayManagerCallback.onDisplayEvent(DisplayManagerGlobal.java:1453)
Warn MessageQueue
at android.hardware.display.IDisplayManagerCallback$Stub.onTransact(IDisplayManagerCallback.java:128)
Warn MessageQueue
at android.os.Binder.execTransactInternal(Binder.java:1056)
Warn MessageQueue
at android.os.Binder.execTransact(Binder.java:1029)
Error libOpenSLES frameworks/wilhelm/src/android/AudioPlayer_to_android.cpp:1254: pthread_mutex_lock_timeout_np returned 110
Debug PlayerBase::stop() from IPlayer
Debug AudioTrack stop(3472): called with 5200704 frames delivered
Info ViewRootImpl@30c775e[UnityPlayerActivity] stopped(true) old=false
Info SurfaceView windowStopped(true) false com.unity3d.player.a{943980c VFE...... .F....I. 0,0-720,1480 #7f07013d app:id/unitySurfaceView} of ViewRootImpl@30c775e[UnityPlayerActivity]
Info SurfaceView surfaceDestroyed callback.size 1 #1 com.unity3d.player.a{943980c VFE...... .F....I. 0,0-720,1480 #7f07013d app:id/unitySurfaceView}
Info SwappyDisplayManager Terminating looper thread
Info SurfaceView remove() com.unity3d.player.a{943980c VFE...... .F....I. 0,0-720,1480 #7f07013d app:id/unitySurfaceView} Surface(name=SurfaceView - com.onedropskyclub/com.unity3d.player.UnityPlayerActivity@943980c@0)/@0x250c0d7
Info ViewRootImpl@30c775e[UnityPlayerActivity] MSG_WINDOW_FOCUS_CHANGED 0 1
Debug InputMethodManager prepareNavigationBarInfo() DecorView@5da8e5[UnityPlayerActivity]
Debug InputMethodManager getNavigationBarColor() -855310
Info SurfaceView onWindowVisibilityChanged(8) false com.unity3d.player.a{943980c VFE...... .F....I. 0,0-720,1480 #7f07013d app:id/unitySurfaceView} of ViewRootImpl@30c775e[UnityPlayerActivity]
Info ViewRootImpl@30c775e[UnityPlayerActivity] Relayout returned: old=(0,0,720,1480) new=(0,0,720,1480) req=(720,1480)8 dur=8 res=0x5 s={false 0} ch=false
Info ViewRootImpl@30c775e[UnityPlayerActivity] Relayout returned: old=(0,0,720,1480) new=(0,0,720,1480) req=(720,1480)8 dur=4 res=0x1 s={false 0} ch=false
Info FA-Ads Application backgrounded at: timestamp_millis: 1731424576986
Info ViewRootImpl@30c775e[UnityPlayerActivity] Relayout returned: old=(0,0,720,1480) new=(0,0,720,1480) req=(720,1480)8 dur=10 res=0x1 s={false 0} ch=false
Info ViewRootImpl@30c775e[UnityPlayerActivity] Relayout returned: old=(0,0,720,1480) new=(0,0,720,1480) req=(720,1480)8 dur=14 res=0x1 s={false 0} ch=false
===================================================================
This is just one of the many ways I've tried it. I've tried changing ad unit id and admob id, and I've tried changing Unity, admob plugin, and gpgs versions.
I've also tried installing jdk, sdk, ndk with Android studio.
I also tried modifying proguard, manifest.
I've also tried the sample code provided by Google for ad testing.
However, I found that the test ad is not working even in the clean build.
All methods eventually failed with "failed load ad with error code:0".
I've heard that ads block shouldn't be installed, but it doesn't seem to be installed on my device.
I don't think I can solve it on my own, so I'm asking for help here.