所以我知道对于 android 版本 >= 30,你需要在清单中添加查询,但这对我来说并没有成功。我使用的是 Android 版本 29。尽管如此,我还是将这些行添加到了我的清单中。
所以我的清单看起来像这样。
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>
Run Code Online (Sandbox Code Playgroud)
我设法使用下面的代码为我的机器重现该错误。尽管如此,我还是收到了这个错误:
I/UrlLauncher(10601): mailto:?subject=&body= 的组件名称为 null
在下面您可以找到 main.dart 的代码
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) …Run Code Online (Sandbox Code Playgroud)