Skip to content

addImageAsync fails to invoke function callback #11891

Open
@PeqNP

Description

@PeqNP

This issue happens ONLY when the app is first ran on a fresh Android device. Every time thereafter it appears to work without issue. I received several errors from WebKit stating that certain tables did not exist. The result was that the function callback was never called.

I lost most of the debug messages which emitted the necessary tables to be created. I did happen to save one:

DELETE FROM CacheGroups

It appears that the table CacheGroups is being cleared before the table is created.

I believe what is happening is that these tables need to be created before the WebView; which I assume is used to load the images asynchronously on Android. The thing is, I don't know whose responsibility it is to do this! Is it Android's? Or is it Cocos2d-x's? I see absolutely no reference to CacheGroups within the code; so I suspect there is some initialization that is not being performed from within the Android API.

As a workaround I'm simply going to add a FAQ, on our support page, to let the player know that they may need to restart the app if the game appears to hang after certain events; as there is absolutely no way for me to check if something went awry from within the API... well, I could add a delay and check to see if the particular process took longer than N seconds... but I really do not want to do that. I can just see it now... "Hey! We couldn't load a texture, which should have only taken 0.3 seconds! Restart the app now to correct the issue!" Yuck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions