Closed SivaramNalliboyana closed 4 years ago
Edit: I don't know why but when I implement only one ad the error is coming too. Now I can see the banner ad but the app immediately closes. Without the ad, the app is working
This is because you created two same ad instances in your code.You are allowed to create One Ad Instance. If you want to create multiple ad instance then give them some other name.
delete self.ads = KivMob("ca-app-pub-XXXXXXXXXXXX") self.ads.add_test_device("*****")
that will fix error
No succes, I also reinstalled everythink but it is not working Here is my full code, maybe I did something wrong in the py file `class MainApp(App):
def build(self):
return GUI
def change_screen(self,screen_name):
# get the screen manager from the kv file
screen_manager = self.root.ids['screen_manager']
screen_manager.current = screen_name
# screen_manager = self.root.ids
def on_start(self):
self.ads = KivMob("ca-app-pub-***************")
self.ads.new_interstitial("ca-app-pub-*************")
self.ads.add_test_device("***********")
self.ads.request_interstitial()
self.ads.new_banner("ca-app-pub-************",top_pos=False)
self.ads.request_banner()
self.ads.show_banner()
from kivy.base import EventLoop
EventLoop.window.bind(on_keyboard = self.hook_keyboard)
def hook_keyboard(self,window,key,*largs):
if key == 27:
# write whatever u want
self.change_screen("home_screen")
return True
def on_resume(self):
self.ads.request_interstitial()
MainApp().run() ` Could anybody please check and see. Now I even cant display one ad
Writing all the ads related code under build method may fix the errors As the objects and ad requests will be sent as soon the app starts.
Because build method is called only once and is used for initializing the app.
@GrandmasterSivaram It's difficult to say. You are trying to present the ad immediately after calling request_banner/interstitial, so it's possible that it hasn't loaded yet. Can you share your logcat output?
Hi michael could you show me a sample py file how I could write it. Because I just copied from the docs and it worked for one day. . Ya sure I will show the logcat output. Thank u for the help
this is my logcat output. As you can see at the end i have the error reference error my_log.txt
Please add buildozer.spec too for resolving this issue
title = UQUiz
package.name = UQUiz
package.domain = org.sivaram
source.dir = .
source.include_exts = py,png,jpg,kv,atlas
version = 0.1
requirements = python3,kivy,android,jnius,kivmob
presplash.filename = %(source.dir)s/logo_flash.png
icon.filename = %(source.dir)s/logo.png
orientation = portrait
#
#
#
osx.python_version = 3
osx.kivy_version = 1.9.1
#
#
fullscreen = 0
android.permissions = INTERNET,ACCESS_NETWORK_STATE
android.api = 28
android.minapi = 21
android.sdk = 24
android.ndk = 19b
android.gradle_dependencies ='com.google.firebase:firebase-ads:10.2.0'
android.meta_data =com.google.android.gms.ads.APPLICATION_ID=ca-app-pub-***
android.logcat_filters = *:S python:D
android.arch = armeabi-v7a
#
#
p4a.branch = master
#
#
ios.kivy_ios_url = https://github.com/kivy/kivy-ios ios.kivy_ios_branch = master
ios.ios_deploy_url = https://github.com/phonegap/ios-deploy ios.ios_deploy_branch = 1.7.0
[buildozer]
log_level = 2
warn_on_root = 1
#
#
#
#
#
#
#
#
#
#
I have gone through the logs and buildozer and found a Warning in the log which says
Base provider unknown
Hi no my android version is 7.0. Do you guys think that my code is correct,because when yes it should be a problem with my phone,
Recheck requirements check your whole code if you imported any other module and didn't reference it in buildozer.spec requirements line
And then do a clean build by this command buildozer android clean
after clean building half way I get the error : Error while finding module specification for cython.Build.Cythonize. And I already have cython. I get the erro beacause of jnius
Update all dependencies one more time by sudo apt-update Then rebuild app by buildozer android debug
Moreover this is not a kivmob issue By the way this is a python issue.
@GrandmasterSivaram Just checking, are you still having issues here?
unfortunately yes
Closing it now. Because I think it was issue of my code. My another app is working with banner ads
I am implementing banner and interstitial ads with kivmob. When I only add banner ads, and not interstitial ads, the programm is working. When I only add interstitial ads and no banner ads, the programm is working too.I can see the ads on my phone. But when I add both of them I am getting the error in logcat: Reference Error- weakly referenced object no longer exits. Another thing to mention is that it worked yesterday perfectly, but somehow today it is not working and I did not change any code. It would be great if anybody could help me This is my code
This is the error