I started to wrap a native plugin into NativeScript plugin. I use sneaker plugin. When I used the Custom method to set the color as following:
android.R.color.white
I noticed a significant delay on the first tap of the button. Then I just removed it and just logged the color:
console.log(android.R.color.white);
// Also this freeze:
let x = android.R;
But:
// this doesn't freeze"
let x = android;
Any idea?
@vahidvdn I've tested your scenario via this project but everything is working with no delays or freezing (here is the actual code used). Please check the project and let me know if there is something more specific on your side and also if the issue is reproducible on a specific API level (device) and with the test project.
@NickIliev You are accessing android.R in constructor first. The delay happens in just first access. So, it happens while you see the splash screen.
So, just remove it from the constructor and add it to a button tap event to see the result. If still couldn't be able to reproduce it, please let me know.
I've added the constructor logic at later point. Even without it, I am still not experiencing any difference (I've just revised the project to exclude the constructor logic)
@NickIliev and @vahidvdn i think this is related to https://github.com/NativeScript/android-runtime/issues/1330
Closing the issue as related to the one linked above
@NickIliev Sorry, but your repo size was really huge, and couldn't get it. Btw, I provide a playground demo. Would you please test it, and see the result? https://play.nativescript.org/?template=play-ng&id=kAkQLP
For my device I get:
[Vahid]: js access: 0.00ms
[Vahid]: native access: 901.00ms
Most helpful comment
@NickIliev and @vahidvdn i think this is related to https://github.com/NativeScript/android-runtime/issues/1330