【问题标题】:flutter app will not run, cannot work out why颤振应用程序无法运行,无法找出原因
【发布时间】:2020-02-22 04:22:59
【问题描述】:

我有一个要移植到 iphone 的 android 应用程序。几乎准备好了,在我的测试 iphone 上运行 30 多个编译,同时进行更改等。在提交到商店之前我需要运行的最后一次编译失败。

我为此花费了无数个小时,走上了许多不同的道路。从锁定文件夹中的损坏文件开始,通过不再有证书钥匙串条目移动,现在终于到了一个我什至不再知道出了什么问题的地方,所以我迫切需要一些帮助。

这是我的颤振医生的输出:

dev@Users-Mac my_app % flutter doctor -v

[!] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.15.4 19E224g,
locale en-AU)
• Flutter version 1.7.8+hotfix.4 at /Users/dev/flutter
• Framework revision 20e59316b8 (7 months ago), 2019-07-18
20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0
✗ Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information


[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/setup/#android-setup for detailed
instructions).
If the Android SDK has been installed to a custom location, set
ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.

[✓] 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.7.5
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.10.0
[!] 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 • 39c7fe9b4c604a4bb9340e269626a • ios • iOS
13.3.1
! Doctor found issues in 3 categories.

这就是我现在从 flutter run -v 得到的:

TL;DR 部分可能在这里?这也是我尝试从 Xcode 启动时遇到的相同错误,但正如我所说,我之前能够多次运行此应用程序,但我没有添加任何内容:

/Users/dev/.pub-cache/hosted/pub.dartlang.org/firebase_dynamic_links-.4.0+4/ios/Classes/FirebaseDynamicLinksPlugin.m:2:
9: fatal error: 'UserAgent.h' file not found
#import "UserAgent.h"
^~~~~~~~~~~~~
1 error generated.

更大的输出在这里,但由于字符限制,我无法包括所有输出:

    /Users/dev/.pub-cache/hosted/pub.dartlang.org/firebase_auth-
0.11.1+7/ios/Classes/FirebaseAuthPlugin.m:6:9: fatal error:
'UserAgent.h' file not found
#import "UserAgent.h"
^~~~~~~~~~~~~
1 error generated.
ProcessInfoPlistFile
/Users/dev/Projects/my_app/build/ios/Debug-iphoneos/fi
rebase_admob/firebase_admob.framework/Info.plist
/Users/dev/Projects/my_app/ios/Pods/Target\ Support\
Files/firebase_admob/firebase_admob-Info.plist (in target
'firebase_admob' from project 'Pods')
cd /Users/dev/Projects/my_app/ios/Pods
builtin-infoPlistUtility
/Users/dev/Projects/my_app/ios/Pods/Target\
Support\ Files/firebase_admob/firebase_admob-Info.plist
-producttype com.apple.product-type.framework
-expandbuildsettings -format binary -platform iphoneos
-requiredArchitecture arm64 -o
/Users/dev/Projects/my_app/build/ios/Debug-iphoneo
s/firebase_admob/firebase_admob.framework/Info.plist
** BUILD FAILED **
The following build commands failed:
CompileC
/Users/dev/Library/Developer/Xcode/DerivedData/Runner-gclpd
pnsdqsmkseciycckchipfzl/Build/Intermediates.noindex/Pods.bu
ild/Debug-iphoneos/firebase_dynamic_links.build/Objects-nor
mal/arm64/FirebaseDynamicLinksPlugin.o
/Users/dev/.pub-cache/hosted/pub.dartlang.org/firebase_dyna
mic_links-0.4.0+4/ios/Classes/FirebaseDynamicLinksPlugin.m
normal arm64 objective-c
com.apple.compilers.llvm.clang.1_0.compiler
CompileC
/Users/dev/Library/Developer/Xcode/DerivedData/Runner-gclpd
pnsdqsmkseciycckchipfzl/Build/Intermediates.noindex/Pods.bu
ild/Debug-iphoneos/firebase_core.build/Objects-normal/arm64
/FirebaseCorePlugin.o
/Users/dev/.pub-cache/hosted/pub.dartlang.org/firebase_core
-0.4.0+9/ios/Classes/FirebaseCorePlugin.m normal arm64
objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC
/Users/dev/Library/Developer/Xcode/DerivedData/Runner-gclpd
pnsdqsmkseciycckchipfzl/Build/Intermediates.noindex/Pods.bu
ild/Debug-iphoneos/firebase_auth.build/Objects-normal/arm64
/FirebaseAuthPlugin.o
/Users/dev/.pub-cache/hosted/pub.dartlang.org/firebase_auth
-0.11.1+7/ios/Classes/FirebaseAuthPlugin.m normal arm64
objective-c com.apple.compilers.llvm.clang.1_0.compiler
(3 failures)
[ +74 ms] Running Xcode build... (completed in 6,564ms, longer than
expected)


[ +28 ms] Failed to build iOS app
[ +1 ms] Error output from Xcode build:
↳
[ +2 ms] ** BUILD FAILED **
The following build commands failed:
CompileC
/Users/dev/Library/Developer/Xcode/DerivedData/Runnergclpdpnsdqsmkseciycck
chipfzl/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/
firebase_dyna
mic_links.build/Objects-normal/arm64/FirebaseDynamicLinksPlugin.o
/Users/dev/.pub-cache/hosted/pub.dartlang.org/
firebase_dynamic_links-0.4.0+
4/ios/Classes/FirebaseDynamicLinksPlugin.m normal arm64
objective-c
com.apple.compilers.llvm.clang.1_0.compiler
CompileC
/Users/dev/Library/Developer/Xcode/DerivedData/Runnergclpdpnsdqsmkseciycck
chipfzl/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/
firebase_core
.build/Objects-normal/arm64/FirebaseCorePlugin.o
/Users/dev/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.0+9/
ios/Cla
sses/FirebaseCorePlugin.m normal arm64 objective-c
com.apple.compilers.llvm.clang.1_0.compiler
CompileC
/Users/dev/Library/Developer/Xcode/DerivedData/Runnergclpdpnsdqsmkseciycck
chipfzl/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/
firebase_auth
.build/Objects-normal/arm64/FirebaseAuthPlugin.o
/Users/dev/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+7/
ios/Cl
asses/FirebaseAuthPlugin.m normal arm64 objective-c
com.apple.compilers.llvm.clang.1_0.compiler
(3 failures)

【问题讨论】:

    标签: ios xcode flutter


    【解决方案1】:

    像这样使用

    dependencies: 
      firebase_auth: 0.15.3
    dependency_overrides:
      firebase_core: 0.4.4
    

    【讨论】:

      【解决方案2】:

      我能找到的唯一解决方法是运行 xcode 并选择打开目标,而不是项目。然后,该软件将知道如何毫无问题地找到所有这些头文件。

      对我来说,这似乎不是一个适当的解决方案,看起来后端编码真的很差。但既然他们没有做任何事情来解决他们的烂摊子,就暂时使用这种方法。

      【讨论】:

        猜你喜欢
        • 2021-04-19
        • 1970-01-01
        • 2018-11-19
        • 2020-02-12
        • 2019-05-03
        • 2020-08-19
        • 2019-05-07
        • 2019-06-03
        • 2021-06-06
        相关资源
        最近更新 更多