Android Question [admob] problem with keystore

Waldemar Lima

Active Member
Licensed User
hello everyone !!

i am trying insert a advertsing on my application ...
but I found a problem in the keystore ...

if I go into "tool -> Private Signature" and select "Use debug key", the ad is displayed ...
if I create a new key or use an existing one, the ad does not display and the "Admob Error: 3"

i am using this code :
#Region  Project Attributes
    #ApplicationLabel: Admob
    #VersionCode: 1
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region
#BridgeLogger: true

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals

    Private BannerAd As AdView
    Private IAd As InterstitialAd
    Private re As RewardedVideoAd
    Private Button1 As Button
    Private Button2 As Button
    Private Button3 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)

    Dim AdPanel As Panel
    AdPanel.Color = 0xFFFFFFFF
    Dim height As Int
    BannerAd.Initialize2("BannerAd", "ca-app-pub-85hgyuftugyftugilyukftgt", BannerAd.SIZE_SMART_BANNER)
    AdPanel.AddView(BannerAd, 0dip, 0dip, AdPanel.Width, AdPanel.Height)
    IAd.Initialize("iad", "ca-app-pub-9293>><<><<><><><><<") 'aqui é instersticial
End Sub

Sub Activity_Resume

End Sub

Sub BannerAd_FailedToReceiveAd (ErrorCode As String)
    Log("Error : "&ErrorCode)
End Sub

Sub IAd_FailedToReceiveAd (ErrorCode As String)
    Log("Error : "&ErrorCode)
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button2_Click  'coloca o banner como invisivel
BannerAd.Visible = True
End Sub

Sub Button1_Click
    If IAd.Ready Then
        IAd.Show 'aparece o intersticial quando clicar nesse bt
        Log("not now")   
    End If
End Sub

Sub Button3_Click 'coloca o banner como visivel
    BannerAd.Visible = False
End Sub

Does anyone know how to fix this?
I appreciate the attention

Waldemar Lima

Active Member
Licensed User
Thanks by your attention :D @Erel .

Error code 3 = no fill. It means that currently there are no ads to serve. In most cases it will start working properly after 24 hours.

But using 'Debug Key' the advertising show ...

if I go into "tool -> Private Signature" and select "Use debug key", the ad is displayed ...
if I create a new key or use an existing one, the ad does not display and the "Admob Error: 3"
Upvote 0

Waldemar Lima

Active Member
Licensed User
The day before yesterday I had to unlink my default key, but I forgot to ...

I then recreated another key, and the admob returned only "Admob Error 3", hence I changed to the debug key ... which the ad is displayed without any problem!

today I am a friend (we 2 have B4A licenses) we spent all day testing to find the reason for the error ...
the same code that I compile on my machine, also compiles on her machine, the difference is that when she compiles on her machine, the ad is displayed (with release key & with debug key).

I installed b4a on another computer I have here, but it still has the same problem ...
I sent my release key to use it to compile on her computer, but when she uses my key, the same errors that occur when compiling an app on my machine are displayed ...

she sent me the apk compiled on her machine, and it works perfectly ..

I sent the compiled apk on my machine, Admob error 3 occurs .

What should be the reason for the problem?
Upvote 0

Douglas Farias

Licensed User
i checked this too.
i think is some problem on keystore generated on B4A 9+

3 days ago i tryed make a new keystore for my app, in B4A 9. and i only get error 3 too.
its the same banner and intersticial, this is working on my old key, but with new key no.

Later i tested with some old key. and works fine.

B4A 9 = error 3
B4A 5= normal working (i generated my old key on b4a 5)

the error is only with keystore new (new version of b4a)

the solution I found was to use a key generated in an old version of b4a. now it's normal
Last edited:
Upvote 0


Active Member
Licensed User
Upvote 0