• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Android AdMob Reward Video crashes before show up

Good afternoon.

I really need help. I've been trying to create a Reward video Ad in my game for 2 months and I can't. Nothing special: after the game over, the player click the button to watch the video and gain 15 XP'orbs.

My code
----------
obj_admob (first object to load)
- Game start

GML:
// GAME START EVENT
if (os_type == os_android) {
    ads_app_id= "MEU COD ID DO AD-MOB";                        // original code
    rewarded_id= "ca-app-pub-3940256099942544/5224354917";     // teste code
}

// Initialize extension
GoogleMobileAds_Init("", ads_app_id);
GoogleMobileAds_LoadRewardedVideo(rewarded_id);
rewarded_loaded = false;
rewarded_viewed = false;

- Async (social) same object

GML:
//Check for async_load ds_map
var _id = async_load[? "id"];
if (_id == GoogleMobileAds_ASyncEvent) {
    var ident = async_load[? "type"];
    
    switch(ident) {
        case "rewardedvideo_adloaded":
            rewarded_loaded = true;   
            show_message_async("Rewarded loaded");     
        break;
        case "rewardedvideo_adopened":
            rewarded_viewed = false;
            show_message_async("Rewarded Opened");     
        break;
        case "rewardedvideo_videostarted":
            show_message_async("Rewarded Startedd");   
        break;
        case "rewardedvideo_watched":
            rewarded_viewed = true;
            show_message_async("Rewarded Watched");
            //Give player the bennefit using async_load[? "currency"] and async_load[? "amount"]
            vgXP += 15;
        break;
        case "rewardedvideo_adclosed":
        // error message
        break;
    }
}

Obj_admob is the first to load in the game and is PERSISTENT

In the object where I click for show the video I put the code:
obj_hudgameover (step event)
GML:
if (device_mouse_check_button_pressed(0, mb_left) && point_in_rectangle( ...ARGUMENTS... ) ) {
        scr_sfx( sfx_button2, false );
        if (obj_admob.rewarded_loaded == true )
        {
            GoogleMobileAds_ShowRewardedVideo();
            obj_admob.rewarded_loaded = false;
        }else{
            GoogleMobileAds_LoadRewardedVideo(obj_admob.rewarded_id);
        }
}

I'm testing on my Xiaomi via GM studio 2 (IDE v2.2.5.481 | runtime v2.2.5.378). When I click the button, the game crashes instantly without a error message. The following message appears on the GM console:

05-01 16:12:46.114 25330 25330 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-01 16:12:46.114 25330 25330 F DEBUG : Build fingerprint: 'xiaomi/cereus/cereus:9/PPR1.180610.011/V11.0.3.0.PCGMIXM:user/release-keys'
05-01 16:12:46.115 25330 25330 F DEBUG : Revision: '0'
05-01 16:12:46.115 25330 25330 F DEBUG : ABI: 'arm'
05-01 16:12:46.115 25330 25330 F DEBUG : pid: 24917, tid: 24986, name: GLThread 54218 >>> ...APP NAME... <<<
05-01 16:12:46.115 25330 25330 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x15
05-01 16:12:46.115 25330 25330 F DEBUG : Cause: null pointer dereference
05-01 16:12:46.115 25330 25330 F DEBUG : r0 00000015 r1 00000015 r2 00000000 r3 00000003
05-01 16:12:46.116 25330 25330 F DEBUG : r4 00000000 r5 901dda2c r6 9122e162 r7 901dd62c
05-01 16:12:46.116 25330 25330 F DEBUG : r8 901ddad8 r9 00000000 r10 00000001 r11 8000002f
05-01 16:12:46.116 25330 25330 F DEBUG : ip 80000000 sp 901dd528 lr af614499 pc af5e4c1c
05-01 16:12:46.139 25330 25330 F DEBUG :
05-01 16:12:46.139 25330 25330 F DEBUG : backtrace:
05-01 16:12:46.139 25330 25330 F DEBUG : #00 pc 0001ac1c /system/lib/libc.so (strlen+24)
05-01 16:12:46.139 25330 25330 F DEBUG : #01 pc 0004a495 /system/lib/libc.so (__vfprintf+3224)
05-01 16:12:46.140 25330 25330 F DEBUG : #02 pc 0005f0e5 /system/lib/libc.so (vsnprintf+108)
05-01 16:12:46.140 25330 25330 F DEBUG : #03 pc 00006b25 /system/lib/liblog.so (__android_log_vprint+40)
05-01 16:12:46.140 25330 25330 F DEBUG : #04 pc 001e92a4 /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (TRelConsole::Output(char const*, ...)+128)
05-01 16:12:46.140 25330 25330 F DEBUG : #05 pc 00410ce0 /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (Ext_Call(int, int, RValue*, RValue*)+420)
05-01 16:12:46.140 25330 25330 F DEBUG : #06 pc 0045a444 /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (YYGML_CallExtensionFunction(CInstance*, CInstance*, YYRValue&, int, int, YYRValue**)+628)
05-01 16:12:46.141 25330 25330 F DEBUG : #07 pc 001372c0 /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (gml_Object_obj_hud_gameover_Step_0(CInstance*, CInstance*)+10328)
05-01 16:12:46.141 25330 25330 F DEBUG : #08 pc 001e6880 /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (ExecuteIt(CInstance*, CInstance*, CCode*, RValue*, int)+84)
05-01 16:12:46.141 25330 25330 F DEBUG : #09 pc 001e6ae0 /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (Code_Execute(CInstance*, CInstance*, CCode*, RValue*, int)+20)
05-01 16:12:46.141 25330 25330 F DEBUG : #10 pc 001f4cf4 /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (CEvent::Execute(CInstance*, CInstance*)+76)
05-01 16:12:46.141 25330 25330 F DEBUG : #11 pc 001f5010 /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (Perform_Event_Object_ASync(CInstance*, CInstance*, int, int, int)+244)
05-01 16:12:46.141 25330 25330 F DEBUG : #12 pc 001f518c /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (Perform_Event(CInstance*, CInstance*, int, int)+152)
05-01 16:12:46.142 25330 25330 F DEBUG : #13 pc 003c1bfc /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (HandleStep(int)+236)
05-01 16:12:46.142 25330 25330 F DEBUG : #14 pc 003c8a04 /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (DoAStep()+572)
05-01 16:12:46.142 25330 25330 F DEBUG : #15 pc 003c9330 /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (MainLoop_Process()+1372)
05-01 16:12:46.142 25330 25330 F DEBUG : #16 pc 002824fc /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/lib/arm/libyoyo.so (Java_com_yoyogames_runner_RunnerJNILib_Process+1016)
05-01 16:12:46.142 25330 25330 F DEBUG : #17 pc 000011ab /data/app/...APP NAME...-m3h3Y3wVB8KopwAE_e1vgw==/oat/arm/base.odex (deleted) (offset 0x33000)

I know that the error happens in the line of code "GoogleMobileAds_LoadRewardedVideo (obj_admob.rewarded_id)" that is inside the button, but I don't know why.

I do not know what happens. I followed many tutorials. I did exactly as they were and modified it a little ... it never worked in 2 months.
Can anyone help me with this almost impossible task?
 
Top