Android 10 issue - The ClassLoaderContext is a special shared library.

1,876 views
Skip to first unread message

Nick Michael

unread,
Mar 21, 2021, 1:48:10 PM3/21/21
to Kivy users support
Hi,

My live app is working on Android 9 and lower but has problems working on Android 10.
I'm using kivy==master and branch==developer in the buildozer spec. I borrowed an Android 10 phone and managed to obtain a log. I think it has something to do with set_rewarded_ad_listener() call.

Snippet of log below (full log attached):

03-21 19:05:30.982 18943 18977 I python  : [INFO   ] [KivMob      ] __init__ called.
03-21 19:05:30.982 18943 18977 I python  : [INFO   ] [KivMob      ] Android platform detected.
03-21 19:05:30.983 18943 18977 I python  : [INFO   ] [KivMob      ] set_rewarded_ad_listener() called.
03-21 19:05:30.985 18943 18977 F onkeybuster204: indirect_reference_table.cc:60] JNI ERROR (app bug): accessed deleted Global 0x8a22
03-21 19:05:30.990 18943 18943 I onkeybuster204: The ClassLoaderContext is a special shared library.
03-21 19:05:30.992 18943 18943 I chatty  : uid=10594(org.nikosgrikos.monkeybuster2048) identical 1 line
03-21 19:05:30.995 18943 18943 I onkeybuster204: The ClassLoaderContext is a special shared library.
03-21 19:05:31.055 18943 18977 F onkeybuster204: runtime.cc:630] Runtime aborting...

Any help would be appreciated
Nick

log2.txt

Robert

unread,
Mar 21, 2021, 4:00:21 PM3/21/21
to Kivy users support
I know nothing of KivMob but this looks like it might be a garbage collection issue.
Any time Pyjnius is used there are two garbage collectors (Python and Java) working on the same heap, and they don't know each other's boundaries. This became a more common issue when p4a started using Python 3.8, which has more aggressive gc.

So lets try a test to see if this is the issue, we make an extra class variable to tell the Python garbage collector not to cleanup where Java is working.

Looking in at the KivMob example ( http://kivmob.com/tutorials.html#rewarded-video ) I see (so I expect you have something similar):
self.ads.set_rewarded_ad_listener(RewardedListenerInterface())

Change to:
self.rli = RewardedListenerInterface()
self.ads.set_rewarded_ad_listener(self.rli)

If this addresses the issue then look for similar cases.
And obviously arguments that are scalars will not be an issue.

If this is not the issue maybe somebody else has a suggestion?

Nick Michael

unread,
Mar 22, 2021, 8:16:53 AM3/22/21
to kivy-...@googlegroups.com
Hi Robert,

Thanks for your reply. I actually have the following so I'm not sure how to incorporate the code change and how it would help.


from kivmob import KivMob, TestIds, RewardedListenerInterface
...


# Create the reward advert for displaying in game
self.rewards = RewardsHandler()
self.ad3 = KivMob(ADMOB_APP_ID)
self.ad3.set_rewarded_ad_listener(self.rewards)
self.load_video()

...


class RewardsHandler(RewardedListenerInterface):

def __init__(self):
Awards.HINT = False
Awards.LOG = 0

def on_rewarded(self, reward_name, reward_amount):
Awards.HINT = True
Awards.LOG = 2

def on_rewarded_video_ad_completed(self):
self.on_rewarded("Reward",1)
Awards.LOG = 3
...


Let me know if you would like me to try something accordingly.

Thanks

Nick

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/0b11f407-faba-4727-af6a-894f928a91efn%40googlegroups.com.

Robert

unread,
Mar 22, 2021, 1:02:27 PM3/22/21
to Kivy users support
That looks like it does not have the issue that is in the documentation.

I don't have any other suggestions. But it does look like a gc issue.

Nick Michael

unread,
Mar 24, 2021, 2:16:38 PM3/24/21
to Kivy users support
If I take the call to set_rewarded_ad_listener() out, the application functions normally on Android 10, but I don't want to do that as reward ads play an important role in the application.
I wonder if anyone else has experienced the same problem or has a resolution on this issue or something I can try out.
Reply all
Reply to author
Forward
0 new messages