JNI ERROR(app bug):本地参考表溢出但不显示它的起源

时间:2018-02-22 14:44:48

标签: c# android xamarin xamarin.android

我收到错误,我不知道它为什么会发生。我调查了一遍,并且我理解记忆正在被填满。我得到的错误是......

[art] art/runtime/indirect_reference_table.cc:115] JNI ERROR (app bug): local reference table overflow (max=512)
[art] art/runtime/indirect_reference_table.cc:115] local reference table dump:
[art] art/runtime/indirect_reference_table.cc:115]   Last 10 entries (of 512):
[art] art/runtime/indirect_reference_table.cc:115]       511: 0x71552330 java.lang.Class<android.text.SpannableStringBuilder>
[art] art/runtime/indirect_reference_table.cc:115]       510: 0x131b2260 java.lang.String ""
[art] art/runtime/indirect_reference_table.cc:115]       509: 0x131b1550 java.lang.String "111111111111"
[art] art/runtime/indirect_reference_table.cc:115]       508: 0x131b10a0 java.lang.String "111111111111"
[art] art/runtime/indirect_reference_table.cc:115]       507: 0x131adbb0 java.lang.String "111111111111"
[art] art/runtime/indirect_reference_table.cc:115]       506: 0x131ad700 java.lang.String "111111111111"
[art] art/runtime/indirect_reference_table.cc:115]       505: 0x131ad250 java.lang.String "111111111111"
[art] art/runtime/indirect_reference_table.cc:115]       504: 0x131abd60 java.lang.String "111111111111"
[art] art/runtime/indirect_reference_table.cc:115]       503: 0x131ab8b0 java.lang.String "111111111111"
[art] art/runtime/indirect_reference_table.cc:115]       502: 0x131ab400 java.lang.String "111111111111"
[art] art/runtime/indirect_reference_table.cc:115]   Summary:
[art] art/runtime/indirect_reference_table.cc:115]         3 of java.lang.Class (3 unique instances)
[art] art/runtime/indirect_reference_table.cc:115]         1 of java.lang.String[] (3 elements)
[art] art/runtime/indirect_reference_table.cc:115]       508 of java.lang.String (508 unique instances)
[art] art/runtime/indirect_reference_table.cc:115] 
[art] art/runtime/barrier.cc:90] Check failed: count_ == 0 (count_=-1, 0=0) Attempted to destroy barrier with non zero count
[art] art/runtime/runtime.cc:366] Runtime aborting --- recursively, so no thread-specific detail!
[art] art/runtime/runtime.cc:366] 

当我点击一个引发此事件和方法的按钮时会发生这种情况......

doneSampling.Click += (sender, e) =>
{
    this.checkFinished();
};

....

skip.CheckedChange += (sender, e) =>
{
    if (barcode.Text.Length <= 0)
    {
        barcode.RequestFocus();
    }

    if ((e.IsChecked == true && barcode.Text.Length > 0) && skipped == false)
    {
        skipped = true;
        SampleState.Instance.storeSessionState(Row,
                        new Sample(tagText, 0, long.Parse(barcodeText),
                        SampleState.Instance.getRowTabState(Row), currentUnit, skip.Checked));

        this.clean();
    }
};

...

private void checkFinished()
{
    for (int i = 0; i < SampleState.Instance.getSamples(Row).Count; i++)
    {
        try
        {
            if (SampleState.Instance.getSamples(Row).ElementAt(i).Skipped == true)
            {
                unitText.Text = SampleState.Instance.getSamples(Row).ElementAt(i).Unit.ToString();
                animalTagText.Text = SampleState.Instance.getSamples(Row).ElementAt(i).Tag;
               barcode.Text = SampleState.Instance.getSamples(Row).ElementAt(i).BarCode.ToString();
                rowText.Text = SampleState.Instance.getSamples(Row).ElementAt(i).Row.ToString();

            }
            else if (i == SampleState.Instance.getSamples(Row).Count - 1 && skipped != true)
            {
                this.finshedSampling();
            }
        }
        catch (ArgumentOutOfRangeException ex)
        {
            Console.WriteLine(ex);
            Toast.MakeText((SessionActivity)this.Activity, "Seems to have hit the end :/.", ToastLength.Long).Show();
        }
    }
}

错误并没有告诉我哪条线基本上导致了这个问题所以我不知道为什么它的空间不足。任何帮助都会得到满足。

由于

0 个答案:

没有答案