Error: _cbMap.3694416643

30 views
Skip to first unread message

Ferhat

unread,
Sep 9, 2026, 4:54:15 PM (8 days ago) Sep 9
to DroidScript

I converted my project into an APK to test it, but I get this error every time I open it. I’ve converted several other projects into APKs before, and they worked without any issues. I’m not sure what could be causing this error.


Screenshot_20260909-234025.png

Ferhat

unread,
Sep 10, 2026, 2:14:14 AM (8 days ago) Sep 10
to DroidScript
Solved — root cause:
The issue was a _cbMap.xxxxx is not a function error, and it only happened in the compiled APK/AAB, about 1 second after the app launched (never showed up when testing inside the DroidScript IDE).

The cause: on app startup, an asynchronous native call that fetches information from Google Play (think along the lines of a purchase/license status check) was being fired unconditionally, before the page had even fully finished loading. The native response for that call happened to arrive right during that same first second, while the app's own startup workload (script parsing, UI setup, event binding) was still in full swing. Under that load, DroidScript's native-JS bridge failed to match the callback correctly, and when it tried to invoke an entry it couldn't find in _cbMap, it threw the error — basically a classic race condition (timing conflict).

Why it only showed up in the APK and not the IDE: in the IDE preview, that native call doesn't establish a real service/server connection, so it just gets silently skipped. In a real signed APK, the connection is actually made and the async response actually comes back — which is exactly what triggered the error there and nowhere else.

Fix: delaying that startup call until the page has fully loaded and the main thread is idle (window.onload + a short setTimeout). That way, by the time the native response arrives, the bridge is "calm" and the callback matches up fine.

Summary: this wasn't a logic bug in the code — it was a timing conflict between an async native call fired too early at startup and the native callback bridge. If anyone else runs into this with a similarly early-firing native call, delaying it a bit usually fixes it.

Since my project is heavily web-based, Dave’s response in this discussion helped me determine that the issue was related to callbacks: https://groups.google.com/g/androidscript/c/QHCQDdae5K4/m/awNT67EJAwAJ


9 Eylül 2026 Çarşamba tarihinde saat 23:54:15 UTC+3 itibarıyla Ferhat şunları yazdı:
Reply all
Reply to author
Forward
0 new messages