1:卡启动页的另外一个情况就是版本运行出错,用xcode运行真机会报错,卡启动页
具体情况如下
Runner[39545:15296040] [VERBOSE-2:dart_vm.cc(259)] VM snapshot must be valid.
Runner[39545:15296040] [VERBOSE-3:shell.cc(212)] Check failed: vm. Must be able to initialize the VM.
解决办法是https://github.com/flutter/flutter/issues/24641
修改Edit Scheme...为release
2:在pubspec.yaml中添加库文件导致的错误
D8: Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/0.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/1.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/2.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/3.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/8.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/9.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/10.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/11.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/12.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/13.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/14.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/15.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/16.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/17.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/18.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/19.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/20.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/21.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/22.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/23.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/24.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/25.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/26.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/27.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/28.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/29.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/30.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/31.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/32.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/33.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/34.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/35.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/36.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/37.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/38.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/39.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/40.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/41.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/42.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/43.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/44.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/45.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/46.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/47.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/48.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/49.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/50.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/51.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/52.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/53.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/54.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/55.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/56.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/57.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/58.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/59.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/60.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/61.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/62.jar
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
*******************************************************************************************
Finished with error: Gradle task assembleDebug failed with exit code 1
解决办法就是在这个文件里面添加如下代码
# 需要在gradle.properties中添加下面两行代码
# 这是因为混合支持库。通过添加这些行选择androidX作为您的支持库
android.useAndroidX=true
android.enableJetifier=true
3:个别页面出现无法进行debug断点调试,打了断点却无作用
///page
import 'package:flutter_employees_pms/Page/DashBoard//DashBoardPage.dart';
改成
///page
import 'package:flutter_employees_pms/Page/DashBoard/DashBoardPage.dart';
就因为这个页面在引用的时候多加了一个/
4:'multi_image_picker/multi_image_picker-Swift.h' file not found
Android没问题,但xcode中编译会报错,找了一圈
在这里填上这句话就好了,暂且不知道原理,应该是swift和OC混编问题
5:The iOS Simulator deployment target is set to x.x, but the range of supported deployment target versions for this platform is 8.0 to 12.0. (in target 'xxx')
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 8.0
把Podfile里底下的代码替换成下面的
![image.png](https://upload-images.jianshu.io/upload_images/1956903-0185cde7be4c2838.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
end
end
end
end
6:warning: Could not find auto-linked framework 'Flutter'
修改xcode的Podfile
config.build_settings['ENABLE_BITCODE'] = 'NO'
注意放在target.build_configurations.each do |config|之下
7:Device doesn't support wireless sync. AMDeviceStartService(device, CFSTR("com.apple.debugserver"), &gdbfd, NULL)
flutter channel dev
/// 或下面
flutter channel master
老版本的bug,升级flutter就好了,但问题就是升级后会有很多改动休要手动修复