【发布时间】:2020-01-16 20:41:35
【问题描述】:
我最近得到了一台 Mac,能够测试我使用 Flutter/Dart 制作的 iOS 应用程序。但是当尝试将我的所有文件传输到 Mac 并尝试对其进行测试时,它会出现“正在运行 Xcode 构建”。
我在我的 pubspec.yaml 文件中导入 2 个东西:
dependicies:
flutter:
sdk:
cupertino_icons: ^0.1.2
firebase_admob: ^0.9.0+10
在我的 podfile 中,我被告知在我拥有的 google admobs 文档中下载该文件
pod 'Google-Mobile_Ads_SDK"
我的 Flutter 医生写道:
[flutter] flutter doctor -v
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57, locale en-US)
• Flutter version 1.12.13+hotfix.5 at /Users/priscilla/Desktop/Temp/flutter
• Framework revision 27321ebbad (5 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/priscilla/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /usr/bin/java
✗ Could not determine java version
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.8.4
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/setup/#android-setup for detailed instructions).
[✓] Connected device (1 available)
• iPhone 11 Pro Max • 754DF0BD-203E-4A0A-B785-E92D4B1D9C38 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
! Doctor found issues in 2 categories.
我的 info.plist 的更改是:(实际的应用程序 ID 在我的代码中,只是不想在这里发布)
<key>GADApplicationIdentifier</key>
<string>[APP_ID]</string>
如果我要从头开始创建一个新的 Flutter 项目,那么给定的代码运行得非常好。就在我尝试将 Windows PC 上的项目文件导入 Mac 时。
我认为一个解决方案是创建一个新的 Flutter 项目并在创建时导入我的文件,但我不知道该怎么做。所以此刻,我创建了一个新的 Flutter 项目,删除了所有最初加载的文件,然后将它们替换为我的项目文件。
【问题讨论】:
-
尝试运行
flutter clean,我不知道它是否会修复,但肯定会有所帮助 -
@Tizianoreica 我试过了,仍然卡在运行 xcode build
-
你试过运行flutter clean和pod install吗?并重建?