Nativescript: Nativescript + Angular , "random" UI FREEZE and ANR issues!

Created on 16 May 2017  Â·  51Comments  Â·  Source: NativeScript/NativeScript

Did you verify this is a real problem by searching [Stack Overflow]

It is a real problem because i have tested it and few of the users already use the app.
I also have been searching for similar issues for a few days now.

Tell us about the problem

The problem is. The app is smooth for a certain period of time , let's say 5 10 minutes, and then
all of a sudden at a random points in time (maybe after selecting an article and a popup dialog opens)
it freezes for a second and then it continues. Few times i had problems when navigating (after navigation) it freezes for a few seconds and it continues (sometimes i get the native not responding dialog). I have seen this issues on 3 or more devices(not that they were top notch units of hardware).

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 2.5.4
  • Cross-platform modules: 3.0.0
  • Runtime(s): 3.0.0 (tns-android)
  • Plugin(s): (all the deps):
    "dependencies": {
    "angular/animations": "~4.1.0",
    "angular/common": "~4.1.0",
    "angular/compiler": "~4.1.0",
    "angular/core": "~4.1.0",
    "angular/forms": "~4.1.0",
    "angular/http": "~4.1.0",
    "angular/platform-browser": "~4.1.0",
    "angular/router": "~4.1.0",
    "nativescript-angular": "~3.0.0",
    "nativescript-cardview": "^2.0.0-rc.0",
    "nativescript-checkbox": "^1.2.8",
    "nativescript-floatingactionbutton": "^3.0.0",
    "nativescript-ngx-fonticon": "^2.2.0",
    "nativescript-ripple": "^1.1.0",
    "nativescript-snackbar": "^1.1.6",
    "nativescript-telerik-ui": "^2.0.1",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.3.0",
    "tns-core-modules": "~3.0.0"
    }

Please tell us how to recreate the issue in as much detail as possible.

For now i would be glad if you can just pin point what might be the problem (where should i seek the answer).
I know about the gc() and --expose_gc flag in package.json. And i did upgrade from 2.5.x to 3.0.0 because i thought that would be a good idea.
p.s. i would love to know how can i profile the app (check device resources ram cpu load ...etc.)
p.s.2 i am new to the android world so bare with me :)

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

Not at the moment , but if i struggle some more with this i can provide u with debug version so u can run it ...

android

Most helpful comment

Since I start using "markingMode": "none" flag, everything looks good on Android,
Ref : https://www.nativescript.org/blog/announcing-the-release-of-nativescript-3.2.
Thanks

All 51 comments

@Dimitrievskislavcho indeed providing us with a sample application to work with would be great!
There might be multiple reasons for this to happen (heavy-load API calls, GC calls on navigations, etc.) so working with a sample application to investigate this further is a must.

When providing the sample code you can also specify on what devices/emulators you are using for testing.

@Dimitrievskislavcho FYI we have currently dedicated some resources to this task which is related to tracking performance improvements so you can track this thread for tracking techniques.

I'm having these issue as well, I've profiled the app using Debug Inspector and it seems like nothing is going on. I've noticed these in two different scenarios:

  • Changing pages
  • ListView's scroll + TabView changing

@NickIliev Thanks for giving me directions mate. I had something else the past two days and that is why i didn't have time for some profiling and perf testing. I'll check the link you've provided for me.

Hello there again. @NickIliev i tried to do some profiling today but i guess i failed at doing so. Since i am really new to the android dev or android at all i don't really know how and with what tools i should do the profiling. I tried using android monitor but i am guessing there is no GUI for real time profiling (or it's just me and i have no idea what am i doing). The thing is i want to lose my time pinpointing the problems i have not yours :). I want to know how to do profiling and see cpu, gpu and mem usage while i run my app and while i go through my working flow with the app. The problem persists when i click on the groups and some rendering is needed like in ng-repeat with nested angular components and so. And of course the good ol' navigation go to page and destroy this one scenario.
p.s. sorry about the long text.
p.s.2 if you can reopen this issue i would gladly post here so other people can relate to my problem.
p.s.3 i had the crash not responding message after few minutes of work again.

@NickIliev @Cayan Hello guys. The noob that i am, i finally got how to do some proper profiling while running the app :). The screenshot is after this boring text i will write.

-> the ui was blocked for like 10 seconds, as you can see on this SS(it happens on couple of different occasions -> i will describe these after the screenshot).
-> the page has router outlet with 2 navigation routes, one is a bit heavier of the other, it has levels of selectable items (for in for, items of items [ [item1, item,2] [item3 item4] [item5 item 6] ]). So for example when you click item 4 it updates the main array of items and if it is a leaf item that holds articles it sets the articles and shows the listView with articles (which is a repeat of article component)
-> the blockage on this page happens either on navigation from this router-outlet subpage to the other that is a bit simpler than this one or it happens when i play with these items and select different item on different level so it can show articles. Sometimes the ui blocks when i select an article of the list and a dialog opens (simple dialog).

the articles page (the 'heavier subpage') -> item-group and article are the components

<GridLayout rows="*" class="page">
    <GridLayout row="0" rows="auto, *, auto">
        <CardView row="0">
            <StackLayout orientation="vertical">

                <item-group [hideItemGroup]="groupLevel && groupLevel.length === 1 && i === 0" 
                            (groupSelected)="calculateLevelsArray($event)" 
                            [groupLevel]="groupLevel" 
                            [index]="i" 
                            *ngFor="let groupLevel of levelsArray; let i = index">
                </item-group>

            </StackLayout>
        </CardView>
        <GridLayout row="1">
            <ScrollView id="test" orientation="vertical" [visibility]="!hideList ? 'visible' : 'collapsed'">
                <ListView [items]="articles">

                    <ng-template let-item="item" let-i="index">
                        <StackLayout>

                            <article [type]="'storage_article'"
                             (showFabButtonEvent)="toggleFab($event)" 
                             (openPreviewModal)="previewNewOrder($event)" 
                             [article]="item">
                             </article>

                        </StackLayout>
                    </ng-template>

                </ListView>
            </ScrollView>
        </GridLayout>
    </GridLayout>
    <FAB (tap)="goToNewOrderPage()"
        visibility="{{ showFab ? 'visible' : 'collapsed' }}"
        [ngClass]="{'hide_fab': true }"
        hideOnSwipeOfView="test"
        row="1"
        icon="res://add_white"
        rippleColor="#f1f1f1"
        class="fab-button bg-danger">
    </FAB>
</GridLayout>

the item-group component:

 <GridLayout [visibility]="!hideItemGroup ? 'visible' : 'collapsed'">
            <ScrollView orientation="horizontal">
                <StackLayout orientation="horizontal">
                    <Button class="btn btn-rounded-lg" [ngClass]="{'btn-primary': selectedIndex === i}" (tap)="selectGroup(group, i)" *ngFor="let group of groupLevel; let i = index" [text]="'    ' + group.GR_OPIS + '    '"></Button>
                </StackLayout>
            </ScrollView>
        </GridLayout>

the article component is large but i have to link since i reuse it in other pages ():

  <GridLayout columns="auto,*,auto" rows="auto, auto" [ngSwitch]="type">
                <StackLayout col="0" row="0" verticalAlignment="center" class="page" (tap)="emptyTap=1">
                    <Label class="fa text-muted fa-image-zoom m-l-10 text-center" [text]="'fa-picture-o' | fonticon"></Label>
                </StackLayout>
                <StackLayout col="1" row="0" (tap)="checkType() && selectArticle()" class="page" verticalAlignment="center">
                    <Label class="h4 text-primary font-weight-bold p-l-10 p-t-5" [text]="article.code"></Label>
                    <Label class="h5 p-l-10 p-t-5" [text]="article.description"></Label>
                    <Label class="h6 text-danger p-l-10 p-t-5 font-weight-bold" [text]="modifyArticlePrice(article.price)"></Label>
                </StackLayout>

                <GridLayout *ngSwitchCase="'storage_article'" height="90" width="90" row="0" col="2" (tap)="toggleFav()" class="page">
                    <Label verticalAlignment="center" horizontalAlignment="center" class="fa fa-x-2 text-primary" [text]="isFavourite() | fonticon"></Label>
                </GridLayout>

                <GridLayout verticalAlignment='center' *ngSwitchCase="'order_article'" col="2" row="0" columns="auto, auto" rows="auto" class="page">

                    <StackLayout row="0" col="0" verticalAlignment="center">
                        <GridLayout row="0" col="0" columns="auto, auto, auto" verticalAlignment="center">
                            <Button col="0" (tap)="lowerQ()" class="fa btn btn-primary btn-custom-props btn-medium" [text]="'fa-minus' | fonticon"></Button>
                            <TextField col="1" textAlign="center" width="80" keyboardType="number" [(ngModel)]="article.quantity"></TextField>
                            <!--<Button col="1" class="fa btn-custom-props btn-medium btn-quantity" [text]="article.quantity"></Button>-->
                            <Button col="2" (tap)="raiseQ()" class="fa btn btn-primary btn-custom-props btn-medium" [text]="'fa-plus' | fonticon"></Button>
                        </GridLayout>
                    </StackLayout>

                    <StackLayout row="0" col="1" verticalAlignment="center">
                        <Button verticalAlignment="center" (tap)="emitRemoveEvent()" horizontalAlignment="center" class="fa fa-x-2 bg-danger m-x-10 btn-medium" [text]="'fa-trash' | fonticon"></Button>
                    </StackLayout>

                </GridLayout>

                <GridLayout verticalAlignment='center' *ngSwitchCase="'in_order_article'" col="2" row="0" columns="auto, auto" rows="auto" class="page">
                    <GridLayout verticalAlignment="center" horizontalAlignment="center" row="0" col="0" columns="auto, *" width="67">
                        <Label col="0" verticalAlignment="center" margin="5" class="fa text-center" [text]="'fa-times' | fonticon"></Label>
                        <Label col="1" horizontalAlignment="left" class="m-r-10 h3 text-center text-primary" [text]="article.quantity"></Label>
                    </GridLayout>
                    <StackLayout row="0" col="1">
                        <Button class="btn btn-primary" [isEnabled]="false" [text]="article.orderNumber"></Button>
                    </StackLayout>
                </GridLayout>

                <GridLayout horizontalAlignment="left" *ngIf="showExtras()" row="1" col="1" rows="auto, auto" class="m-x-5 m-y-5">
                    <StackLayout row="0" orientation="horizontal">
                        <Ripple horizontalAlignment="left" verticalAlignment="center">
                            <Label verticalAlignment="center" class="fa text-left fa-x-2 text-center" width="30" height="30" [text]="extrasToggledOn ? 'fa-caret-left' : 'fa-caret-down' | fonticon"></Label>
                        </Ripple>
                        <Label text="Додатоци" class="m-x-10"></Label>
                    </StackLayout>
                    <ScrollView orientation="vertical" row="1">
                        <WrapLayout orientation="horizontal" width="210">
                            <Label *ngFor="let extraArticle of article.extras" [isEnabled]="false" class="m-x-5 p-x-5" [text]="extraArticle.extraDescription"></Label>
                        </WrapLayout>
                    </ScrollView>
                </GridLayout>
            </GridLayout>`

so this was the huge text and i apologize for that but i had to link the markup (i will link the code that executes when clicking if needed);

And here is the screenshot of the profiling (you can notice where the app stopped and the ui blocked):

screenshot_1

i have tried the app on couple of different devices:

  1. Xiaomi mi4 LTE (had the problem)
  2. Huawei p9 lite (had the problem)
  3. nexus 7 (2013 version) (had the problem)
  4. Tesla tablet L7.1 3G model (had the problem -> the worst performance on this one)
  5. Samsun galaxy s7 edge (didn't see the problem on this one -> short period of testing)

@Dimitrievskislavcho what did you use to profile?
I'm using developer tools and it's not as detailed as the one you provided.

I'll try to post some screenshots of mine later today.

@Cayan i used the Android Monitor in Android Studio ...
the Monitors tab shows the mem, cpu, network and gpu stats over time.
First select the device/emulator and the app. Then you will be able to see the graphs.
If you struggle to find just see the Android Studio docs. There is a detailed info on how to setup so
you can do the profiling like i did.

note: if you cannot find the tools > android > android device monitor option in android studio,
try to map a shell android app (there are templates i think) and then you will see that option.
I didn't even use any code inside android studio, just the standalone android monitor option.
Cheers and i hope you will be able to do some proper profiling and finally we diagnose this weird problem.

I've been contemplating and i thought of something that might be a reason. (i don't say it must be the reason :)). Angular's change detection. I use the Default strategy and that might be the problem looking from the perspective of how many detector calls are there from time to time. I will try to research some more and i will write if i manage to find something.

using OnPush improved the performance a lot for me

@Cayan did you manage to do the android studio monitoring? I didn't manage to find a solution for my problem. I work with the app and at random times the cpu get's to 50% (somehow that is the limit for xiaomi mi4 in the cpu monitor) and it hangs there goes down to 30% maybe and again to 50%. At that period of time the ui is blocked. Then the non responsive dialog opens and when i click wait it continues with the work properly and the app unfreezes. I don't think i will be able to pinpoint the problem on my own :(. My code is not rocket science and i do the code and markup as the instructions tell. But, something heavy is happening at some point that blocks the thread which happens to be the ui thread too :). Won't give up though. Since this app, as simple as it may be is in production i will have to work this out. Freezes and unresponsiveness are unacceptable.

I couldn't check it yesterday, I'll probably do it this weekend

I was able to successfully use the Android Monitor and it's quite a tool.

The problem I'm facing is probably related to the complexity of my components. I/Choreographer made multiple reports of skipped frames. Some of them reported more than 150 frames skipped!

I'll use this tool to improve the reason behind those skipped frames.

About the monitor report it seems to be okay.
image

I also have this:
image

@Cayan thank you for your post man. Maybe we are having the same reason about the lags and freezes. But i don't know if i can say that the components are complex or not :). Cannot be sure if i can change or optimize the markup. Can you tell me how to filter the messages in the "LogCat"so i can see the skipping frames reports. Probably there is too much going on the UI Thread but since i am not much into android and the android development i would not know how to check this out and how to spawn a new thread and solve this out on the nativescript side.

Maybe @NickIliev can help us or someone else there? I am really stuck at this one.

Hi @Dimitrievskislavcho,
While using Android Monitor you could apply some filters, that could minimize the output in the console.
In the left side of the window, as it could be seen in the attached image, you will find the button, which allows adding a filter for logging specific message.
screenshot 39

For further help about those filters could be found here in this thread in StackOverflow.

Hope this information will help you.

@tsonevn Thank you for the hints. I will check the thread out and see if i can properly filter the log so i can post it here and you can see what might be the cause of my problems.

@tsonevn @NickIliev @Cayan So i managed to get this data testing and running the app. the Android Studio has the simple get log for app filter so that did it for me. I will post in sequence logcat + monitor screenshots and what i think is the trace.txt pulled with the adb tool.


the trace.txt is for this actual attempt of blocking the s@#t 🗡

screenshot_3

screenshot_4


The traces file is here:
traces.txt

The not responsive ui time on this occasion was brutally long. As i have mentioned i don't see
any performance issues while scrolling the listView that holds the article component which code i have posted earlier. I randomly get this freeze (sometimes is ~2-5 seconds without the anr thing, sometimes it waits for a user input to continue). Mainly happens randomly if the action is either opening a dialog , or clicking on a horizontal group which when selected renders the new items filtered in the vertical stack listView that can be scrolled. Also happens when i navigate back or forth from the main page (it is the heavier page, with router-outlet). The only thing that stresses my mind is the possible object creation of some type when i filter the items. But i cache the objects and i reuse when i can. And few filter map operations here and there. But there are not thousands of items, more like max hundreds. I really don't get it.

note: i mapped and built the sample-groceries app. Was playing around the app. When i added like 20 30 items and clicked few times on the Recent/Done toggle button happened the same. Indeed the freeze was lighter for like 2 3 seconds. But yeah happens on this one too. And i am aware that this app has light weight markup and my list items - articles have a bit heavier layout and nested structure.

ping @NickIliev @tsonevn @Cayan . I don't want to be bothering at all but i haven't had the resources nor the knowledge to resolve any of these issues. Any news on this problem, n + ng2 in particular?

@Dimitrievskislavcho I've improved the overall performance of my app by removing ng submodules and reviewing all the data structures manipulations I had. I'd say its 60% faster now.

I still see those random freezes, I need some time to post it here

@Dimitrievskislavcho one of the things I've noticed is that you are commonly using *ngFor Angular directive to load repetitive items. This might cause long-term performance issues as the ngFor is not optimized in any way. As a solution to improve your performance you can use ListView or RadListView. Both components are using optimization techniques like recycling and virtualisation which are crucial in the mobile development especially when working with multiple templates and items.
great blog post on what is actually happening when using recycling and virtualization (and why to avoid structural Angular directives when possible) can be found here. I hope that info will help you boost your app performance - however, if you still have issues and if it is possible you can send me test project so we can investigate your issue locally.

@Cayan that thing about the ng submodules might help me to be honest. Optimizing and getting organized don't always get along :). Speaking about the data structures i don't think that i can really optimize that part of the application right now but i will try and test it out.

@NickIliev i use *ngFor i think 2 or maybe 3 times throughout all the application. I know about the article and i tried to use/resue ListView wherever i could.I don't know about the RadlistView (i am guessing it is a plugin on top of the ListView). Anyhow i know the issue might be both the capabilities of the device mixed with the time needed to process and kickstart all the nested structures which angular 2 + nativescript implement in my case.
If i don't really success at mitigating the problem i will send you the project so u can test and point me in the right direction.

I've also noticed this problem with NS+Angular for Android. The app works very smooth and out of sudden, will freeze for second or two. It is quite worrying because it seriously affects user experience and I have no clue how to address it.
iOS doesn't have that problem (with exactly the same codebase).
The problem was in 2.5.x and unfortunately I can confirm, is still present after upgrade to NS 3.x.
I hope this thread will lead to some conclusions.

Same problems here with NS + Angular.
Now I'm rewriting the application only in Typescript and the freezes are less frequent (but there are still).

@dunqan @Abdumama Thank you for the responses guys. I thought of rewriting it with 'vanilla' NS but the PO said that won't be necessary at this time. I think it is a good thing to just stick to writing ns + ts only apps for now, especially if you don't have the need of lot's of custom components. The thing is you can write components without Angular but the task won't be as easy as it is with NG2. Will notify you if i see any changes.

Same experience here as @dunqan - lag spikes occur on NG4 + NS3 on android, but don't seem to on ios. Has anyone been able to disable garbage collection or know if it's possible? I've tried by playing around with these settings but still get the freeze spikes - trying to confirm that the freezes are due to garbage collection.

same experience here - freeze spikes from 2.4 to 3.1

I think that this lag is related to our latest findings about the GC routine we have for synchronizing JS/Android object graphs. This method takes about 300-500 ms upon a GC cycle in different apps, primarily with Angular, where many short-living objects exist on the heap, object graph is much larger and V8 GC kicks more often. Better detail about these findings may be found in this blog post.

We will spend some time in the 3.2 time frame to analyze this behavior and find possible solution(s). Potentially fixing this behavior may lead to some breaking changes within the way Android objects are accessed through JS but we will communicate the result of the analysis prior to any such changes.

Thank you for the info @atanasovg. I personally believe it's the last thing left for NativeScript to become a viable solution for Android development (IOS seems quite good already).

Based on your knowledge of GC mechanism in NativeScript, do you think there is some way, i.e. explicitly use gc() more often or tinker some options, to make the issue less painful or make it more predictable?

I don't think that there is something you can currently do to improve this behavior. It is the complexity of the method that lags, not the frequency of the GC cycles. Besides, as a general rule of thumb, the framework shouldn't force developers to manually do garbage collection. Ideally, we'd come out with a better solution that does this automatically and is well performing.

@dunqan agree that it is the last thing left for Nativescript to become a viable solution for android development,and it is so boring.I have the same experience in last 6 months.

@atanasovg I have used nativescript+ng in a whole large reality project.So far,the android app has been delivered to customer.This random freeze issue is the most boring feedback.The ios app is on review.So I eagerly wander any improvement about this.Thanks for everybody's effort!So amazing framework for developing app.In China,I found the first course about nativescript made by HongKong University of science and technology in coursera.org today.I believe that It will be famous in the short future.

@atanasovg thank you for your feedback on this matter. And thanks to all that have commented and contributed to this topic to stay open. And yes i am waiting for that solution as well. The product i built was built fast and easy so i really hope that this only issue and drawback we/i had will go away. Cheers

Still experience the the lagg on Android with {N} {A} and it's really affects the user experience.

nativescript │ 3.4.0
tns-core-modules │ 4.0.0
tns-android │ 4.0.0
tns-ios │ 3.2.0

I currently finding/making/waiting a solution

@NickIliev Any progress on this? I see that @Dimitrievskislavcho already closed this issue, but we're still experiencing this from time to time.

@frapaa @labidiaymen can you guys provide any sample project which we can test for these issues so we could reproduce the locally and investigate thoroughly - I am not able to reproduce the issue with this sample project (live on Google Play and only logic related crashes were logged so far)

Meanwhile, only for testing purposes, you can try to use this flag - more details here. Removing the marking mode should improve your overall GC but keep in mind that this is experimental feature

Thanks, we will try this setting and see if it helps. I don't know if we can make an example app, since we don't know how to reproduce, but we can try.

Since I start using "markingMode": "none" flag, everything looks good on Android,
Ref : https://www.nativescript.org/blog/announcing-the-release-of-nativescript-3.2.
Thanks

Hey @NickIliev, would be nice to see some user feedback (like UI loading, etc.) implemented in the sample project you mentioned. I installed it in my Galaxy S5 NEO and sometimes I touch an option and nothing happens - me, as a user, don't know if something is loading or not - but in some cases the action is fired some seconds after.

hi ! my app is also lagging for about 1-2 seconds..
but when it lags there is a message in console
Can anyone expalin me this console message..

ActivityManager: getContentProviderImpl: from caller=android.app.ApplicationThreadProxy@fabfd2f (pid=6121, userId=0) to get content provider settings cpr=ContentProviderRecord{62cae88 u0 com.android.providers.settings/.SettingsProvider} 06-23 23:28:24.198 6121 6121 D ActivityThread: holder:android.app.IActivityManager$ContentProviderHolder@dd49ae9, holder.provider:android.content.ContentProviderProxy@3ef236e

Thanks in advance guys ! Nativescript is awesome

Closing this one as the general issue does not happen on our test apps with the latest modules and Angular. If anyone is still experiencing freeze issue please ping me so we could investigate the case and reopen this one if needed.

Hi all,

We are developing a big app with nativescript + angular, and the freezes are completely random.. sometimes opening modals, other times navigating or simply opening the drawer.. it's really disappointing because we wanted to use the same angular codebase for mobile/web apps, and we were very excited when we started last year developing with nativescript, but now we are not so sure if we made the right call :\ pls put more effort and don't give up on this issue..
I don't have the knowledge to fix or even understand the guts, but it feels to me that the livecycle gets broken/pending.. like the bridge between javascript & java gets blocked or something.. but its just a guess..

@devlfm there is an experimental functionality which can greatly improve the described scenarios. The flag is called markingMode. Details on the feature can be found in this article. and in this PR

To disable the markingMode in your NativeScript application open the app/package.json (notice that this is not the root package.json but the one located inside the app folder) and add the following key:

{
  "android": {
    "markingMode": "none"
  }
}

Here is an example of how I am using the markingMode in this application (I am not experiencing any freezes or ANR)

@NickIliev Thank you very much for pointing me out this! great reading.

I've been trying this flag, and truly stops the freezes! but at a cost of sometimes the app closes for no reason :(

Is there something I can avoid on code to prevent it? Or something I can use to detect GC errors?

This should be TOP priority for nativescript team! This flag should be by default on angular projects, as long as there are no issues with GC.

If you need something from me, just ask!

Can second devlfm's comment. Turned marking mode on probably a year ago in a project and freezes were fixed, but the app then crashes quite frequently on android. Over the months I've been working on other projects hoping that the marking mode flag becomes more stable. I believe the following stack trace represents what commonly shows during a crash:

An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException: No weak reference found. Attempt to use cleared object reference id=26391
at com.tns.Runtime.getJavaObjectByID(Runtime.java:892)
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
at com.tns.Runtime.callJSMethod(Runtime.java:957)
at com.tns.Runtime.callJSMethod(Runtime.java:941)
at com.tns.Runtime.callJSMethod(Runtime.java:933)
at com.tns.gen.android.app.DialogFragment_frnal_ts_helpers_l58_c38__DialogFragmentImpl.onCreateView(DialogFragment_frnal_ts_helpers_l58_c38__DialogFragmentImpl.java:20)
at android.app.Fragment.performCreateView(Fragment.java:2353)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
at android.app.BackStackRecord.run(BackStackRecord.java:816)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1580)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:483)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6196)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)

@jeffswitzer @devlfm more on why the above error is happening here and also in this thread. The plugin's team has recently updated all NativeScript's owned plugin to be fully compatible with the experimental feature markingMode but if your app uses other JS references to native Java objects, you will still need to preserve these references in the global object to prevent the GC from collecting them.

@NickIliev that is really great news about shoring up marking mode compatibility! I haven't tried 5.1 yet but will give it a shot and in the case that some plugins still give me fits will look towards the forthcoming documentation mentioned in the NS 5.1 release notes:

Next, we are going to focus on producing content and guiding the community on what is needed in order to make all the other plugins compatible as well. More information on this will follow up soon.

Hi @NickIliev , We are developing a photo/collage editor, and we use indeed some Glide implementations to handle image crop while drawing:

@Interfaces([ com.bumptech.glide.load.Transformation ])
class CropTransform extends java.lang.Object {

constructor(private src: string, private croppable: Croppable) {
    super();
    return global.__native(this);
  }

And I'm wondering if return global.__native(this); on ctor isn't already locking this instance of beeing GC?

I'll checkout what was done on plugins to see if I get it right.

Thank you

i am having these issues as well. i tried the markingMode:"none",but it does not giving the good result .any idea to fix this one

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings