在Android中我们有,Settings.Secure.ANDROID_ID.我不知道IOS等价物.是否有一个扑动的插件或一种方法来获得Android和IOS的独特设备ID?
调用Firebase.initializeApp()我的颤振代码时出现上述错误。我遵循了这里的文档:https : //firebase.flutter.dev/docs
这是我的 pubspec.yaml
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.5.0
cloud_firestore: ^0.14.0
firebase_auth: ^0.18.0
fl_chart: ^0.11.0
snapping_sheet: ^2.0.0
flutter_svg: ^0.18.0
flutter_redux: ^0.6.0
strings: ^0.1.2
random_string: ^2.1.0
redux_thunk: ^0.3.0
# firebase_crashlytics: ^0.1.4+1
dotted_line: ^2.0.1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
Run Code Online (Sandbox Code Playgroud)
这是我的颤振代码:
void main() {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
final store = Store<AppState>(AppState.reducer, initialState: AppState.initial(), middleware: [thunkMiddleware]);
runApp(
FutureBuilder( …Run Code Online (Sandbox Code Playgroud) android firebase flutter google-cloud-firestore flutter-dependencies
我正在尝试使用 stripe_ payment 包在我的 flutter 应用程序中实现 Stripe 支付系统。在我的代码中,我调用 Stripe.instance.initPaymentSheet(...),但是当我尝试在几行之后调用 Stripe.instance.presentPaymentSheet(...) 时,出现以下错误:
flutter: StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: No payment sheet has been initialized yet, message: No payment sheet has been initialized yet, stripeErrorCode: null, declineCode: null, type: null))
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
Future<void> makePayment() async {
final url = Uri.parse(
'${firebaseFunction}');
final response =
await http.get(url, headers: {'Content-Type': 'application/json'});
this.paymentIntentData = json.decode(response.body);
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
paymentIntentClientSecret: paymentIntentData!['paymentIntent'],
applePay: true,
googlePay: true,
style: ThemeMode.dark,
merchantCountryCode: 'UK',
merchantDisplayName: 'Test Payment Service'));
setState(() {});
print('initialised');
try …Run Code Online (Sandbox Code Playgroud) 我刚刚将 flutter 版本从 2.5.3 更新到 2.8。我有以下错误,我不知道如何解决它。安装的任何插件都没有错误,似乎错误来自内部类本身,我不知道在我的应用程序的哪个部分抛出错误:
\n../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_math_fork-0.3.3+1/lib/src/widgets/selectable.dart:407:7: Error: The non-abstract class 'InternalSelectableMathState' is missing implementations for these members:\n - TextSelectionDelegate.copySelection\n - TextSelectionDelegate.cutSelection\n - TextSelectionDelegate.pasteText\n - TextSelectionDelegate.selectAll\nTry to either\n - provide an implementation,\n - inherit an implementation from a superclass or mixin,\n - mark the class as abstract, or\n - provide a 'noSuchMethod' implementation.\n\nclass InternalSelectableMathState extends State<InternalSelectableMath>\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:985:8: Context: 'TextSelectionDelegate.copySelection' is defined here.\n void copySelection(SelectionChangedCause cause);\n ^^^^^^^^^^^^^\n/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:965:8: Context: 'TextSelectionDelegate.cutSelection' is defined here.\n void cutSelection(SelectionChangedCause cause);\n ^^^^^^^^^^^^\n/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:973:16: Context: 'TextSelectionDelegate.pasteText' is defined …Run Code Online (Sandbox Code Playgroud) 我在pubspec.yaml中遇到此问题:
\n这里是pubspec.yaml:
\n dependencies:\n flutter:\n sdk: flutter\n cupertino_icons: ^1.0.2\n pluto_grid: ^2.9.3\nRun Code Online (Sandbox Code Playgroud)\n这是错误:
\n[pluto_grid] flutter pub get\nRunning "flutter pub get" in pluto_grid... \nError on line 37, column 3 of pubspec.yaml: A package may not list itself as a dependency.\n \xe2\x95\xb7\n37 \xe2\x94\x82 pluto_grid: ^2.9.3\n \xe2\x94\x82 ^^^^^^^^^^\n \xe2\x95\xb5\npub get failed (65; \xe2\x95\xb5)\nexit code 65\nRun Code Online (Sandbox Code Playgroud)\n需要知道出了什么问题,在其他项目中使用了相同的并且工作完美。
\n在向我的项目添加一些依赖项+将camerax依赖项本机添加到Flutter项目的android部分之后(我想创建本机Android视图,然后在Flutter中显示它)。构建项目时,我\xe2\x80\x99ve遇到错误:
\ne: pathandroid/camera/AndroidCameraView.kt: (35, 58): Cannot access class \'com.google.common.util.concurrent.ListenableFuture\'. Check your module classpath for missing or conflicting dependencies\n e: pathandroid/camera/AndroidCameraView.kt: (36, 9): Cannot access class \'com.google.common.util.concurrent.ListenableFuture\'. Check your module classpath for missing or conflicting dependencies\n e: pathandroid/camera/AndroidCameraView.kt: (36, 30): Unresolved reference: addListener\n e: pathandroid/camera/AndroidCameraView.kt: (37, 30): Cannot access class \'com.google.common.util.concurrent.ListenableFuture\'. Check your module classpath for missing or conflicting dependencies\n e: pathandroid/camera/AndroidCameraView.kt: (37, 51): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:\npublic …Run Code Online (Sandbox Code Playgroud) 我只是创建一个空的应用程序,然后当我在模拟器上运行它时?发生错误。
此错误仅在我在 android 模拟器上运行时出现,但 ios 工作正常。
现在我在 flutter beta 频道。
所以如果有人有任何想法,请告诉我。谢谢
这是错误日志
Launching lib/main.dart on AOSP on IA Emulator in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
Required by:
project :app
> Could not resolve io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
> Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
> Could not GET 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
> …Run Code Online (Sandbox Code Playgroud) 本指南讨论flutter和原生android之间对话的方法通道。
https://flutter.dev/docs/development/platform-integration/platform-channels
我已经为我的 flutter 模块生成了“aar”文件,并将该 aar 文件包含在我的本机 android 应用程序中。现在,当我单击 Android 应用程序中的按钮时,我将通过 Android 中的 FlutterActivity 类启动我的 flutter 模块。
现在我的问题是,如何在本机 android 代码和生成的 aar 代码之间进一步通信?
如何编写我的 flutter 模块,以便当我生成“aar”文件并包含在我的 android 应用程序中时,我能够在它们之间建立通信?
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:28: 错误:未找到类型“DiagnosticableMixin”。类 DatePickerTheme 与 DiagnosticableMixin { ^^^^^^^^^^^^^^^^^^^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17 .4/lib/src/picture_stream.dart:88:26: 错误:未找到类型“DiagnosticableMixin”。带有 DiagnosticableMixin 的 PictureStream 类 { ^^^^^^^^^^^^^^^^^^^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17 .4/lib/src/picture_stream.dart:192:44:错误:未找到类型“DiagnosticableMixin”。抽象类 PictureStreamCompleter 与 DiagnosticableMixin { ^^^^^^^^^^^^^^^^^^^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker- 1.3.8/lib/src/datetime_picker_theme。dart:6:7: 错误:类型“DiagnosticableMixin”不能混入。带有DiagnosticableMixin 的类DatePickerTheme { ^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg -0.17.4/lib/src/picture_stream.dart:88:7: 错误:类型“DiagnosticableMixin”不能混入。带有DiagnosticableMixin 的PictureStream 类{ ^ /C:/src/flutter/flutter/.pub- cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: 错误:类型“DiagnosticableMixin”不能混入。抽象类PictureStreamCompleter 和DiagnosticableMixin { ^ / C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: 错误:超类没有名为“debugFillProperties”的方法. super.debugFillProperties(properties); ^^^^^^^^^^^^^^^^^^^ /C:
FAILURE:构建失败,出现异常。
其中:脚本 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' 行:896
出了什么问题:任务 ':app:compileFlutterBuildDebug' 执行失败。
进程 'command 'C:\src\flutter\flutter\bin\flutter.bat'' 以非零退出值 1 结束
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。 …
AdMob 支持 Flutter 网页吗?我发现的所有库仅适用于 Android 和 IOS