首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CFBundleVersion :应用程序的Info.plist不包含Flutter

CFBundleVersion :应用程序的Info.plist不包含Flutter
EN

Stack Overflow用户
提问于 2020-10-11 17:58:15
回答 3查看 828关注 0票数 3

不过,在我将MacOS更新到10.15.7版本之前,我不能保证这是真正的问题所在。

同样的代码在安卓上运行得很好,但当我在iPhone上运行它时,我得到了以下错误:

代码语言:javascript
复制
[   +2 ms] Unable to install /Users/***/project_dir/build/ios/iphonesimulator/Runner.app on 4E3679AE-08E6-4DBE-A940-20E4D34F2122. This is
sometimes caused
           by a malformed plist file:
           ProcessException: Process exited abnormally:
           An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
           Failed to install the requested application
           The application's Info.plist does not contain CFBundleVersion.
           Ensure your bundle contains a CFBundleVersion.
             Command: /usr/bin/xcrun simctl install 4E3679AE-08E6-4DBE-A940-20E4D34F2122
/Users/***/project_dir/build/ios/iphonesimulator/Runner.app
[   +1 ms] Error launching application on iPhone 11 Pro.
[   +3 ms] "flutter run" took 41.403ms.
[  +10 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:607:7)
           <asynchronous suspension>
           #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:977:18)
           #3      _rootRunUnary (dart:async/zone.dart:1198:47)
           #4      _CustomZone.runUnary (dart:async/zone.dart:1100:19)
           #5      _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
           #6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
           #7      Future._propagateToListeners (dart:async/future_impl.dart:725:32)
           #8      Future._completeWithValue (dart:async/future_impl.dart:529:5)
           #9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
           #10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
           #11     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
           #12     _rootRunUnary (dart:async/zone.dart:1198:47)
           #13     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
           #14     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
           #15     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
           #16     Future._propagateToListeners (dart:async/future_impl.dart:725:32)
           #17     Future._completeWithValue (dart:async/future_impl.dart:529:5)
           #18     Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
           #19     _rootRun (dart:async/zone.dart:1190:13)
           #20     _CustomZone.run (dart:async/zone.dart:1093:19)
           #21     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
           #22     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
           #23     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
           #24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
           #25     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
           #26     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

flutter医生没有问题:

代码语言:javascript
复制
╰─❯ flutter doctor
[✓] Flutter (Channel stable, 1.22.1, on Mac OS X 10.15.7 19H2, locale it-SE)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.49.3)
[✓] Connected device (2 available)

• No issues found!

我尝试过在其他线程中提出解决方案,但都不起作用。

我的pubspec.yaml看起来像这样:

代码语言:javascript
复制
name: eat_eat_shop
description: Nom Nom.

version: 1.0.0+1

environment:
  sdk: ">=2.8.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.0
  flutter_bloc: ^6.0.5
  equatable: ^1.2.5
  firebase_auth: ^0.18.0+1
  dartz: ^0.9.1
  freezed_annotation: ^0.12.0
  firebase_core: ^0.5.0
  google_sign_in: ^4.5.4
  cloud_firestore: ^0.14.0+2
  firebase_storage: ^4.0.0
  get_it: ^4.0.4
  injectable: ^1.0.4
  flushbar: ^1.10.4
  uuid: ^2.2.2
  auto_route: ^0.6.7
  image: ^2.1.17
  kt_dart: ^0.7.0+1
  json_annotation: ^3.1.0
  rxdart: ^0.24.1
  flutter_cache_manager_firebase: ^1.0.1
  file_picker: ^2.0.3
  flutter_hooks: ^0.14.0
  path_provider: ^1.6.18
  logger: ^0.9.3
  firebase_image: ^0.2.0

dev_dependencies:
  build_runner:
  flutter_test:
    sdk: flutter
  mockito: ^4.1.0
  freezed: ^0.12.1
  lint: ^1.2.0
  injectable_generator: ^1.0.4
  auto_route_generator: ^0.6.8
  json_serializable: ^3.5.0

flutter:
  uses-material-design: true
  assets:
    - images/default_product_image.png

在我的info.plist中:

代码语言:javascript
复制
    <key>CFBundleVersion</key>
    <string>$(FLUTTER_BUILD_NUMBER)</string>

一旦我对CFBundleShortVersionString进行硬编码,CFBundleVersion就会发生同样的事情:

代码语言:javascript
复制
    <key>CFBundleShortVersionString</key>
    <string>$(FLUTTER_BUILD_NAME)</string>

我猜是从env获取这些变量时出现了一些问题。

先谢谢你,大牛

EN

回答 3

Stack Overflow用户

发布于 2021-07-17 00:08:11

应用程序的Info.plist不包含CFBundleVersion

当我们没有在Xcode中声明Version文件时,就会出现上面的错误

注意:版本可以是任何东西,但为了有意义,我们总是从1.0.0开始,然后随着您的发布而递增数字。

票数 2
EN

Stack Overflow用户

发布于 2022-01-06 15:07:19

我有我的主要目标的正确版本,但我忘记了我的其他目标,确保他们也有一个版本和内部版本号

票数 0
EN

Stack Overflow用户

发布于 2022-01-18 08:12:33

我也遇到过同样的问题,它是由于格式化info.plist文件时出错而发生的,我通过将其返回到默认视图来解决它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64302737

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档