我已经被Flutter核心的构建错误困扰了好几天。这是iOS构建,到目前为止还没有尝试过Android,因为如果我无法使iOS运行起来就没有关系 :)
Running Xcode build...
Xcode build done. 40.0s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
While building module 'firebase_core' imported from /Users/mikael.melander/Documents/development/swift-it/storyspot/flutter/ios/Runner/GeneratedPluginRegistrant.m:34:
In file included from <module-includes>:1:
In file included from /Users/mikael.melander/Documents/development/swift-it/storyspot/flutter/build/ios/Debug-iphoneos/firebase_core/firebase_core.framework/Headers/firebase_core-umbrella.h:13:
In file included from /Users/mikael.melander/Documents/development/swift-it/storyspot/flutter/build/ios/Debug-iphoneos/firebase_core/firebase_core.framework/Headers/FLTFirebaseCorePlugin.h:11:
/Users/mikael.melander/Documents/development/swift-it/storyspot/flutter/build/ios/Debug-iphoneos/firebase_core/firebase_core.framework/Headers/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': 'Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FirebaseCore.h>
^
1 error generated.
/Users/mikael.melander/Documents/development/swift-it/storyspot/flutter/ios/Runner/GeneratedPluginRegistrant.m:34:9: fatal error: could not build module 'firebase_core'
#import <firebase_core/FLTFirebaseCorePlugin.h>
~~~~~~~^
2 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
我尝试了flutter的不同通道(master, dev和stable)。 我尽可能更新了插件。 我执行了flutter clean,删除了pubspec.lock、podfile.lock、pods和DerivedData等。
Pubspec文件:
environment:
sdk: '>=2.7.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
rxdart: ^0.25.0
http: ^0.12.2
google_maps_flutter: 1.1.1
location: ^3.0.2
dio: 3.0.10
fluster: 1.1.2
flutter_cache_manager: 2.1.1
carousel_slider: 2.2.1
cached_network_image: 2.5.0
cupertino_icons: ^0.1.3
shared_preferences: ^0.5.12+4
intl: 0.16.1
multi_image_picker: 4.7.12
font_awesome_flutter: 8.8.1
get_it: 4.0.4
get: ^3.26.0
introduction_screen: ^1.0.9
smart_select: ^3.0.3
flutter_google_places: 0.2.8
shimmer: ^1.1.1
google_fonts: ^1.1.0
path_provider: ^1.6.14
progress_button: ^0.0.2
email_validator: ^1.0.5
device_info: ^0.4.2+7
audioplayers: 0.16.2
url_launcher: ^5.7.10
google_sign_in: 4.5.3
uni_links: ^0.4.0
share: ^0.6.4+5
progress_dialog: ^1.2.4
dio_http_cache: ^0.2.8
permission_handler: ^5.1.0+2
devicelocale: ^0.3.3
firebase_analytics: ^7.0.1
flutter_sound:
path: /Users/mikael.melander/Documents/development/swift-it/storyspot/tau/flutter_sound
sortedmap: ^0.4.2+1
latlong: ^0.6.1
flutter_svg: ^0.19.1
sign_in_with_apple: ^2.5.4
keyboard_visibility: 0.5.6
image_cropper: ^1.3.1
flutter_bounce: ^1.0.8
flutter_document_picker: ^4.0.1
flutter_email_sender: ^4.0.0
firebase_core: 0.7.0
dev_dependencies:
flutter_test:
sdk: flutter
我正在定制Flutter_sound,但没有更改任何依赖项。 运行最新的7.7.0 + 1版本。
在此示例中,我已添加firebase_core:0.7.0,尝试过未添加它的情况,但是只有与此完全匹配的配置为0.7.0,否则会出现依赖项不匹配。
Flutter医生:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.1.0-11.0.pre.145, on macOS 11.2.1 20D75 darwin-x64, locale en-SE)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
[✓] Connected device (2 available)
! Doctor found issues in 1 category.
我试过稳定版和开发版。
有任何想法吗?我真的卡住了。