相关疑难解决方法(0)

在Android studio中使用-Xlint重新编译

当我在Android Studio中构建我的Android项目时,我收到消息:

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Run Code Online (Sandbox Code Playgroud)

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Run Code Online (Sandbox Code Playgroud)

我想做消息建议的内容,但是如何做?-Xlint如上所述,如何配置我的Android工作室重新编译我的项目?(我使用的是Android Studio 3.0.1)

android android-studio

47
推荐指数
3
解决办法
2万
查看次数

如何修复此错误:Struct 'Utf8' 为空。不推荐支持空结构......改用 Opaque

我最近在运行我的应用程序时开始收到此错误。它似乎不会影响一切,但它在日志中非常嘈杂和烦人。我没有对我的应用程序进行任何更改或添加任何会导致此类问题的内容,我最近所做的唯一一件事就是升级到最新版本的 Flutter(我经常升级,所以距离上次更新只有几天时间) .

../../../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4/lib/src/structs.dart:1111:7: Info: Struct 'ENUMLOGFONTEX' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class ENUMLOGFONTEX extends Struct {
      ^
../../../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4/lib/src/structs.dart:2835:7: Info: Struct 'BLUETOOTH_PIN_INFO' is empty. Support for empty structs is deprecated and will be removed in the next stable version of Dart. Use Opaque instead.
class BLUETOOTH_PIN_INFO extends Struct {
      ^
../../../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4/lib/src/structs.dart:2960:7: Info: Struct 'EXCEPINFO' is empty. Support for empty structs is deprecated and …
Run Code Online (Sandbox Code Playgroud)

dart flutter

24
推荐指数
3
解决办法
6360
查看次数

Flutter - 添加 Firebase 消息传递时出现问题

Doctor 摘要(要查看所有详细信息,请运行 flutter doctor -v):
\n[\xe2\x88\x9a] Flutter(频道稳定,2.5.0,在 Microsoft Windows 上 [Versi\xc3\x83\xc2\xb3n 10.0.19042.1348 ],区域设置 en-US)
\n[\xe2\x88\x9a] Android 工具链 - 为 Android 设备开发(Android SDK 版本 30.0.0-rc2)
\n[\xe2\x88\x9a] Chrome - 为网络开发
\n[\xe2\x88\x9a] Android Studio(版本 3.6)
\n[\xe2\x88\x9a] VS Code(版本 1.52.1)
\n[\xe2\x88\x9a] 连接的设备(3 个可用)

\n

我的 pubsec.yaml 只有:
\nfirebase_messaging: ^10.0.1
\nfirebase_core: ^1.2.1
\nflutter_local_notifications: ^6.1.0
\n
\n即使在全新的 Flutter 项目上我遇到的问题是我得到以下内容当我添加 import 'package:firebase_messaging/firebase_messaging.dart'; 时出错;到 main.dart

\n
/D:/Flutter/flutter_windows_2.5.0-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:13:11: Error: Method not found: 'Error.throwWithStackTrace'.\n    Error.throwWithStackTrace(exception, stackTrace);\n          ^^^^^^^^^^^^^^^^^^^\n/D:/Flutter/flutter_windows_2.5.0-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:16:9: Error: Method not found: 'Error.throwWithStackTrace'.\n  Error.throwWithStackTrace(\n        ^^^^^^^^^^^^^^^^^^^\n/D:/Flutter/flutter_windows_2.5.0-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:11:7: Error: A non-null value must be …
Run Code Online (Sandbox Code Playgroud)

flutter firebase-cloud-messaging

12
推荐指数
4
解决办法
2万
查看次数

Dart uuid 无法扩展

我通过 dart pub Upgrade 更新了依赖项,但在这里我认为由于某些缓存已经存在导致此错误。我已经尝试过 dart clean 缓存,但问题仍然存在。请充分考虑下面提到的问题陈述。看来我的 uuid 类无法扩展 umodABLEuint8listview 但类甚至不存在于代码中

**../../flutter/.pub-cache/hosted/pub.dartlang.org/uuid_enhanced-3.0.2/lib/uuid.dart:9:7: Error: 'UnmodifiableUint8ListView' is restricted and can't be extended or implemented.
class Uuid extends UnmodifiableUint8ListView {
      ^**
2

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\hp\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\hp\Documents\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to …
Run Code Online (Sandbox Code Playgroud)

uuid gradle dart flutter

6
推荐指数
0
解决办法
836
查看次数

尝试在材质应用程序内使用文本时,AppBar 内出现 Flutter 非常量构造函数错误

您好,我有一个简单的问题,我在这里做错了什么?我正在尝试在脚手架中创建一个 AppBar,但是当我尝试使用 Text 时,它似乎不起作用,并要求添加一个 Const,但是当我这样做时,它并不能解决问题。

抱歉,如果已经有这方面的信息,我只是不知道解决此问题所需查找的具体条款。我知道您可以将 AppBar 放在 void main() 中,但是我正在遵循教程,并且希望以类似的方式进行操作。

import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: Text('My First App'),
          ),
          body: Text('This is the body of text.')
      ),
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

这是输出的错误:

12:25:错误:无法调用需要 const 表达式的非“const”构造函数。尝试使用“const”的构造函数或工厂。appBar: const AppBar( ^^^^^^

新错误:

../../runtime/platform/allocation.cc:14:错误:内存不足。版本=2.14.4(稳定)(2021 年 10 月 13 日星期三 11:11:32 +0200)在“windows_x64”上 pid=24408,线程=30512,isolate_group=(nil)(0000000000000000),isolate=(nil)(0000000000000000) isolate_instructions=0, vm_instructions=7ff65bad4f10 pc 0x00007ff65bcdaa42 fp 0x00000056bb8ff3c0 …

dart flutter flutter-text

3
推荐指数
1
解决办法
3117
查看次数