See How it works part
Modules included in the snapshotted bundle can still contain native
API calls given that they are not evaluated immediately upon module
loading. For example, the following module:
require("application");
var time = new android.text.format.Time(); can’t be snapshotted
because it touches android.text.format.Time API which is not
available. However, in this one:
require("application");
function getTime() {
return new android.text.format.Time(); } the native API access is not evaluated on module execution. Given that getTime() is called
later in the fully featured V8 context provided by the Android
runtime, we are safe to include the module in the snapshotted bundle.
If the snapshotting step fails because of a reference to an undefined
API, try some of the following solutions:
If you can change the module containing the forbidden API call, wrap
the guilty code in a function that is called once the app is running
on device Keep the module in the bundle but make sure all require
calls of the non-snapshotable module are executed once the app is
running on device: require("application"); var m =
require("non-snapshotable-module");
function doSomething() {
return m.someMethod(); } The code above has a higher chance to be successfully snapshotted if it loads the non-snapshotable module when
it actually needs it:
require("application");
function doSomething() {
return require("non-snapshotable-module").someMethod(); } If doSomething() function is never called in snapshot context, the
non-snapshotable module will not be evaluated and blob generation will
succeed.
Exclude the module containing the forbidden API call from the
snapshotted bundle.
So make sure you are not referencing com
in snapshot time.