用Xcode 重新编译一下
查看android/gradle/wrapper/gradle-wrapper.properties
distributionUrl gradle 版本是否正确
然后flutter clear 并且删除 pubspec.lock
重新 flutter pub get
qemu_pipe_open_ns:62: Could not connect to the 'pipe: gemud:network' service:
Invalid argument
08-04 16:22:14.190 - netmar Failed to open OEMU pipe 'gemud:network': Invalid argument
08-0416:99:39.880E andro1d.system.suspend@1.0-service: Error opening kernel wakelock stats for: wakeup34: Permission denied
08-04 16:22:39 W Binder: 212 2: tvpe=1400 audit(0.0:602): avc: denied { read } for name="wakeup34" dev="svsfs' ino=19159 sco ntext=u:r:system_suspend:s0 tcontext=u:object_r:systs:s0 tclass=dlr permissive=l
但是下面的权限都已经添加
....
<--res/xml/network_security_config.xml -->
修改AndroidManifest.xml 权限位置
把权限都放到下面
。。。。
1./android/app/src/main/kotlin/com/example/xxx/MainActivity.kt
package com.example.yyy
import io.flutter.embedding.android.FlutterActivity
//引入
import android.os.Build;
import android.os.Bundle;
class MainActivity: FlutterActivity() {
//设置状态栏沉浸式透明(修改flutter状态栏黑色半透明为全透明)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor = 0
}
}
}
main() async {
。。。。
runApp(const MyApp());
SystemUiOverlayStyle uiStyle = const SystemUiOverlayStyle(
systemNavigationBarColor: Color(0x00000000),
systemNavigationBarDividerColor: null,
statusBarColor: Color(0x00000000),
systemNavigationBarIconBrightness: Brightness.dark,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.dark,
);
SystemChrome.setSystemUIOverlayStyle(uiStyle);
}
controller.text = 'xxxx';
controller.selection = TextSelection.fromPosition(TextPosition(offset: controller.text.length));
问题: 不小心更新了vscode 导致一直Analysis…;而且错误提示不显示,代码提示加载中。。。
1.Deleting ~/.dartServer/.analysis-driver/ might be worth a try.
2. 重启vscode
参考:https://stackoverflow.com/questions/64500143/dart-analysis-server-has-terminated
我犯的错误:检查配置文件中 flutter root 是否错误