Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
错误:';颤振/颤振.h';在iOS上运行flatter时未找到文件_Ios_Flutter_Cocoapods_Flutter Ios_Flutter Ios Build - Fatal编程技术网

错误:';颤振/颤振.h';在iOS上运行flatter时未找到文件

错误:';颤振/颤振.h';在iOS上运行flatter时未找到文件,ios,flutter,cocoapods,flutter-ios,flutter-ios-build,Ios,Flutter,Cocoapods,Flutter Ios,Flutter Ios Build,我不知道为什么,但我不能在我的新Macbook上构建或运行该应用程序,我在另一台Mac或windows电脑上运行同一个文件夹,运行非常完美。 在这里,当我运行flutter clean时,我必须运行pub来解决问题,这正常吗 如果我创建了一个新项目,我可以正常运行flutter,所以我认为可能有 我认为这可能与插件有关 你知道我怎么解决这个问题吗?谢谢 Flutter Doctor [✓] Flutter (Channel master, 1.24.0-8.0.pre.343, on macOS

我不知道为什么,但我不能在我的新Macbook上构建或运行该应用程序,我在另一台Mac或windows电脑上运行同一个文件夹,运行非常完美。 在这里,当我运行flutter clean时,我必须运行pub来解决问题,这正常吗

如果我创建了一个新项目,我可以正常运行flutter,所以我认为可能有 我认为这可能与插件有关

你知道我怎么解决这个问题吗?谢谢

Flutter Doctor
[✓] Flutter (Channel master, 1.24.0-8.0.pre.343, on macOS 11.0.1 20B29 darwin-x64, locale es-419)
    • Flutter version 1.24.0-8.0.pre.343 at /Users/leo/tools/flutter
    • Framework revision cf6c33e58a (2 days ago), 2020-11-21 14:04:01 -0800
    • Engine revision 23a8e027db
    • Dart version 2.12.0 (build 2.12.0-62.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/leo/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      I found a solution!

  1. Backup
    ios/Runner
    folder.

  2. Delete the
    ios
    folder.

  3. Run
    flutter create (your project name)
    . in the previous folder where you have your project(
    cd users/user/"projects_folder"
    ) (this will recreate your
    ios
    folder).

  4. Paste your Runner backup in the
    ios
    folder (into the project).

  5. Open
    Runner.xcworkspace
    (into
    ios
    folder) and there, check the Version, the Bundle ID, all the info.

  6. (If do you Have Firebase, you have to copy and paste again the Google
    Service-Info.Plist
    into the
    Runner
    folder (Always through Xcode) (If do you do this manually, it doesn't work).

Finally,
flutter run
and should work!

If
flutter run
fails:

  1. cd ios
  2. pod install
  3. cd ..
  4. flutter run
A way easier solution:

  1. Remove ios/Flutter/Flutter.podspec:
    rm ios/Flutter/Flutter.podspec
  2. flutter clean
  3. Run your app again.
Taken from here

It's happening caused by switching from master/dev back to beta/stable.

Here are two solutions are summarized

This is a bug of flutter and pod install. When flutter does pod install installation dependencies, the synchronization of the framework file in Flutter leads to the loss of the framework file. Once the card owner is lost once, it is only necessary to execute the pod install command. Can install user-specified dependencies, but cannot synchronize framework files in Flutter

Because of
ios/Flutter/Flutter.podspec
the CocoaPods linking logic was moved into the flutter tool. However, when you switch back to beta/stable, that bogus podspec is still present, but the flutter tool linking logic has been reverted.

1 Solution

The following commands fixed this behavior:

  1. cd ios
    for going to iOS directory of the flutter app
  2. pod deintegrate
  3. rm Flutter/Flutter.podspec
  4. rm podfile.lock
  5. flutter clean
  6. flutter run
2 Solution

If the above solution does not work then try to switch the channel from Master to stable.

to switch your channel, run this in your terminal:

  1. flutter channel stable

  2. flutter clean

  3. flutter run

It might happen that particular iOS POD depedency does not have Flutter dependency.

In my case it was
firebase_crashlytics: ^1.0.0

Unfortunately it is up to maintainer to provide working solution. You might remove cached version located at:

/Users/user/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_crashlytics-1.0.0/ios/firebase_crashlytics.podspec
flatter博士
[✓] 颤振(主通道,1.24.0-8.0.pre.343,在macOS 11.0.1 20B29 darwin-x64上,区域设置es-419)
•颤振版本1.24.0-8.0.pre.343 at/Users/leo/tools/颤振
•框架版本cf6c33e58a(两天前),2020-11-21 14:04:01-0800
•发动机版本23a8e027db
•Dart版本2.12.0(版本2.12.0-62.0.dev)
[✓] Android工具链-为Android设备开发(Android SDK版本30.0.2)
•Android SDK at/Users/leo/Library/Android/SDK
•平台android-30,构建工具30.0.2
•Java二进制地址:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/Java
•Java版本OpenJDK运行时环境(build 1.8.0_242-release-1644-b3-6915495)
•接受所有Android许可证。
[✓] Xcode-为iOS和macOS开发(Xcode 12.2)
•Xcode at/Applications/Xcode.app/Contents/Developer
•Xcode 12.2,构建版本12B45b
•CocoaPods版本1.9.3
[✓] Android Studio(4.1版)
•Android Studio位于/Applications/Android Studio.app/Contents
•颤振插件可从以下位置安装:
我找到了解决办法

  • 备份
    ios/Runner
    文件夹

  • 删除
    ios
    文件夹

  • 在项目所在的上一个文件夹(
    cd-users/user/“projects\u folder”
    )中运行
    flatter create(您的项目名称)
    (这将重新创建您的
    ios
    文件夹)

  • 将Runner备份粘贴到
    ios
    文件夹中(粘贴到项目中)

  • 打开
    Runner.xcworkspace
    (进入
    ios
    文件夹),在那里检查版本、捆绑ID和所有信息

  • (如果你有Firebase,你必须将Google
    Service Info.Plist
    复制并粘贴到
    Runner
    文件夹中(始终通过Xcode)(如果你手动执行此操作,则不起作用)

  • 最后,
    flatter运行
    ,应该可以工作了

    如果
    颤振运行
    失败:

  • cd-ios
  • pod安装
  • cd..
  • 颤振运行
  • 更简单的解决方案:

  • 移除ios/flatter/flatter.podspec:
    rm ios/flatter/flatter.podspec
  • flatter clean
  • 再次运行你的应用程序

  • 取自

    它是由从主/开发切换回测试/稳定引起的

    这里总结了两种解决方案

    这是Flatter和pod安装的一个错误。当Flatter没有安装pod依赖项时,Flatter中框架文件的同步会导致框架文件丢失。一旦卡所有者丢失一次,只需执行pod安装命令。可以安装用户指定的依赖项,但无法同步颤振中的e框架文件

    由于ios/flatter/flatter.podspec
    的原因,CocoaPods链接逻辑被移到了flatter工具中。但是,当您切换回beta/stable时,该伪podspec仍然存在,但flatter工具链接逻辑已恢复

    1个解决方案

    以下命令修复了此行为:

  • cd-ios
    用于转到颤振应用程序的ios目录
  • pod去集成
  • rm颤振/颤振。podspec
  • rm podfile.lock
  • flatter clean
  • 颤振运行
  • 2解决方案

    如果上述解决方案不起作用,则尝试将通道从主通道切换到稳定通道

    要切换频道,请在终端中运行以下命令:

    rm -rf ios
    flutter create -i swift .
    
  • 颤振通道稳定

  • flatter clean

  • 颤振运行


  • 可能发生的情况是,特定的iOS POD依赖性没有颤振依赖性

    在我的例子中,它是
    firebase\u crashlytics:^1.0.0

    遗憾的是,由维护人员提供有效的解决方案。您可以删除位于以下位置的缓存版本:

    s.dependency 'Flutter'
    
    请访问此链接以供参考

    特定第三方库的.podspec应具有:

    Pod::Spec.new do |s|
       ...
    

    然后,在
    ios
    目录中调用
    pod install
    ,以反映更改


    最后,计划您的构建。

    编辑:新版本的Crashlytics刚刚发布用于Flatter 2。只需升级您的pubspec.yml:

      firebase_crashlytics:
        git:
          url: git://github.com/FirebaseExtended/flutterfire.git
          path: packages/firebase_crashlytics/firebase_crashlytics
          ref: 200b8ca8f1c452e4249fb791e53cc55e786ac768
    
    下面是我的旧衣服

    对于颤振2,您可以按照下面粘贴的.Text中的说明进行操作:

    Flatter2.0.4的解决方法是使用git的firebase_crashlytics 而不是pub.dev。这似乎有效(参考当前最新版本) 提交):

    解决方案对我有效:

    从以下位置更改播客文件:

    post_install do |installer|
      installer.pods_project.targets.each do |target| 
        flutter_additional_ios_build_settings(target)
      end
    end
    


    只有两个命令可以节省您的时间。只需通过

    flutter run
    
    flutter pub cache repair
    
    然后简单地运行项目

    flutter run
    
    flutter pub cache repair
    

    删除这些文件,并重新创建为@Raffaelli L.C.应答。 颤振运行命令现在起作用了
    一些对我有用的东西:

    我的pubspec中的一些依赖项已经过时(具体来说,我使用的是crashalytics 1.0.0和Flatter 2.0.5,它们是不兼容的,因此抛出了这个错误)

    将crashalytics升级到2.0.0为我修复了它

    我将调查抛出此错误的任何包,并查看是否有任何升级可用。 如果这不起作用,请尝试降低颤振版本。

    解决方案是
    1-陈
    rm -rf ios
    flutter create -i swift .