请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

flutter build ios --release命令就报一大堆的错误

老师您好,我现在用Flutter2.0.6做这个项目,开发模式可以运行,但是执行flutter build ios --release命令就报一大堆的错误,错误信息都是第三方依赖里的一些问题,但是开发模式运行没啥问题呀。。。下面是我截取的部分报错信息:
…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/win32-2.0.5/lib/src/com/IWbemServices.dart:366:43: Error: Type argument ‘Utf16’ doesn’t conform to the
bound ‘NativeType’ of the type variable ‘T’ on ‘Pointer’.
- ‘Utf16’ is from ‘package:ffi/src/utf16.dart’ (’…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/ffi-1.1.2/lib/src/utf16.dart’).
- ‘NativeType’ is from ‘dart:ffi’.
Try changing type arguments so that they conform to the bounds.
int CreateClassEnumAsync(Pointer strSuperclass, int lFlags,

…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/device_info_platform_interface-2.0.1/lib/model/android_device_info.dart:17:5: Error: Type 'required’
not found.
required this.fingerprint,
^^^^^^^^
…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/device_info_platform_interface-2.0.1/lib/model/android_device_info.dart:18:5: Error: Type 'required’
not found.

…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/flutter_easyrefresh-2.2.1/lib/src/footer/footer.dart:214:3: Error: Type ‘late’ not found.
late AxisDirection axisDirection;
^^^^
…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/flutter_easyrefresh-2.2.1/lib/src/footer/footer.dart:215:3: Error: Type ‘late’ not found.
late bool float;
^^^^
…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/flutter_easyrefresh-2.2.1/lib/src/footer/footer.dart:217:3: Error: Type ‘late’ not found.
late bool enableInfiniteLoad;
^^^^
…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/flutter_easyrefresh-2.2.1/lib/src/footer/footer.dart:372:7: Error: ‘required’ isn’t a type.
required this.loadState,
^^^^^^^^
…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/meta-1.3.0/lib/meta.dart:240:16: Context: This isn’t a type.
const Required required = Required();

…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/flutter_screenutil-5.0.0+2/lib/screen_util.dart:43:5: Error: Getter not found: ‘_instance’.
_instance._pixelRatio = window.devicePixelRatio;
^^^^^^^^^
…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/flutter_screenutil-5.0.0+2/lib/screen_util.dart:44:5: Error: Getter not found: ‘_instance’.
_instance._statusBarHeight = window.padding.top;
^^^^^^^^^
…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/flutter_screenutil-5.0.0+2/lib/screen_util.dart:45:5: Error: Getter not found: ‘_instance’.
_instance._bottomBarHeight = window.padding.bottom;
^^^^^^^^^
…/…/…/flutter206/.pub-cache/hosted/pub.flutter-io.cn/flutter_screenutil-5.0.0+2/lib/screen_util.dart:46:5: Error: Getter not found: ‘_instance’.
_instance._textScaleFactor = window.textScaleFactor;
^^^^^^^^^
Unhandled exception:
Crash when compiling file:///Users/guijie/flutter206/.pub-cache/hosted/pub.flutter-io.cn/flutter_screenutil-5.0.0+2/lib/size_extension.dart,
at character offset 102:
type ‘InvalidType’ is not a subtype of type ‘InterfaceType’
#0 computeConstructorReturnType (package:front_end/src/fasta/kernel/internal_ast.dart:59:5)
#1 InferenceVisitor.visitFactoryConstructorInvocationJudgment (package:front_end/src/fasta/kernel/inference_visitor.dart:727:9)
#2 FactoryConstructorInvocationJudgment.acceptInference (package:front_end/src/fasta/kernel/internal_ast.dart:684:20)
#3 TypeInferrerImpl.inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:1583:27)
#4 InferenceVisitor.visitMethodInvocation (package:front_end/src/fasta/kernel/inference_visitor.dart:2410:18)
#5 MethodInvocation.accept1 (package:kernel/ast.dart:4002:9)
#6 TypeInferrerImpl.inferExpression (package:front_end/src/fasta/type_inference/type_inferrer.dart:1587:27)
#7 InferenceVisitor.visitReturnStatement (package:front_end/src/fasta/kernel/inference_visitor.dart:5061:61)
#8 ReturnStatement.accept (package:kernel/ast.dart:6541:43)
#9 TypeInferrerImpl.inferStatement (package:front_end/src/fasta/type_inference/type_inferrer.dart:3081:24)
#10 TypeInferrerImpl.inferFunctionBody (package:front_end/src/fasta/type_inference/type_inferrer.dart:1628:39)
#11 BodyBuilder.finishFunction (package:front_end/src/fasta/kernel/body_builder.dart:989:28)
#12 DietListener.listenerFinishFunction (package:front_end/src/fasta/source/diet_listener.dart:955:14)
#13 DietListener.buildFunctionBody (package:front_end/src/fasta/source/diet_listener.dart:993:7)
#14 DietListener._endClassMethod (package:front_end/src/fasta/source/diet_listener.dart:714:5)
#15 DietListener.endExtensionMethod (package:front_end/src/fasta/source/diet_listener.dart:686:5)
#16 Parser.parseMethod (package:_fe_analyzer_shared/src/parser/parser_impl.dart:3817:20)
#17 Parser.parseClassOrMixinOrExtensionMemberImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:3546:15)
#18 Parser.parseClassOrMixinOrExtensionBody (package:_fe_analyzer_shared/src/parser/parser_impl.dart:3220:15)
#19 Parser.parseExtension (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2277:13)
#20 Parser.parseTopLevelKeywordDeclaration (package:_fe_analyzer_shared/src/parser/parser_impl.dart:622:18)
#21 Parser.parseTopLevelDeclarationImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:476:14)
#22 Parser.parseUnit (package:_fe_analyzer_shared/src/parser/parser_impl.dart:356:15)
#23 SourceLoader.buildBody (package:front_end/src/fasta/source/source_loader.dart:436:18)

#24 Loader.buildBodies (package:front_end/src/fasta/loader.dart:242:15)

#25 KernelTarget.buildComponent. (package:front_end/src/fasta/kernel/kernel_target.dart:382:20)
#26 withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#27 KernelTarget.buildComponent (package:front_end/src/fasta/kernel/kernel_target.dart:380:12)
#28 generateKernelInternal. (package:front_end/src/kernel_generator_impl.dart:177:38)

#29 generateKernelInternal. (package:front_end/src/kernel_generator_impl.dart)
#30 withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#31 generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:73:10)
#32 kernelForProgramInternal. (package:front_end/src/api_prototype/kernel_generator.dart:61:35)
#33 CompilerContext.runWithOptions. (package:front_end/src/fasta/compiler_context.dart:135:20)

#34 CompilerContext.runWithOptions. (package:front_end/src/fasta/compiler_context.dart)
#35 CompilerContext.runInContext.. (package:front_end/src/fasta/compiler_context.dart:123:46)
#36 new Future.sync (dart:async/future.dart:223:31)
#37 CompilerContext.runInContext. (package:front_end/src/fasta/compiler_context.dart:123:19)
#38 _rootRun (dart:async/zone.dart:1190:13)
#39 _CustomZone.run (dart:async/zone.dart:1093:19)
#40 _runZoned (dart:async/zone.dart:1630:10)
#41 runZoned (dart:async/zone.dart:1550:10)
#42 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#43 CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:133:10)
#44 kernelForProgramInternal (package:front_end/src/api_prototype/kernel_generator.dart:60:32)
#45 kernelForProgram (package:front_end/src/api_prototype/kernel_generator.dart:52:17)
#46 compileToKernel (package:vm/kernel_front_end.dart:381:28)
#47 FrontendCompiler.compile. (package:frontend_server/frontend_server.dart:542:54)
#48 new Future. (dart:async/future.dart:175:37)
#49 _rootRun (dart:async/zone.dart:1182:47)
#50 _CustomZone.run (dart:async/zone.dart:1093:19)
#51 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#52 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)
#53 _rootRun (dart:async/zone.dart:1190:13)
#54 _CustomZone.run (dart:async/zone.dart:1093:19)
#55 _CustomZone.bindCallback. (dart:async/zone.dart:1021:23)
#56 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
#57 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
#58 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
#59 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

#0      DietListener.buildFunctionBody (package:front_end/src/fasta/source/diet_listener.dart:998:7)
#1      DietListener._endClassMethod (package:front_end/src/fasta/source/diet_listener.dart:714:5)
#2      DietListener.endExtensionMethod (package:front_end/src/fasta/source/diet_listener.dart:686:5)
#3      Parser.parseMethod (package:_fe_analyzer_shared/src/parser/parser_impl.dart:3817:20)
#4      Parser.parseClassOrMixinOrExtensionMemberImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:3546:15)
#5      Parser.parseClassOrMixinOrExtensionBody (package:_fe_analyzer_shared/src/parser/parser_impl.dart:3220:15)
#6      Parser.parseExtension (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2277:13)
#7      Parser.parseTopLevelKeywordDeclaration (package:_fe_analyzer_shared/src/parser/parser_impl.dart:622:18)
#8      Parser.parseTopLevelDeclarationImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:476:14)
#9      Parser.parseUnit (package:_fe_analyzer_shared/src/parser/parser_impl.dart:356:15)
#10     SourceLoader.buildBody (package:front_end/src/fasta/source/source_loader.dart:436:18)
<asynchronous suspension>
#11     Loader.buildBodies (package:front_end/src/fasta/loader.dart:242:15)
<asynchronous suspension>
#12     KernelTarget.buildComponent.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:382:20)
#13     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#14     KernelTarget.buildComponent (package:front_end/src/fasta/kernel/kernel_target.dart:380:12)
#15     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:177:38)
<asynchronous suspension>
#16     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart)
#17     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#18     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:73:10)
#19     kernelForProgramInternal.<anonymous closure> (package:front_end/src/api_prototype/kernel_generator.dart:61:35)
#20     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:135:20)
<asynchronous suspension>
#21     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart)
#22     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:46)
#23     new Future.sync (dart:async/future.dart:223:31)
#24     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:19)
#25     _rootRun (dart:async/zone.dart:1190:13)
#26     _CustomZone.run (dart:async/zone.dart:1093:19)
#27     _runZoned (dart:async/zone.dart:1630:10)
#28     runZoned (dart:async/zone.dart:1550:10)
#29     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#30     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:133:10)
#31     kernelForProgramInternal (package:front_end/src/api_prototype/kernel_generator.dart:60:32)
#32     kernelForProgram (package:front_end/src/api_prototype/kernel_generator.dart:52:17)
#33     compileToKernel (package:vm/kernel_front_end.dart:381:28)
#34     FrontendCompiler.compile.<anonymous closure> (package:frontend_server/frontend_server.dart:542:54)
#35     new Future.<anonymous closure> (dart:async/future.dart:175:37)
#36     _rootRun (dart:async/zone.dart:1182:47)
#37     _CustomZone.run (dart:async/zone.dart:1093:19)
#38     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#39     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#40     _rootRun (dart:async/zone.dart:1190:13)
#41     _CustomZone.run (dart:async/zone.dart:1093:19)
#42     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1021:23)
#43     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#44     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
#45     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
#46     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

太多了一大堆,都无法显示全。。。

正在回答 回答被采纳积分+3

1回答

CrazyCodeBoy 2021-07-29 08:59:47

直接运行iOS能运行吗,另外,flutter doctor检查下flutter环境

0 回复 有任何疑惑可以回复我~
  • 提问者 慕设计3399965 #1
    直接运行iOS是没啥问题的,但是执行release命令就不行
    回复 有任何疑惑可以回复我~ 2021-07-29 13:59:36
  • 提问者 慕设计3399965 #2
    打包好了老师,我下载了最新的SDK就好了。。。太奇怪了
    回复 有任何疑惑可以回复我~ 2021-07-29 14:19:08
  • CrazyCodeBoy 回复 提问者 慕设计3399965 #3
    看样子是SDK不匹配导致的。
    回复 有任何疑惑可以回复我~ 2021-07-30 09:07:24
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信