我正在编写一个关于 flutter 的代码,以便在 android/ios 和 web 上使用 Google 登录,但我第一时间就遇到了这个错误。我在 Android 模拟器上运行它来检查它是否正常工作,我现在还没有将其设置为网络。在模拟器上运行后,我收到\n以下错误:
\n======== Exception caught by widgets library =======================================================\nThe following _TypeError was thrown building Obx(has builder, dirty, state: _ObxState#c1649):\ntype 'Null' is not a subtype of type 'Widget'\n\nThe relevant error-causing widget was: \n Obx Obx:file:///D:/Noum/Data/Uni%20Data/Codes/Android%20Studio/Flutter/web_ios_android_google_signin/lib/LoginPage.dart:13:15\nWhen the exception was thrown, this was the stack: \n#0 LoginPage.build.<anonymous closure> (package:web_ios_android_google_signin/LoginPage.dart:16:19)\n#1 Obx.build (package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart:70:28)\n#2 RxInterface.notifyChildren (package:get/get_rx/src/rx_types/rx_core/rx_interface.dart:26:27)\n#3 _ObxState.build (package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart:54:19)\n#4 StatefulElement.build (package:flutter/src/widgets/framework.dart:4782:27)\n#5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4665:15)\n#6 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4840:11)\n#7 Element.rebuild (package:flutter/src/widgets/framework.dart:4355:5)\n#8 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4643:5)\n#9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4831:11)\n#184 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1143:15)\n#185 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1080:9)\n#186 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> …Run Code Online (Sandbox Code Playgroud) 我正在编写一个代码,其中我正在使用 firebase 进行注册。包括个人资料图像在内的数据将被火存储。但问题是我遇到了多个无法解决的错误。我的应用程序甚至还没有运行过一次。其中一个错误是 "import:dart:html" ,我检查了所有 dart 文件,但没有找到任何未使用的 dart:html 导入。我使用 import"dart.io" 来表示术语“late File”。我也通过导入 dart:html 进行了尝试,但错误仍然相同。我还尝试删除 ProfileImage 的所有代码,但错误仍然存在。以下是有错误的 y 代码的所有文件:
\n错误
\nLaunching lib\\main.dart on sdk gphone x86 arm in debug mode...\nRunning Gradle task 'assembleDebug'...\nInvalid depfile: D:\\Noum\\Data\\Uni Data\\Codes\\Android Studio\\Flutter\\firebase_flutter_app\\.dart_tool\\flutter_build\\040ba043425f685efe2a35025cf4d63f\\kernel_snapshot.d\nInvalid depfile: D:\\Noum\\Data\\Uni Data\\Codes\\Android Studio\\Flutter\\firebase_flutter_app\\.dart_tool\\flutter_build\\040ba043425f685efe2a35025cf4d63f\\kernel_snapshot.d\n/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.1/lib/src/storage.dart:2:8: Error: Not found: 'dart:html'\nimport 'dart:html';\n ^\n/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.1/lib/src/utils.dart:2:8: Error: Not found: 'dart:html'\nimport 'dart:html';\n ^\n/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/lib/js.dart:8:1: Error: Not found: 'dart:js'\nexport 'dart:js' show allowInterop, allowInteropCaptureThis;\n^\n/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/lib/js_util.dart:8:1: Error: Not found: 'dart:js_util'\nexport 'dart:js_util';\n^\n/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.1/lib/src/auth.dart:340:25: Error: The method 'allowInterop' isn't defined for the class 'Auth'.\n - 'Auth' is …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的 Spring Boot 项目中实现 swagger。我在网上搜索了一下,发现springfox 3.0可能与spring boot 3.0不兼容。我也尝试过旧版本。但我无法做到这一点。我正在使用gradle。
终端错误
构建.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '3.0.1'
id 'io.spring.dependency-management' version '1.1.0'
}
group = 'practice.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '19'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation("io.springfox:springfox-swagger2:3.0.0")
}
tasks.named('test') {
useJUnitPlatform()
}
Run Code Online (Sandbox Code Playgroud)
主java文件
package practice.example.crud_practice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication
@EnableSwagger2
@RestController
public class …Run Code Online (Sandbox Code Playgroud) android ×2
flutter ×2
dart ×1
dart-html ×1
firebase ×1
java ×1
spring-boot ×1
springfox ×1
swagger-3.0 ×1