Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create AdRequest instance #124

Closed
jasoniem9246 opened this issue Aug 6, 2014 · 2 comments
Closed

Cannot create AdRequest instance #124

jasoniem9246 opened this issue Aug 6, 2014 · 2 comments

Comments

@jasoniem9246
Copy link

Hi,

I'm trying to install AdMob on Kivy. I import AdRequest successfully but cannot create its instance.

AdRequest = autoclass("com.google.android.gms.ads.AdRequest")
print "AdRequest: ", AdRequest
print dir(AdRequest)

In the logcat, I can see the properties and methods of AdRequest by dir() :

AdRequest <class 'jnius.reflect.com.google.android.gms.ads.AdRequest'>
['DEVICE_ID_EMULATOR', 'ERROR_CODE_INTERNAL_ERROR', 'ERROR_CODE_INVALID_REQUEST', 'ERROR_CODE_NETWORK_ERROR', 'ERROR_CODE_NO_FILL', 'GENDER_FEMALE', 'GENDER_MALE', 'GENDER_UNKNOWN', 'MAX_CONTENT_URL_LENGTH', '__class__', '__cls_storage', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__javaclass__', '__javaconstructor__', '__module__', '__new__', '__pyx_vtable__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'equals', 'getBirthday', 'getClass', 'getContentUrl', 'getCustomEventExtrasBundle', 'getGender', 'getKeywords', 'getLocation', 'getNetworkExtras', 'getNetworkExtrasBundle', 'hashCode', 'isTestDevice', 'notify', 'notifyAll', 'toString', 'wait']

AttributeError: type object 'com.google.android.gms.ads.AdRequest' has no attribute 'Builder'
Python for android ended.

I cannot find the Builder method
https://developer.android.com/reference/com/google/android/gms/ads/AdRequest.html
It's a class method to build AdRequest

@jasoniem9246
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants