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

8ulbf1ek  于 2023-01-18  发布在  Flutter
关注(0)|答案(4)|浏览(288)

一切工作,直到我更新MacOS到v 10. 15. 7我不能保证这是真实的的问题,虽然。
同样的代码在Android上可以完美地模拟工作,但当我在iPhone上运行它时,我得到了以下错误:

[   +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 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看起来像这样:

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

在我的信息列表中:

<key>CFBundleVersion</key>
    <string>$(FLUTTER_BUILD_NUMBER)</string>

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

<key>CFBundleShortVersionString</key>
    <string>$(FLUTTER_BUILD_NAME)</string>

我猜从env中获取这些变量有些问题。
先谢了丹尼尔

tcomlyy6

tcomlyy61#

应用程序的信息列表不包含CFBundleVersion

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

**注:**版本可以是任何值,但为了更有意义,我们总是以1.0.0开头,然后随着您的版本增加数字。

wpcxdonn

wpcxdonn2#

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

cuxqih21

cuxqih213#

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

vxqlmq5t

vxqlmq5t4#

我试过所有这些解决方案,但不幸的是没有一个对我有效。经过几个小时的斗争,幸运的是我降落在波纹管解决方案,它对我有效。
https://github.com/flutter/flutter/issues/99995

相关问题