Open Sahil-pixel opened 2 years ago
Can you share the logcat output of the android app?
code
from kivy.app import App
from kivy.uix.button import Button
from kivmob import KivMob, TestIds
class MyApp(App):
def build(self):
self.ads = KivMob(TestIds.APP)
self.ads.new_banner(TestIds.BANNER, top_pos=True)
self.ads.request_banner()
self.ads.show_banner()
return Button(text="Hello")
MyApp().run()
: [INFO ] [Python ] v3.8.9 (default, Mar 14 2022, 15:35:32)
03-16 13:22:15.920 32277 32306 I python : [Clang 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec7462
03-16 13:22:15.921 32277 32306 I python : [INFO ] [Python ] Interpreter at ""
03-16 13:22:18.471 32277 32306 I python : [INFO ] [Factory ] 186 symbols loaded
03-16 13:22:19.188 32277 32306 I python : [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2 (img_pil, img_ffpyplayer ignored)
03-16 13:22:19.253 32277 32306 I python : [INFO ] [Text ] Provider: sdl2
03-16 13:22:22.812 32277 32306 I python : [INFO ] [KivMob ] init called.
03-16 13:22:22.812 32277 32306 I python : [INFO ] [KivMob ] Android platform detected.
03-16 13:22:22.815 32277 32306 I python : [INFO ] [KivMob ] new_banner() called.
03-16 13:22:22.823 32277 32306 I python : [INFO ] [KivMob ] request_banner() called.
03-16 13:22:22.826 32277 32306 I python : [INFO ] [KivMob ] show_banner() called.
03-16 13:22:23.099 32277 32306 I python : [INFO ] [Window ] Provider: sdl2
03-16 13:22:23.144 32277 32306 I python : [INFO ] [GL ] Using the "OpenGL ES 2" graphics system
03-16 13:22:23.146 32277 32306 I python : [INFO ] [GL ] Backend used
That looks pretty normal. How does your buildozer.spec file look?
Actually, after looking at your code again, you are attempting to show a banner ad immediately after loading the banner ad in the build function of your app. You should have some callback associated with on_click that shows the banner ad only if one has been loaded.
@MichaelStott Actually I did..... But still ads ain't showing.
2 years on I know but I've got the same issue. App compiles fine but doesn't show the test banner ad.
buildozer.spec file (relevant parts):
requirements = python3,kivy,sqlite3,kivymd==1.2.0,kivmob
android.permissions = android.permission.INTERNET, (name=android.permission.WRITE_EXTERNAL_STORAGE;maxSdkVersion=18), ACCESS_NETWORK_STATE
android.api = 33
android.minapi = 21
android.sdk = 33
android.ndk = 25b
android.gradle_dependencies = com.google.firebase:firebase-ads:21.4.0
android.enable_androidx = True
in my main.py file:
from kivymob import KivMob, TestIds
ads = KivMob("ca-app-pub-3940256099942544~3347511713")
def build(self):
self.ads.new_banner(TestIds.BANNER, False)
self.ads.request_banner()
self.ads.show_banner()
I tried to look at the logs but when I run buildozer android debug deploy run logcat it instantly prints a load of gibberish to the console, which means I can't read the logs.
Is there something I'm doing wrong? I downloaded kivmob through Pycharm. I know above it's mentioned to have a callback after on_click to load the ad but surely that isn't needed as I want the ad to appear as the user loads the first page, I don't want them to have to click a button to see the ad.
I build hello world app with test mode but no test ads showing .