IOS上面上次代码运行了,下次不必定能够继续运行html
正题,此次我ios
代码运行后结果以下git
搜了下,都是让我更新。缓存
我依然记起上个月,我拿着电脑在楼下创业公司蹭网一早上。bash
当时,我去楼下小坐,打开电脑开始写flutter,我但愿能看到漂亮的单身妹子路过。app
而后我输入flutter run,等待运行,而后报错了。ide
在这个过程当中,我没有更新包,没有修改代码 而上次我只是关闭电脑 此次我点开运行而已ui
我感受到了窒息this
而后根据错误,找到了答案,我不争气的按照别人说的开始更新一堆东西,而后能够了。spa
这一次,我遇到了错误,可是不不看提示(看了也没找到好的解决方案,依然是让我更新环境)
倔强的我拒绝了,我想知道,到底哪里出了问题,我正常运行,凭什么让我更新环境。
难道我离线就不能开发了么。
因而开始了探索之旅。
上面那个错误,直接看我是找不到好的方案,因而开始修改依赖。
而后每一次修改都会更新,,更新依赖🈶️贼慢,由于我用vscode,vscode里面的dart插件就是这样,而后我修改配置拒绝让它自动更新。
而后发现有了新的错误,个人天。。
以前的错误被刷走了,我丢失了研究的机会。
而后仍是一堆问题,因而我新建一个flutter项目, 我想知道到底flutter有没有挂掉。而后发现它正常运行。
flutter create myapp
复制代码
接着把里面的依赖一个个加过去,好比把IOS的包加过去,居然同样,而后我就把安卓也加过去,居然能够了,可是这时候我没有添加依赖,我把依赖又加上去,发现挂掉了。
而后运行一下子,flutter整个都挂掉了。 我去新建的项目运行也是。
这时候我发现环境出了问题,找到flutter目录,(不是项目目录),里面会有错误信息,也就是.log结尾的问题。看了下错误,发现是git的错误,说git第一次须要提交。
什么鬼。
去你的吧,干脆把git代码初始化,由于确定有哪里被改了。
对了 致使flutter环境挂掉的是这个命令 flutter doctor
而之因此我要运行这个是由于,运行run的时候,提示找不到设备,我开了模拟器的,这个没有问题,我也查看了下设备确实存在,有截图为证
看有一个可用的ISO设备, 而运行却跟我说不存在,,,个人天。
最后呢,跑到git目录下面执行
git checkout . && git clean -xdf
复制代码
嗯 能够了
接着问题尚未解决
我又不死心,既然文件都同样,凭什么新建的项目能够运行,多是哪里又被修改了,虽然我刚刚复制过去不久,因而一次性复制了安卓 iOS lib代码 和依赖 而且执行了flutter clean 这时候果真不报莫名其妙的错误了,
开始正经以下错误。
[!] Automatically assigning platform `ios` with version `8.0` on target
`Runner` because no platform was specified. Please specify a platform for
this target in your Podfile. See
`https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies. To update the CocoaPods specs, run: pod repo update Error running pod install Error launching application on iPhone Xʀ. 复制代码
这里说的是须要安装ios依赖,须要去ios根目录安装
cd ios
pod install --verbose
复制代码
每次修改完成ios记得执行下 flutter clean
(pod是ios的包管理器命令,包管理器叫CocoaPods)
完成以后
这时候
[!] `<PBXGroup UUID=`97C146E51CF9000F007C117D`>` attempted to initialize an
object with an unknown UUID. `CF3B75C9A7D2FA2A4C99F110` for attribute:
`children`. This can be the result of a merge and the unknown UUID is being
discarded.
复制代码
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output: ↳ error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') error: /Users/xiexiuyue/Documents/www/flutter/cjyy/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner') warning: Capabilities for Runner may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the build settings editor. (in target 'Runner') note: Using new build systemnote: Planning buildnote: Constructing build description Could not build the application for the simulator. Error launching application on iPhone Xʀ. 复制代码
安装一些插件会致使IOS原生代码发生变化,这时候若是觉得单单是由于改了而后恢复原来的,继续执行,若是发现错误就clean而后继续,会发现错误继续。
没错,flutter run
、 flutter pub get
都会致使IOS原生代码的修改,这时候无论怎么搞,代码都没法执行,这时候就得找到上次得代码了,而后看最近添加的几个包里面,排查是哪一个包出现的问题。
--未完,持续更新--