gpt4 book ai didi

flutter - 解析问题 (Xcode) : Module 'fluttertoast' not found (in target 'Toast' from project 'Pods' )

转载 作者:行者123 更新时间:2023-12-05 02:29:09 27 4
gpt4 key购买 nike

Parse Issue (Xcode): Module 'fluttertoast' not found
/Users/anand/StudioProjects/untitled/ios/Runner/GeneratedPluginRegistrant.m:11:8

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro.

我将近 24 小时都陷入了这个错误。请帮助某人,我在我的项目中使用了 fluttertoast: ^8.0.9 库最大位置,如果我删除库项目照常运行,但如果我添加库,则会抛出上述错误。我不知道如何摆脱错误。我尝试了 stackoverflow 中的大部分答案。

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);

final String title;

@override
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

@override
Widget build(BuildContext context) {

return Scaffold(
appBar: AppBar(

title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'Hello flutter',
),

],
),
),
floatingActionButton: FloatingActionButton(
onPressed: (){
Fluttertoast.showToast(
msg: "This is Center Short Toast",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0
);
},
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}

请帮我解决这个错误。

最佳答案

试试这个。它对我有用!

pod repo update
pod install

关于flutter - 解析问题 (Xcode) : Module 'fluttertoast' not found (in target 'Toast' from project 'Pods' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72358846/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com