我正在开发一个Android应用程序,现在遇到一个非常奇怪的错误,我不知道为什么会发生。这不是我正在开发的第一个应用程序,但是我之前从未遇到过这样的错误。也许有人有一个想法,这可能是什么原因造成的。我也没有在互联网上找到类似的问题。
我的项目也很大,因此,由于出现此错误消息,我真的不知道哪个代码可能导致此错误,这就是为什么这里没有代码。
A/zygote64: concurrent_copying.cc:2510] Check failed: it->AsMirrorPtr()->AtomicSetMarkBit(1, 0)
A/zygote64: runtime.cc:492] Runtime aborting...
A/zygote64: runtime.cc:492] Aborting thread:
A/zygote64: runtime.cc:492] "HeapTaskDaemon" prio=5 tid=8 WaitingPerformingGc
A/zygote64: runtime.cc:492] | group="" sCount=0 dsCount=0 flags=0 obj=0x1bb04b58 self=0x722bcd2a00
A/zygote64: runtime.cc:492] | sysTid=29600 nice=4 cgrp=default sched=0/0 handle=0x7236c7d4f0
A/zygote64: runtime.cc:492] | state=R schedstat=( 0 0 0 ) utm=3 stm=2 core=3 HZ=100
A/zygote64: runtime.cc:492] | stack=0x7236b7b000-0x7236b7d000 stackSize=1037KB
"] | held mutexes= "abort lock"
"] native: #00 pc 000000000039770c /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+212)
"] native: #01 pc 000000000045dd74 /system/lib64/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMapb+348)
"] native: #02 …
Run Code Online (Sandbox Code Playgroud) 每当 TextFields 文本更改时,我都想在文本中显示某些内容:
class _MyPageState extends State<MyPage> {
String name;
@override
Widget build(BuildContext context) {
TextEditingController c = new TextEditingController(text: name);
c.addListener(() {
setState(() { name = c.text;});
});
return Scaffold(
body: Center(
child: Column(children: [
Text('Hello, ' + name + '!'),
TextField(controller: c)
])));
}
}
Run Code Online (Sandbox Code Playgroud)
文本按预期更新,但问题是每次输入字符时,文本字段的光标都会移动到位置 0。
我想向我的应用程序添加一个对话框,但是由于某种原因它没有显示。
对话框组件:
import { Component, OnInit } from '@angular/core';
import {MatDialogRef} from "@angular/material";
@Component({
selector: 'app-connect-to-player-dialog',
templateUrl: './connect-to-player-dialog.component.html',
styleUrls: ['./connect-to-player-dialog.component.css']
})
export class ConnectToPlayerDialogComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
Run Code Online (Sandbox Code Playgroud)
使用的方法:
connectToPlayer() {
const dialogConfig = new MatDialogConfig();
dialogConfig.disableClose = true;
dialogConfig.autoFocus = true;
this.dialog.open(ConnectToPlayerDialogComponent, dialogConfig);
}
Run Code Online (Sandbox Code Playgroud)
我还将对话框添加到entryComponents
:
entryComponents: [ConnectToPlayerDialogComponent]
Run Code Online (Sandbox Code Playgroud)
我不知道可能会丢失什么...谢谢您的帮助!
完整代码:
import {Component, OnInit} from '@angular/core';
import {PLAYERS} from '../mock-players';
import {Router} from "@angular/router";
import {AlertService, AuthenticationService} from "../_services";
import {HttpClient} from "@angular/common/http"; …
Run Code Online (Sandbox Code Playgroud)