nativescript-community / ui-material-components

Monorepo that contains all of the NativeScript Material Design plugins.
https://nativescript-community.github.io/ui-material-components/
Apache License 2.0
218 stars 80 forks source link

App closes unexpectedly when using MDCardView with *ngFor #122

Closed bugMaker-237 closed 4 years ago

bugMaker-237 commented 4 years ago

App closes unexpectedly when using MDCardView with ngFor in the angular component template. If items are present during the vue rendering the ngFor works with no problem. But when trying to push new items into the array binded to the *ngFor, app stops unexpectedly with no errors.

Which platform(s) does your issue occur on?

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

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'history-list',
  templateUrl: 'history-list.component.html'
})
export class HistoryListComponent implements OnInit {
  histories = [];
  ngOnInit() {
    setTimeout(() => {
      this.histories.push(
        ...[
          {
            date: '10 Fevrier 2020, 19:11',
            price: '1 500',
            start: 'Carrefour Mvan',
            end: 'Chapele Obili'
          },
          {
            date: '19 Janvier, 12:17',
            price: '500',
            start: 'Bonamoussadi',
            end: 'Ecole publique Deido'
          }
        ]
      );
    }, 2000);
  }
}

Component vue

<GridLayout *ngFor="let item of histories">
  <MDCardView margin="10" elevation="4">
    <StackLayout>
      <GridLayout
        class="p-b-5 p-t-10 p-l-10 p-r-10 m-b-5"
        columns="*, auto"
      >
        <label class="m-l-5" [text]="item.date" row="0" col="0"></label>
        <label
          class="m-r-5"
          [text]="item.price + ' FCFA'"
          row="0"
          col="1"
        ></label>
      </GridLayout>

      <StackLayout
        class="m-l-5 p-l-10 p-r-10 m-r-5 p-t-5 p-b-5 m-b-5 b-t-1"
        orientation="horizontal"
      >
        <core-ui-icon name="navigation" size="28"> </core-ui-icon>

        <label [text]="item.start" class=" b-b-1"></label>
      </StackLayout>
      <StackLayout
        class="m-l-5 p-l-10 p-r-10 m-r-5 p-t-5 p-b-5 m-b-5"
        orientation="horizontal"
      >
        <core-ui-icon
          name="panorama_fish_eye"
          backColor="primary"
          size="28"
        >
        </core-ui-icon>

        <label [text]="item.start" class=""></label>
      </StackLayout>

      <Label
        width="100%"
        class="btn btn-accent text-white no-border"
        height="48"
        margin="0"
        style="text-align: center;"
        text="MODIFIER"
      ></Label>
    </StackLayout>
  </MDCardView>
</GridLayout>
farfromrefug commented 4 years ago

@bugMaker-237 without a log we wont do much

bugMaker-237 commented 4 years ago

Then, What can I do to get more infos on the issue ?

farfromrefug commented 4 years ago

@bugMaker-237 You need to get a logcat to see what is happening. Also it seems like an angular error on first sight and i dont use angular. So i wouldnt be able to help that much

bugMaker-237 commented 4 years ago

I am or a native dev. From nativescript, is it possible to get the logcat ?

farfromrefug commented 4 years ago

nop look on the web, like "android logcat". It should be as simple as "adb logcat" from the command line

bugMaker-237 commented 4 years ago

This is the logcat i extracted with priority F when the app fails, app name is org.thl.client logcat.txt

bugMaker-237 commented 4 years ago

The initial Fatal Error is : F/art ( 1709): sart/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: can't call void android.view.View.setTranslationZ(float) on null object

farfromrefug commented 4 years ago

The error is not related to my plugin i think. It seems to be an error during animation.

D/STATUSBAR-WifiQuickSettingButton( 1369): onWifiSignalChanged enabled=false enabledDesc:null
F/art     ( 1709): sart/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: can't call void android.view.View.setTranslationZ(float) on null object
F/art     ( 1709): sart/runtime/check_jni.cc:65]     in call to CallVoidMethodV
F/art     ( 1709): sart/runtime/check_jni.cc:65]     from void android.animation.PropertyValuesHolder.nCallFloatMethod(java.lang.Object, long, float)
F/art     ( 1709): sart/runtime/check_jni.cc:65] "main" prio=5 tid=1 Runnable
F/art     ( 1709): sart/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x77821ee0 self=0xb4f08000
F/art     ( 1709): sart/runtime/check_jni.cc:65]   | sysTid=1709 nice=0 cgrp=apps sched=0/0 handle=0xb6f60ec8
F/art     ( 1709): sart/runtime/check_jni.cc:65]   | state=R schedstat=( 9117195544 1857770778 6111 ) utm=781 stm=130 core=0 HZ=100
F/art     ( 1709): sart/runtime/check_jni.cc:65]   | stack=0xbe770000-0xbe772000 stackSize=8MB
F/art     ( 1709): sart/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   native: #00 pc 00004640  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   native: #01 pc 00002e8d  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   native: #02 pc 00246ee9  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   native: #03 pc 0022bb4b  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+146)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   native: #04 pc 000b17ab  /system/lib/libart.so (art::JniAbort(char const*, char const*)+582)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   native: #05 pc 000b1ee5  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+60)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   native: #06 pc 000b21c1  /system/lib/libart.so (art::ScopedCheck::CheckVirtualMethod(_jobject*, _jmethodID*)+408)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   native: #07 pc 000bc4d7  /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+70)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   native: #08 pc 00062d27  /system/lib/libandroid_runtime.so (???)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   native: #09 pc 00071eed  /system/framework/arm/boot.oat (Java_android_animation_PropertyValuesHolder_nCallFloatMethod__Ljava_lang_Object_2JF+132)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.animation.PropertyValuesHolder.nCallFloatMethod(Native method)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1296) F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:952)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.animation.ValueAnimator.animationFrame(ValueAnimator.java:1207)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1248)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:659)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:682)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.view.Choreographer.doCallbacks(Choreographer.java:590)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.view.Choreographer.doFrame(Choreographer.java:559)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.os.Handler.handleCallback(Handler.java:739)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.os.Handler.dispatchMessage(Handler.java:95)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.os.Looper.loop(Looper.java:145)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at android.app.ActivityThread.main(ActivityThread.java:5944)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at java.lang.reflect.Method.invoke!(Native method)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at java.lang.reflect.Method.invoke(Method.java:372)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
F/art     ( 1709): sart/runtime/check_jni.cc:65]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

It might be an error with the material native lib or {N}. You need to investigate this by checking your lib versions. You can also search in https://github.com/material-components/material-components-android or {N} repo for similar issues.

EDIT: i ll close that issue for now. If you find out that it is really an issue here let me know.