flutter问题汇总,便于大家查找
https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps
确保在mac下工作。
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
如果是静态库,那么这里可以解决 https://blog.csdn.net/nathan1987_/article/details/79757368
如果是pod,那么参考这里: CocoaPods/CocoaPods#7098
Anything works for me :(
Installing pre-release version
Uninstalling cocoapods and installing it again
s.pod_target_xcconfig = { "SWIFT_VERSION" => "4.0" }
echo "4.0" > .swift-version
I do pod spec lint --verbose --no-clean and I get Pods workspace available at ... for inspection.. When I am opening the project it says that:
This workspace has projects that contain source code developed with Swift 2.x. Xcode 9 does not support building or migrating Swift 2.x targets.
Use Xcode 8.x to migrate the code to Swift 3.
基本上是路径不对,试下导入的<>改成"",或者去掉前面的包名,如"AAA/BBB-Swift.h" 改成 "BBB-Swift.h"
在项目中新建一个空白Swift文件,项目会自动创建桥接
swift项目可能会出现这个问题,解决方案: flutter/flutter#14161
Podfile去掉use_framework!
https://github.com/flutter/flutter/wiki/Flutter's-modes https://dartcode.org/docs/running-flutter-apps-in-profile-or-release-modes/
flutter run --release
或者 在项目下床架配置文件:launch.json,dart必须v2.12以上
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
}
]